Skip to content

Commit

Permalink
tracing: Update trace-event-sample with TRACE_SYSTEM_VAR documentation
Browse files Browse the repository at this point in the history
Add documentation about TRACE_SYSTEM needing to be alpha-numeric or with
underscores, and that if it is not, then the use of TRACE_SYSTEM_VAR is
required to make something that is.

An example of this is shown in samples/trace_events/trace-events-sample.h

Link: http://lkml.kernel.org/r/[email protected]

Reviewed-by: Masami Hiramatsu <[email protected]>
Tested-by: Masami Hiramatsu <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
  • Loading branch information
rostedt committed Apr 8, 2015
1 parent acd388f commit 8892042
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion samples/trace_events/trace-events-sample.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,25 @@
* protection, just like TRACE_INCLUDE_FILE.
*/
#undef TRACE_SYSTEM
#define TRACE_SYSTEM sample
#define TRACE_SYSTEM sample-trace

/*
* TRACE_SYSTEM is expected to be a C valid variable (alpha-numeric
* and underscore), although it may start with numbers. If for some
* reason it is not, you need to add the following lines:
*/
#undef TRACE_SYSTEM_VAR
#define TRACE_SYSTEM_VAR sample_trace
/*
* But the above is only needed if TRACE_SYSTEM is not alpha-numeric
* and underscored. By default, TRACE_SYSTEM_VAR will be equal to
* TRACE_SYSTEM. As TRACE_SYSTEM_VAR must be alpha-numeric, if
* TRACE_SYSTEM is not, then TRACE_SYSTEM_VAR must be defined with
* only alpha-numeric and underscores.
*
* The TRACE_SYSTEM_VAR is only used internally and not visible to
* user space.
*/

/*
* Notice that this file is not protected like a normal header.
Expand Down

0 comments on commit 8892042

Please sign in to comment.