lkml.org 
[lkml]   [2009]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH 1/1] tracing, workqueuetrace: Make workqueue tracepoints use TRACE_EVENT macro
    Date
    Hi,

    hehe, I also have similar patch in my local patch queue ;)

    > +TRACE_EVENT(workqueue_insertion,
    > +
    > + TP_PROTO(struct task_struct *wq_thread, struct work_struct *work),
    > +
    > + TP_ARGS(wq_thread, work),
    > +
    > + TP_STRUCT__entry(
    > + __array( char, thread_comm, TASK_COMM_LEN )
    > + __field( pid_t, thread_pid )
    > + __field( struct work_struct *, work )
    > + __field( work_func_t, func )
    > + ),
    > +
    > + TP_fast_assign(
    > + memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN);
    > + __entry->thread_pid = wq_thread->pid;
    > + __entry->work = work;
    > + __entry->func = work->func;
    > + ),
    > +
    > + TP_printk("thread=%s:%d work=%p func=%p", __entry->thread_comm,
    > + __entry->thread_pid, __entry->work, __entry->func)
    > +);

    please don't display raw kernel pointer.

    work: unnecessary. it's internal information and func name provide enough
    information.
    func: %pF can print pritty format


    > +
    > +TRACE_EVENT(workqueue_execution,
    > +
    > + TP_PROTO(struct task_struct *wq_thread, struct work_struct *work),
    > +
    > + TP_ARGS(wq_thread, work),
    > +
    > + TP_STRUCT__entry(
    > + __array( char, thread_comm, TASK_COMM_LEN )
    > + __field( pid_t, thread_pid )
    > + __field( struct work_struct *, work )
    > + __field( work_func_t, func )
    > + ),
    > +
    > + TP_fast_assign(
    > + memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN);
    > + __entry->thread_pid = wq_thread->pid;
    > + __entry->work = work;
    > + __entry->func = work->func;
    > + ),
    > +
    > + TP_printk("thread=%s:%d work=%p func=%p", __entry->thread_comm,
    > + __entry->thread_pid, __entry->work, __entry->func)
    > +);

    ditto.

    and, I plan to rename this tracepoint to workqueue_handler_entry()
    and create workqueue_handler_exit().

    It's because stupid driver comsume many cputime in workqueue thread,
    it make delay to after work. We need mesure it.


    > +
    > +/* Trace the creation of one workqueue thread on a cpu */
    > +TRACE_EVENT(workqueue_creation,
    > +
    > + TP_PROTO(struct task_struct *wq_thread, int cpu),
    > +
    > + TP_ARGS(wq_thread, cpu),
    > +
    > + TP_STRUCT__entry(
    > + __array( char, thread_comm, TASK_COMM_LEN )
    > + __field( pid_t, thread_pid )
    > + __field( int, cpu )
    > + ),
    > +
    > + TP_fast_assign(
    > + memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN);
    > + __entry->thread_pid = wq_thread->pid;
    > + __entry->cpu = cpu;
    > + ),
    > +
    > + TP_printk("thread=%s:%d cpu=%d", __entry->thread_comm,
    > + __entry->thread_pid, __entry->cpu)
    > +);
    > +
    > +TRACE_EVENT(workqueue_destruction,
    > +
    > + TP_PROTO(struct task_struct *wq_thread),
    > +
    > + TP_ARGS(wq_thread),
    > +
    > + TP_STRUCT__entry(
    > + __array( char, thread_comm, TASK_COMM_LEN )
    > + __field( pid_t, thread_pid )
    > + ),
    > +
    > + TP_fast_assign(
    > + memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN);
    > + __entry->thread_pid = wq_thread->pid;
    > + ),
    > +
    > + TP_printk("thread=%s:%d", __entry->thread_comm, __entry->thread_pid)
    > +);
    > +
    > +#undef TRACE_SYSTEM
    > --
    > 1.5.5.3
    >
    >
    > --
    > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    > the body of a message to majordomo@vger.kernel.org
    > More majordomo info at http://vger.kernel.org/majordomo-info.html
    > Please read the FAQ at http://www.tux.org/lkml/





    \
     
     \ /
      Last update: 2009-04-13 03:47    [W:3.009 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site