Re: [PATCH 4/4] tracing: make event directory structure

From: Steven Rostedt
Date: Wed Feb 25 2009 - 08:07:41 EST




On Wed, 25 Feb 2009, Frederic Weisbecker wrote:

> On Tue, Feb 24, 2009 at 09:56:12PM -0500, Steven Rostedt wrote:
> > From: Steven Rostedt <srostedt@xxxxxxxxxx>
> >
> > This patch adds the directory /debug/tracing/events/ that will contain
> > all the registered trace points.
> >
> > # ls /debug/tracing/events/
> > sched_kthread_stop sched_process_fork sched_switch
> > sched_kthread_stop_ret sched_process_free sched_wait_task
> > sched_migrate_task sched_process_wait sched_wakeup
> > sched_process_exit sched_signal_send sched_wakeup_new
> >
> > # ls /debug/tracing/events/sched_switch/
> > enable
> >
> > # cat /debug/tracing/events/sched_switch/enable
> > 1
> >
> > # cat /debug/tracing/set_event
> > sched_switch
>
>
> Do you plan to add other things inside these events directory?

That's actually the plan. We might want to trigger a stack trace or
something on that event. The idea will be to add attributes to each
individual event, and it should be pretty easy to implement since each
event has its own structure.

> I mean, if you plan to only put an enable file on each of
them, > it would be better to have just one file:
>
> cat /debug/tracing/events/sched_switch
> 1
>
>
> > Signed-off-by: Steven Rostedt <srostedt@xxxxxxxxxx>
> > ---
> > kernel/trace/trace_events.c | 137 +++++++++++++++++++++++++++++++++++++++++--
> > kernel/trace/trace_events.h | 7 ++-
> > 2 files changed, 137 insertions(+), 7 deletions(-)
> >
> > diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> > index 05bc80e..3bcb9df 100644
> > --- a/kernel/trace/trace_events.c
> > +++ b/kernel/trace/trace_events.c
> > @@ -12,6 +12,11 @@
> >
> > #include "trace_events.h"
> >
> > +#define events_for_each(event) \
> > + for (event = __start_ftrace_events; \
> > + (unsigned long)event < (unsigned long)__stop_ftrace_events; \
> > + event++)
> > +
>
>
> The name for_each_events seems to me more intuitive, but it's just
> a matter of taste.

I like that better too. But I was trying to be more consistent with the
kernel. "list_for_each", "hlist_for_each".

But come to think about it, we do have "for_each_cpu_mask". Hmm?

But it is local to the file. Not something to worry about now ;-)

-- Steve

--
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/