diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-02-27 21:33:02 -0500 |
---|---|---|
committer | Steven Rostedt <srostedt@redhat.com> | 2009-02-28 02:59:43 -0500 |
commit | 6ecc2d1ca39177edb6fbdb7412948b0e9f409d02 (patch) | |
tree | 336a12a2f3db016f967717e1cb06e9171a239ce5 /kernel/trace/events.c | |
parent | eb594e45f6979cd10b18d87f7b3f02119e00a108 (diff) |
tracing: add subsystem level to trace events
If a trace point header defines TRACE_SYSTEM, then it will add the
following trace points into that event system.
If include/trace/irq_event_types.h has:
#define TRACE_SYSTEM irq
at the top and
#undef TRACE_SYSTEM
at the bottom, then a directory "irq" will be created in the
/debug/tracing/events directory. Inside that directory will contain the
two trace points that are defined in include/trace/irq_event_types.h.
Only adding the above to irq and not to sched, we get:
# ls /debug/tracing/events/
irq sched_process_exit sched_signal_send sched_wakeup_new
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
# ls /debug/tracing/events/irq
irq_handler_entry irq_handler_exit
If we add #define TRACE_SYSTEM sched to the trace/sched_event_types.h
then the rest of the trace events will be put in a sched directory
within the events directory.
I've been playing with this idea of the subsystem for a while, but
recently Tom Zanussi posted some patches to lkml that included this
method. Tom's approach was clean and got me to finally put some effort
to clean up the event trace points.
Thanks to Tom Zanussi for demonstrating how nice the subsystem
method is.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'kernel/trace/events.c')
-rw-r--r-- | kernel/trace/events.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/trace/events.c b/kernel/trace/events.c index 46e27ad2487e..4e4e45860c58 100644 --- a/kernel/trace/events.c +++ b/kernel/trace/events.c | |||
@@ -2,6 +2,10 @@ | |||
2 | * This is the place to register all trace points as events. | 2 | * This is the place to register all trace points as events. |
3 | */ | 3 | */ |
4 | 4 | ||
5 | /* someday this needs to go in a generic header */ | ||
6 | #define __STR(x) #x | ||
7 | #define STR(x) __STR(x) | ||
8 | |||
5 | #include <trace/trace_events.h> | 9 | #include <trace/trace_events.h> |
6 | 10 | ||
7 | #include "trace_events.h" | 11 | #include "trace_events.h" |