aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2015-03-31 14:37:12 -0400
committerSteven Rostedt <rostedt@goodmis.org>2015-04-08 09:39:55 -0400
commitacd388fd3af350ab24c6ab6f19b83fc4a4f3aa60 (patch)
tree98b1345299c3ea060b8297b35465d4dc92e4ea1d /include/trace
parent6e9dd8ddbdbb3b7aeba7fd9b987579534cfc260b (diff)
tracing: Give system name a pointer
Normally the compiler will use the same pointer for a string throughout the file. But there's no guarantee of that happening. Later changes will require that all events have the same pointer to the system string. Name the system string and have all events point to it. Testing this, it did not increases the size of the text, except for the notes section, which should not harm the real size any. Link: http://lkml.kernel.org/r/20150403013802.220157513@goodmis.org Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Tested-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/ftrace.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 41bf65f04dd9..2f9b95b6d3fb 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -18,6 +18,21 @@
18 18
19#include <linux/ftrace_event.h> 19#include <linux/ftrace_event.h>
20 20
21#ifndef TRACE_SYSTEM_VAR
22#define TRACE_SYSTEM_VAR TRACE_SYSTEM
23#endif
24
25#define __app__(x, y) str__##x##y
26#define __app(x, y) __app__(x, y)
27
28#define TRACE_SYSTEM_STRING __app(TRACE_SYSTEM_VAR,__trace_system_name)
29
30#define TRACE_MAKE_SYSTEM_STR() \
31 static const char TRACE_SYSTEM_STRING[] = \
32 __stringify(TRACE_SYSTEM)
33
34TRACE_MAKE_SYSTEM_STR();
35
21/* 36/*
22 * DECLARE_EVENT_CLASS can be used to add a generic function 37 * DECLARE_EVENT_CLASS can be used to add a generic function
23 * handlers for events. That is, if all events have the same 38 * handlers for events. That is, if all events have the same
@@ -105,7 +120,6 @@
105 120
106#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 121#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
107 122
108
109/* 123/*
110 * Stage 2 of the trace events. 124 * Stage 2 of the trace events.
111 * 125 *
@@ -692,7 +706,7 @@ static inline void ftrace_test_probe_##call(void) \
692_TRACE_PERF_PROTO(call, PARAMS(proto)); \ 706_TRACE_PERF_PROTO(call, PARAMS(proto)); \
693static const char print_fmt_##call[] = print; \ 707static const char print_fmt_##call[] = print; \
694static struct ftrace_event_class __used __refdata event_class_##call = { \ 708static struct ftrace_event_class __used __refdata event_class_##call = { \
695 .system = __stringify(TRACE_SYSTEM), \ 709 .system = TRACE_SYSTEM_STRING, \
696 .define_fields = ftrace_define_fields_##call, \ 710 .define_fields = ftrace_define_fields_##call, \
697 .fields = LIST_HEAD_INIT(event_class_##call.fields),\ 711 .fields = LIST_HEAD_INIT(event_class_##call.fields),\
698 .raw_init = trace_event_raw_init, \ 712 .raw_init = trace_event_raw_init, \
@@ -735,6 +749,7 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
735 749
736#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 750#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
737 751
752#undef TRACE_SYSTEM_VAR
738 753
739#ifdef CONFIG_PERF_EVENTS 754#ifdef CONFIG_PERF_EVENTS
740 755