aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_events.c
diff options
context:
space:
mode:
authorTom Zanussi <tzanussi@gmail.com>2009-03-31 01:48:49 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-13 18:00:50 -0400
commite1112b4d96859367a93468027c9635e2ac04eb3f (patch)
tree5170980ea71ee4bb5d0196880b58dbc997211b65 /kernel/trace/trace_events.c
parent66de7792c02693b49671afe58c771fde3b092fc7 (diff)
tracing/filters: add run-time field descriptions to TRACE_EVENT_FORMAT events
This patch adds run-time field descriptions to all the event formats exported using TRACE_EVENT_FORMAT. It also hooks up all the tracers that use them (i.e. the tracers in the 'ftrace subsystem') so they can also have their output filtered by the event-filtering mechanism. When I was testing this, there were a couple of things that fooled me into thinking the filters weren't working, when actually they were - I'll mention them here so others don't make the same mistakes (and file bug reports. ;-) One is that some of the tracers trace multiple events e.g. the sched_switch tracer uses the context_switch and wakeup events, and if you don't set filters on all of the traced events, the unfiltered output from the events without filters on them can make it look like the filtering as a whole isn't working properly, when actually it is doing what it was asked to do - it just wasn't asked to do the right thing. The other is that for the really high-volume tracers e.g. the function tracer, the volume of filtered events can be so high that it pushes the unfiltered events out of the ring buffer before they can be read so e.g. cat'ing the trace file repeatedly shows either no output, or once in awhile some output but that isn't there the next time you read the trace, which isn't what you normally expect when reading the trace file. If you read from the trace_pipe file though, you can catch them before they disappear. Changes from v1: As suggested by Frederic Weisbecker: - get rid of externs in functions - added unlikely() to filter_check_discard() Signed-off-by: Tom Zanussi <tzanussi@gmail.com> Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace_events.c')
-rw-r--r--kernel/trace/trace_events.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 64ec4d278ffb..be9299a53e2a 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -680,6 +680,7 @@ static struct dentry *
680event_subsystem_dir(const char *name, struct dentry *d_events) 680event_subsystem_dir(const char *name, struct dentry *d_events)
681{ 681{
682 struct event_subsystem *system; 682 struct event_subsystem *system;
683 struct dentry *entry;
683 684
684 /* First see if we did not already create this dir */ 685 /* First see if we did not already create this dir */
685 list_for_each_entry(system, &event_subsystems, list) { 686 list_for_each_entry(system, &event_subsystems, list) {
@@ -708,6 +709,12 @@ event_subsystem_dir(const char *name, struct dentry *d_events)
708 709
709 system->preds = NULL; 710 system->preds = NULL;
710 711
712 entry = debugfs_create_file("filter", 0644, system->entry, system,
713 &ftrace_subsystem_filter_fops);
714 if (!entry)
715 pr_warning("Could not create debugfs "
716 "'%s/filter' entry\n", name);
717
711 return system->entry; 718 return system->entry;
712} 719}
713 720