aboutsummaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-20 13:56:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-20 13:56:46 -0400
commitb0b7065b64fe517b4a50915a1555e8ee98890d64 (patch)
tree950e7735585a83f5b4efe7a9473b5b42d5ca4f57 /samples
parent38df92b8cee936334f686c06df0e5fbb92e252df (diff)
parentd4c4038343510d83727ea922de4435996c26c0c8 (diff)
Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (24 commits) tracing/urgent: warn in case of ftrace_start_up inbalance tracing/urgent: fix unbalanced ftrace_start_up function-graph: add stack frame test function-graph: disable when both x86_32 and optimize for size are configured ring-buffer: have benchmark test print to trace buffer ring-buffer: do not grab locks in nmi ring-buffer: add locks around rb_per_cpu_empty ring-buffer: check for less than two in size allocation ring-buffer: remove useless compile check for buffer_page size ring-buffer: remove useless warn on check ring-buffer: use BUF_PAGE_HDR_SIZE in calculating index tracing: update sample event documentation tracing/filters: fix race between filter setting and module unload tracing/filters: free filter_string in destroy_preds() ring-buffer: use commit counters for commit pointer accounting ring-buffer: remove unused variable ring-buffer: have benchmark test handle discarded events ring-buffer: prevent adding write in discarded area tracing/filters: strloc should be unsigned short tracing/filters: operand can be negative ... Fix up kmemcheck-induced conflict in kernel/trace/ring_buffer.c manually
Diffstat (limited to 'samples')
-rw-r--r--samples/trace_events/Makefile8
-rw-r--r--samples/trace_events/trace-events-sample.h27
2 files changed, 24 insertions, 11 deletions
diff --git a/samples/trace_events/Makefile b/samples/trace_events/Makefile
index 0d428dc6728..0f8d92120c4 100644
--- a/samples/trace_events/Makefile
+++ b/samples/trace_events/Makefile
@@ -1,6 +1,14 @@
1# builds the trace events example kernel modules; 1# builds the trace events example kernel modules;
2# then to use one (as root): insmod <module_name.ko> 2# then to use one (as root): insmod <module_name.ko>
3 3
4# If you include a trace header outside of include/trace/events
5# then the file that does the #define CREATE_TRACE_POINTS must
6# have that tracer file in its main search path. This is because
7# define_trace.h will include it, and must be able to find it from
8# the include/trace directory.
9#
10# Here trace-events-sample.c does the CREATE_TRACE_POINTS.
11#
4CFLAGS_trace-events-sample.o := -I$(src) 12CFLAGS_trace-events-sample.o := -I$(src)
5 13
6obj-$(CONFIG_SAMPLE_TRACE_EVENTS) += trace-events-sample.o 14obj-$(CONFIG_SAMPLE_TRACE_EVENTS) += trace-events-sample.o
diff --git a/samples/trace_events/trace-events-sample.h b/samples/trace_events/trace-events-sample.h
index 128a897687c..9977a756fb3 100644
--- a/samples/trace_events/trace-events-sample.h
+++ b/samples/trace_events/trace-events-sample.h
@@ -19,16 +19,21 @@
19 * If TRACE_SYSTEM is defined, that will be the directory created 19 * If TRACE_SYSTEM is defined, that will be the directory created
20 * in the ftrace directory under /debugfs/tracing/events/<system> 20 * in the ftrace directory under /debugfs/tracing/events/<system>
21 * 21 *
22 * The define_trace.h belowe will also look for a file name of 22 * The define_trace.h below will also look for a file name of
23 * TRACE_SYSTEM.h where TRACE_SYSTEM is what is defined here. 23 * TRACE_SYSTEM.h where TRACE_SYSTEM is what is defined here.
24 * In this case, it would look for sample.h
24 * 25 *
25 * If you want a different system than file name, you can override 26 * If the header name will be different than the system name
26 * the header name by defining TRACE_INCLUDE_FILE 27 * (as in this case), then you can override the header name that
28 * define_trace.h will look up by defining TRACE_INCLUDE_FILE
27 * 29 *
28 * If this file was called, goofy.h, then we would define: 30 * This file is called trace-events-sample.h but we want the system
31 * to be called "sample". Therefore we must define the name of this
32 * file:
29 * 33 *
30 * #define TRACE_INCLUDE_FILE goofy 34 * #define TRACE_INCLUDE_FILE trace-events-sample
31 * 35 *
36 * As we do an the bottom of this file.
32 */ 37 */
33#undef TRACE_SYSTEM 38#undef TRACE_SYSTEM
34#define TRACE_SYSTEM sample 39#define TRACE_SYSTEM sample
@@ -99,13 +104,13 @@ TRACE_EVENT(foo_bar,
99 * 104 *
100 * #define TRACE_INCLUDE_PATH ../../samples/trace_events 105 * #define TRACE_INCLUDE_PATH ../../samples/trace_events
101 * 106 *
102 * But I chose to simply make it use the current directory and then in 107 * But the safest and easiest way to simply make it use the directory
103 * the Makefile I added: 108 * that the file is in is to add in the Makefile:
104 * 109 *
105 * CFLAGS_trace-events-sample.o := -I$(PWD)/samples/trace_events/ 110 * CFLAGS_trace-events-sample.o := -I$(src)
106 * 111 *
107 * This will make sure the current path is part of the include 112 * This will make sure the current path is part of the include
108 * structure for our file so that we can find it. 113 * structure for our file so that define_trace.h can find it.
109 * 114 *
110 * I could have made only the top level directory the include: 115 * I could have made only the top level directory the include:
111 * 116 *
@@ -115,8 +120,8 @@ TRACE_EVENT(foo_bar,
115 * 120 *
116 * #define TRACE_INCLUDE_PATH samples/trace_events 121 * #define TRACE_INCLUDE_PATH samples/trace_events
117 * 122 *
118 * But then if something defines "samples" or "trace_events" then we 123 * But then if something defines "samples" or "trace_events" as a macro
119 * could risk that being converted too, and give us an unexpected 124 * then we could risk that being converted too, and give us an unexpected
120 * result. 125 * result.
121 */ 126 */
122#undef TRACE_INCLUDE_PATH 127#undef TRACE_INCLUDE_PATH