summaryrefslogtreecommitdiffstats
path: root/include/trace/define_trace.h
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-11-18 20:36:26 -0500
committerSteven Rostedt <rostedt@goodmis.org>2009-11-24 18:23:53 -0500
commite5bc9721684e9412f3e0465222f317c362a8ab47 (patch)
tree380e76f64fd58e1f68715514e4b37734f3098fb3 /include/trace/define_trace.h
parentff038f5c37c2070829004a0678372766c2b32180 (diff)
downloadblackbird-op-linux-e5bc9721684e9412f3e0465222f317c362a8ab47.tar.gz
blackbird-op-linux-e5bc9721684e9412f3e0465222f317c362a8ab47.zip
tracing: Create new DEFINE_EVENT_PRINT
After creating the TRACE_EVENT_TEMPLATE I started to look at other trace points to see what duplication was made. I noticed that there are several trace points where they are almost identical except for the name and the output format. Since TRACE_EVENT_TEMPLATE was successful in bringing down the size of trace events, I added a DEFINE_EVENT_PRINT. DEFINE_EVENT_PRINT is used just like DEFINE_EVENT is. That is, the DEFINE_EVENT_PRINT also uses a TRACE_EVENT_TEMPLATE, but it allows the developer to overwrite the print format. If there are two or more TRACE_EVENTS that are identical except for the name and print, then they can be converted to use a TRACE_EVENT_TEMPLATE. Since the TRACE_EVENT_TEMPLATE already does the print output, the first trace event would have its print format held in the TRACE_EVENT_TEMPLATE and be defined with a DEFINE_EVENT. The rest will use the DEFINE_EVENT_PRINT and override the print format. Converting the sched trace points to both DEFINE_EVENT and DEFINE_EVENT_PRINT. Five were converted to DEFINE_EVENT and two were converted to DEFINE_EVENT_PRINT. I was able to get the following: $ size kernel/sched.o-* text data bss dec hex filename 79299 6776 2520 88595 15a13 kernel/sched.o-notrace 101941 11896 2584 116421 1c6c5 kernel/sched.o-templ 104779 11896 2584 119259 1d1db kernel/sched.o-trace sched.o-notrace is the scheduler compiled with no trace points. sched.o-templ is with the use of DEFINE_EVENT and DEFINE_EVENT_PRINT sched.o-trace is the current trace events. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/trace/define_trace.h')
-rw-r--r--include/trace/define_trace.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
index 244985814a43..5d7d855ae21e 100644
--- a/include/trace/define_trace.h
+++ b/include/trace/define_trace.h
@@ -35,6 +35,10 @@
#define DEFINE_EVENT(template, name, proto, args) \
DEFINE_TRACE(name)
+#undef DEFINE_EVENT_PRINT
+#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
+ DEFINE_TRACE(name)
+
#undef DECLARE_TRACE
#define DECLARE_TRACE(name, proto, args) \
DEFINE_TRACE(name)
@@ -69,6 +73,7 @@
#undef TRACE_EVENT_FN
#undef TRACE_EVENT_TEMPLATE
#undef DEFINE_EVENT
+#undef DEFINE_EVENT_PRINT
#undef TRACE_HEADER_MULTI_READ
/* Only undef what we defined in this file */
OpenPOWER on IntegriCloud