aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/ftrace.h
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@cn.fujitsu.com>2009-12-15 02:39:42 -0500
committerSteven Rostedt <rostedt@goodmis.org>2010-01-06 11:41:54 -0500
commit509e760cd91c831983097ae174cb6c0b8c6c8e6b (patch)
tree985da24e69e80b81713c2901c94b127c961cd426 /include/trace/ftrace.h
parent809826a389040e0ad9d646b587bccc0e34691afd (diff)
tracing: Add print_fmt field
This is part of a patch set that removes the show_format method in the ftrace event macros. The print_fmt field is added to hold the string that shows the print_fmt in the event format files. This patch only adds the field but it is currently not used. Later patches will use this field to enable us to remove the show_format field and function. Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> LKML-Reference: <4B273D3E.2000704@cn.fujitsu.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/trace/ftrace.h')
-rw-r--r--include/trace/ftrace.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index c6fe03e902c..3351d85c83a 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -722,8 +722,20 @@ static struct trace_event ftrace_event_type_##call = { \
722 722
723#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 723#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
724 724
725#undef __entry
726#define __entry REC
727
728#undef __print_flags
729#undef __print_symbolic
730#undef __get_dynamic_array
731#undef __get_str
732
733#undef TP_printk
734#define TP_printk(fmt, args...) "\"" fmt "\", " __stringify(args)
735
725#undef DECLARE_EVENT_CLASS 736#undef DECLARE_EVENT_CLASS
726#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) 737#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
738static const char print_fmt_##call[] = print;
727 739
728#undef DEFINE_EVENT 740#undef DEFINE_EVENT
729#define DEFINE_EVENT(template, call, proto, args) \ 741#define DEFINE_EVENT(template, call, proto, args) \
@@ -737,6 +749,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
737 .raw_init = trace_event_raw_init, \ 749 .raw_init = trace_event_raw_init, \
738 .regfunc = ftrace_raw_reg_event_##call, \ 750 .regfunc = ftrace_raw_reg_event_##call, \
739 .unregfunc = ftrace_raw_unreg_event_##call, \ 751 .unregfunc = ftrace_raw_unreg_event_##call, \
752 .print_fmt = print_fmt_##template, \
740 .show_format = ftrace_format_##template, \ 753 .show_format = ftrace_format_##template, \
741 .define_fields = ftrace_define_fields_##template, \ 754 .define_fields = ftrace_define_fields_##template, \
742 _TRACE_PROFILE_INIT(call) \ 755 _TRACE_PROFILE_INIT(call) \
@@ -745,6 +758,8 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
745#undef DEFINE_EVENT_PRINT 758#undef DEFINE_EVENT_PRINT
746#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ 759#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \
747 \ 760 \
761static const char print_fmt_##call[] = print; \
762 \
748static struct ftrace_event_call __used \ 763static struct ftrace_event_call __used \
749__attribute__((__aligned__(4))) \ 764__attribute__((__aligned__(4))) \
750__attribute__((section("_ftrace_events"))) event_##call = { \ 765__attribute__((section("_ftrace_events"))) event_##call = { \
@@ -754,6 +769,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
754 .raw_init = trace_event_raw_init, \ 769 .raw_init = trace_event_raw_init, \
755 .regfunc = ftrace_raw_reg_event_##call, \ 770 .regfunc = ftrace_raw_reg_event_##call, \
756 .unregfunc = ftrace_raw_unreg_event_##call, \ 771 .unregfunc = ftrace_raw_unreg_event_##call, \
772 .print_fmt = print_fmt_##call, \
757 .show_format = ftrace_format_##call, \ 773 .show_format = ftrace_format_##call, \
758 .define_fields = ftrace_define_fields_##template, \ 774 .define_fields = ftrace_define_fields_##template, \
759 _TRACE_PROFILE_INIT(call) \ 775 _TRACE_PROFILE_INIT(call) \
@@ -837,6 +853,16 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
837 853
838#ifdef CONFIG_EVENT_PROFILE 854#ifdef CONFIG_EVENT_PROFILE
839 855
856#undef __entry
857#define __entry entry
858
859#undef __get_dynamic_array
860#define __get_dynamic_array(field) \
861 ((void *)__entry + (__entry->__data_loc_##field & 0xffff))
862
863#undef __get_str
864#define __get_str(field) (char *)__get_dynamic_array(field)
865
840#undef __perf_addr 866#undef __perf_addr
841#define __perf_addr(a) __addr = (a) 867#define __perf_addr(a) __addr = (a)
842 868