aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/ftrace.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-11-26 03:04:55 -0500
committerIngo Molnar <mingo@elte.hu>2009-11-26 03:04:55 -0500
commit091ad3658e3c76c5fb05f65bfb64a0246f8f31b5 (patch)
tree90f67be68a31e2001a4a73e0325a2a7798240a51 /include/trace/ftrace.h
parent28b4e0d86acf59ae3bc422921138a4958458326e (diff)
events: Rename TRACE_EVENT_TEMPLATE() to DECLARE_EVENT_CLASS()
It is not quite obvious at first sight what TRACE_EVENT_TEMPLATE does: does it define an event as well beyond defining a template? To clarify this, rename it to DECLARE_EVENT_CLASS, which follows the various 'DECLARE_*()' idioms we already have in the kernel: DECLARE_EVENT_CLASS(class) DEFINE_EVENT(class, event1) DEFINE_EVENT(class, event2) DEFINE_EVENT(class, event3) To complete this logic we should also rename TRACE_EVENT() to: DEFINE_SINGLE_EVENT(single_event) ... but in a more quiet moment of the kernel cycle. Cc: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <4B0E286A.2000405@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/trace/ftrace.h')
-rw-r--r--include/trace/ftrace.h46
1 files changed, 23 insertions, 23 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index b0461772bc8d..2c9c073e45ad 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -19,17 +19,17 @@
19#include <linux/ftrace_event.h> 19#include <linux/ftrace_event.h>
20 20
21/* 21/*
22 * TRACE_EVENT_TEMPLATE can be used to add a generic function 22 * DECLARE_EVENT_CLASS can be used to add a generic function
23 * handlers for events. That is, if all events have the same 23 * handlers for events. That is, if all events have the same
24 * parameters and just have distinct trace points. 24 * parameters and just have distinct trace points.
25 * Each tracepoint can be defined with DEFINE_EVENT and that 25 * Each tracepoint can be defined with DEFINE_EVENT and that
26 * will map the TRACE_EVENT_TEMPLATE to the tracepoint. 26 * will map the DECLARE_EVENT_CLASS to the tracepoint.
27 * 27 *
28 * TRACE_EVENT is a one to one mapping between tracepoint and template. 28 * TRACE_EVENT is a one to one mapping between tracepoint and template.
29 */ 29 */
30#undef TRACE_EVENT 30#undef TRACE_EVENT
31#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ 31#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
32 TRACE_EVENT_TEMPLATE(name, \ 32 DECLARE_EVENT_CLASS(name, \
33 PARAMS(proto), \ 33 PARAMS(proto), \
34 PARAMS(args), \ 34 PARAMS(args), \
35 PARAMS(tstruct), \ 35 PARAMS(tstruct), \
@@ -56,8 +56,8 @@
56#undef TP_STRUCT__entry 56#undef TP_STRUCT__entry
57#define TP_STRUCT__entry(args...) args 57#define TP_STRUCT__entry(args...) args
58 58
59#undef TRACE_EVENT_TEMPLATE 59#undef DECLARE_EVENT_CLASS
60#define TRACE_EVENT_TEMPLATE(name, proto, args, tstruct, assign, print) \ 60#define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print) \
61 struct ftrace_raw_##name { \ 61 struct ftrace_raw_##name { \
62 struct trace_entry ent; \ 62 struct trace_entry ent; \
63 tstruct \ 63 tstruct \
@@ -115,8 +115,8 @@
115#undef __string 115#undef __string
116#define __string(item, src) __dynamic_array(char, item, -1) 116#define __string(item, src) __dynamic_array(char, item, -1)
117 117
118#undef TRACE_EVENT_TEMPLATE 118#undef DECLARE_EVENT_CLASS
119#define TRACE_EVENT_TEMPLATE(call, proto, args, tstruct, assign, print) \ 119#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
120 struct ftrace_data_offsets_##call { \ 120 struct ftrace_data_offsets_##call { \
121 tstruct; \ 121 tstruct; \
122 }; 122 };
@@ -203,8 +203,8 @@
203#undef TP_perf_assign 203#undef TP_perf_assign
204#define TP_perf_assign(args...) 204#define TP_perf_assign(args...)
205 205
206#undef TRACE_EVENT_TEMPLATE 206#undef DECLARE_EVENT_CLASS
207#define TRACE_EVENT_TEMPLATE(call, proto, args, tstruct, func, print) \ 207#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \
208static int \ 208static int \
209ftrace_format_setup_##call(struct ftrace_event_call *unused, \ 209ftrace_format_setup_##call(struct ftrace_event_call *unused, \
210 struct trace_seq *s) \ 210 struct trace_seq *s) \
@@ -321,8 +321,8 @@ ftrace_format_##name(struct ftrace_event_call *unused, \
321 ftrace_print_symbols_seq(p, value, symbols); \ 321 ftrace_print_symbols_seq(p, value, symbols); \
322 }) 322 })
323 323
324#undef TRACE_EVENT_TEMPLATE 324#undef DECLARE_EVENT_CLASS
325#define TRACE_EVENT_TEMPLATE(call, proto, args, tstruct, assign, print) \ 325#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
326static enum print_line_t \ 326static enum print_line_t \
327ftrace_raw_output_id_##call(int event_id, const char *name, \ 327ftrace_raw_output_id_##call(int event_id, const char *name, \
328 struct trace_iterator *iter, int flags) \ 328 struct trace_iterator *iter, int flags) \
@@ -428,8 +428,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
428#undef __string 428#undef __string
429#define __string(item, src) __dynamic_array(char, item, -1) 429#define __string(item, src) __dynamic_array(char, item, -1)
430 430
431#undef TRACE_EVENT_TEMPLATE 431#undef DECLARE_EVENT_CLASS
432#define TRACE_EVENT_TEMPLATE(call, proto, args, tstruct, func, print) \ 432#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \
433static int \ 433static int \
434ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ 434ftrace_define_fields_##call(struct ftrace_event_call *event_call) \
435{ \ 435{ \
@@ -480,8 +480,8 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \
480#undef __string 480#undef __string
481#define __string(item, src) __dynamic_array(char, item, strlen(src) + 1) 481#define __string(item, src) __dynamic_array(char, item, strlen(src) + 1)
482 482
483#undef TRACE_EVENT_TEMPLATE 483#undef DECLARE_EVENT_CLASS
484#define TRACE_EVENT_TEMPLATE(call, proto, args, tstruct, assign, print) \ 484#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
485static inline int ftrace_get_offsets_##call( \ 485static inline int ftrace_get_offsets_##call( \
486 struct ftrace_data_offsets_##call *__data_offsets, proto) \ 486 struct ftrace_data_offsets_##call *__data_offsets, proto) \
487{ \ 487{ \
@@ -521,8 +521,8 @@ static inline int ftrace_get_offsets_##call( \
521 * 521 *
522 */ 522 */
523 523
524#undef TRACE_EVENT_TEMPLATE 524#undef DECLARE_EVENT_CLASS
525#define TRACE_EVENT_TEMPLATE(call, proto, args, tstruct, assign, print) 525#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print)
526 526
527#undef DEFINE_EVENT 527#undef DEFINE_EVENT
528#define DEFINE_EVENT(template, name, proto, args) \ 528#define DEFINE_EVENT(template, name, proto, args) \
@@ -681,8 +681,8 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\
681#define __assign_str(dst, src) \ 681#define __assign_str(dst, src) \
682 strcpy(__get_str(dst), src); 682 strcpy(__get_str(dst), src);
683 683
684#undef TRACE_EVENT_TEMPLATE 684#undef DECLARE_EVENT_CLASS
685#define TRACE_EVENT_TEMPLATE(call, proto, args, tstruct, assign, print) \ 685#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
686 \ 686 \
687static void ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \ 687static void ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \
688 proto) \ 688 proto) \
@@ -764,8 +764,8 @@ static int ftrace_raw_init_event_##call(struct ftrace_event_call *unused)\
764 764
765#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 765#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
766 766
767#undef TRACE_EVENT_TEMPLATE 767#undef DECLARE_EVENT_CLASS
768#define TRACE_EVENT_TEMPLATE(call, proto, args, tstruct, assign, print) 768#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print)
769 769
770#undef DEFINE_EVENT 770#undef DEFINE_EVENT
771#define DEFINE_EVENT(template, call, proto, args) \ 771#define DEFINE_EVENT(template, call, proto, args) \
@@ -885,8 +885,8 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
885#undef __perf_count 885#undef __perf_count
886#define __perf_count(c) __count = (c) 886#define __perf_count(c) __count = (c)
887 887
888#undef TRACE_EVENT_TEMPLATE 888#undef DECLARE_EVENT_CLASS
889#define TRACE_EVENT_TEMPLATE(call, proto, args, tstruct, assign, print) \ 889#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
890static void \ 890static void \
891ftrace_profile_templ_##call(struct ftrace_event_call *event_call, \ 891ftrace_profile_templ_##call(struct ftrace_event_call *event_call, \
892 proto) \ 892 proto) \