tracing/ftrace: implement a set_flag callback for tracers
authorFrederic Weisbecker <fweisbec@gmail.com>
Mon, 17 Nov 2008 18:23:42 +0000 (19:23 +0100)
committerIngo Molnar <mingo@elte.hu>
Tue, 18 Nov 2008 10:10:58 +0000 (11:10 +0100)
commitadf9f19574334c9a29a2bc956009fcac7edf1a6b
tree644415fb8e460290a6747c5933a1c62be9a9d50f
parent5a209c2d58e70f9bc415b9cdf0e3b9aaefb70371
tracing/ftrace: implement a set_flag callback for tracers

Impact: give a way to send specific messages to tracers

The current implementation of tracing uses some flags to control the
output of general tracers. But we have no way to implement custom
flags handling for a specific tracer. This patch proposes a new
callback for the struct tracer which called set_flag and a structure
that represents a 32 bits variable flag.

A tracer can implement a struct tracer_flags on which it puts the
initial value of the flag integer. Than it can place a range of flags
with their name and their flag mask on the flag integer. The structure
that implement a single flag is called struct tracer_opt.

These custom flags will be available through the trace_options file
like the general tracing flags. Changing their value is done like the
other general flags. For example if you have a flag that calls "foo",
you can activate it by writing "foo" or "nofoo" on trace_options.

Note that the set_flag callback is optional and is only needed if you
want the flags changing to be signaled to your tracer and let it to
accept or refuse their assignment.

V2: Some arrangements in coding style....

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/trace/trace.c
kernel/trace/trace.h