path: root/include/trace/ftrace.h
diff options
authorSteven Rostedt <rostedt@goodmis.org>2013-06-20 11:44:44 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2013-06-20 22:24:32 -0700
commitf5abaa1bfc3dbf26d19d3513f39279ca369f8d65 (patch)
treeb3b5151c021486b65b0f01f5f4d1cfb94b82d1f9 /include/trace/ftrace.h
parent7d132055814ef17a6c7b69f342244c410a5e000f (diff)
tracing: Add DEFINE_EVENT_FN() macro
Each TRACE_EVENT() adds several helper functions. If two or more trace events share the same structure and print format, they can also share most of these helper functions and save a lot of space from duplicate code. This is why the DECLARE_EVENT_CLASS() and DEFINE_EVENT() were created. Some events require a trigger to be called at registering and unregistering of the event and to do so they use TRACE_EVENT_FN(). If multiple events require a trigger, they currently have no choice but to use TRACE_EVENT_FN() as there's no DEFINE_EVENT_FN() available. This unfortunately causes a lot of wasted duplicate code created. By adding a DEFINE_EVENT_FN(), these events can still use a DECLARE_EVENT_CLASS() and then define their own triggers. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/51C3236C.8030508@hds.com Signed-off-by: Seiji Aguchi <seiji.aguchi@hds.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'include/trace/ftrace.h')
1 files changed, 4 insertions, 0 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 19edd7facaa1..d615f78cc6b6 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -71,6 +71,10 @@
static struct ftrace_event_call __used \
__attribute__((__aligned__(4))) event_##name
+#define DEFINE_EVENT_FN(template, name, proto, args, reg, unreg) \
+ DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))

Privacy Policy