diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-09-01 18:08:15 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-09-01 18:08:15 -0400 |
commit | bd2a8da00b01bd9061890bb8bd196309cd28441a (patch) | |
tree | a5552698d0ee75933ed25961f1f04077f8fe58ab | |
parent | ee95ac26879e79b88ecf56d4b35c3bb0e23a74d9 (diff) | |
download | rt-tests-bd2a8da00b01bd9061890bb8bd196309cd28441a.tar.gz rt-tests-bd2a8da00b01bd9061890bb8bd196309cd28441a.tar.xz |
allow events for all tracers
Events are available for all tracers, including function and latency
tracers. Do not treat them as a tracer. The -E option is agnostic to
the tracer options, and if it is set, then events will be enabled for
any tracer that is also set. If it is set by itself, then events will
be enabled with the nop tracer.
Also, the nop tracer is set before setting any of the tracers. This
makes the nop tracer the default as well as clears out the trace before
running the test.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | src/cyclictest/cyclictest.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index 0f3e981..17d45a3 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -105,9 +105,10 @@ extern int clock_nanosleep(clockid_t __clock_id, int __flags, #define KVARNAMELEN 32 #define KVALUELEN 32 +int enable_events; + enum { NOTRACE, - EVENTS, CTXTSWITCH, IRQSOFF, PREEMPTOFF, @@ -417,10 +418,15 @@ static void setup_tracer(void) setkernvar("ftrace_enabled", "0"); fileprefix = get_debugfileprefix(); + /* + * Set default tracer to nop. + * this also has the nice side effect of clearing out + * old traces. + */ + ret = settracer("nop"); + switch (tracetype) { case NOTRACE: - setkernvar("events/enable", "1"); - ret = settracer("nop"); break; case IRQSOFF: ret = settracer("irqsoff"); @@ -431,18 +437,10 @@ static void setup_tracer(void) case IRQPREEMPTOFF: ret = settracer("preemptirqsoff"); break; - case EVENTS: - /* per rostedt: use nop tracer with event tracing */ - ret = settracer("nop"); - /* turn on all events */ - event_enable_all(); - break; case CTXTSWITCH: if (valid_tracer("sched_switch")) ret = settracer("sched_switch"); else { - if ((ret = settracer("nop"))) - break; if ((ret = event_enable("sched/sched_wakeup"))) break; ret = event_enable("sched/sched_switch"); @@ -467,6 +465,10 @@ static void setup_tracer(void) break; } + if (enable_events) + /* turn on all events */ + event_enable_all(); + if (ret) fprintf(stderr, "Requested tracer '%s' not available\n", tracer); @@ -990,7 +992,7 @@ static void process_options (int argc, char *argv[]) case 'c': clocksel = atoi(optarg); break; case 'C': tracetype = CTXTSWITCH; break; case 'd': distance = atoi(optarg); break; - case 'E': tracetype = EVENTS; break; + case 'E': enable_events = 1; break; case 'f': ftrace = 1; break; case 'H': histofall = 1; /* fall through */ case 'h': histogram = atoi(optarg); break; |