lkml.org 
[lkml]   [2009]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] tracing, workqueuetrace: Make workqueue tracepoints use TRACE_EVENT macro
On Mon, Apr 13, 2009 at 10:44:27AM +0900, KOSAKI Motohiro wrote:
> 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



Ah, you already commented out it, sorry, I haven't seen you answer :)
(Reminder for me: always check the patches with threaded view).



>
>
> > +
> > +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.



Nice idea!

Frederic.


>
> > +
> > +/* 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 16:37    [W:0.161 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site