Re: [PATCH 4/7] tracing: new format for specialized trace points

From: KOSAKI Motohiro
Date: Tue Mar 10 2009 - 01:50:47 EST


Hi Steven,

> TRACE_EVENT(sched_switch,
>
> TP_PROTO(struct rq *rq, struct task_struct *prev,
> struct task_struct *next),
>
> TP_ARGS(rq, prev, next),
>
> TP_STRUCT__entry(
> __array( char, prev_comm, TASK_COMM_LEN )
> __field( pid_t, prev_pid )
> __field( int, prev_prio )
> __array( char, next_comm, TASK_COMM_LEN )
> __field( pid_t, next_pid )
> __field( int, next_prio )
> ),
>
> TP_printk("task %s:%d [%d] ==> %s:%d [%d]",
> __entry->prev_comm, __entry->prev_pid, __entry->prev_prio,
> __entry->next_comm, __entry->next_pid, __entry->next_prio),
>
> TP_fast_assign(
> memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN);
> __entry->prev_pid = prev->pid;
> __entry->prev_prio = prev->prio;
> memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN);
> __entry->next_pid = next->pid;
> __entry->next_prio = next->prio;
> )
> );

Could you please write the documentation how to make new tracepont and
use various TP_ macro?
Some developer (include me) plan to add new tracepoint. but these macro
usage is a bit difficult.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/