lkml.org 
[lkml]   [2009]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 2/2] tracing/events: Add kexec tracepoints
    From
    Date
    On Wed, 2009-09-09 at 11:19 -0400, Steven Rostedt wrote:
    > On Wed, 2009-09-09 at 07:12 -0700, Daniel Walker wrote:
    > > On Wed, 2009-09-09 at 07:46 -0400, Steven Rostedt wrote:
    > > > On Tue, 2009-09-08 at 21:59 -0700, Daniel Walker wrote:
    > > > > On Wed, 2009-09-09 at 09:26 +0800, Li Zefan wrote:
    > > > > > Daniel Walker wrote:
    > > > > > > On Wed, 2009-09-09 at 09:15 +0800, Li Zefan wrote:
    > > > > > >> + TP_STRUCT__entry(
    > > > > > >> + __string( msg, msg )
    > > > > > >> + ),
    > > > > > >
    > > > > > > Why the funny spacing here?
    > > > > > >
    > > > > >
    > > > > > To make the code better-looking.
    > > > > >
    > > > > > This is the coding-style we use for the code in
    > > > > > include/trace/events/*.
    > > > >
    > > > > It's part of Linux right? We already have a coding style ..
    > > >
    > > > It's a special macro. What are you now, part of the style police?
    > >
    > > I'm just like everyone else, someone who asks questions and makes
    > > comments .. By using a different style than what the rest of Linux uses
    > > your putting yourself at a disadvantage since you can't easily use
    > > checkpatch on that code (even the stuff that is compliant) ..
    >
    > I'm fine with questions, but yours sounded a bit more cynical

    I'm never cynical (not on purpose anyway). I was just saying it like it
    is ..

    > And here's that same code with normal Linux style:
    >
    > TRACE_EVENT(sched_wait_task,
    > TP_PROTO(struct rq *rq, struct task_struct *p),
    > TP_ARGS(rq, p),
    > TP_STRUCT__entry(__array(char, comm, TASK_COMM_LEN)
    > __field(pid_t, pid)
    > __field(int, prio)),
    > TP_fast_assign(memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
    > __entry->pid = p->pid;
    > __entry->prio = p->prio;
    > ),
    > TP_printk("task %s:%d [%d]",
    > __entry->comm, __entry->pid, __entry->prio));


    The below is checkpatch clean ..

    TRACE_EVENT(sched_wait_task,

    TP_PROTO(struct rq *rq, struct task_struct *p),

    TP_ARGS(rq, p),

    TP_STRUCT__entry(
    __array(char, comm, TASK_COMM_LEN)
    __field(pid_t, pid)
    __field(int, prio)
    ),

    TP_fast_assign(
    memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
    __entry->pid = p->pid;
    __entry->prio = p->prio;
    ),

    TP_printk("task %s:%d [%d]",
    __entry->comm, __entry->pid, __entry->prio)
    );


    That's not radically different from what you currently have .. You could
    still align the fields with tabs. You just have to remove the
    starting/ending tabs..

    Daniel



    \
     
     \ /
      Last update: 2009-09-09 18:01    [W:0.024 / U:59.080 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site