aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/ftrace.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/trace/ftrace.h')
-rw-r--r--include/trace/ftrace.h41
1 files changed, 36 insertions, 5 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 41bf65f04dd9..37d4b10b111d 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -18,6 +18,34 @@
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
36#undef TRACE_DEFINE_ENUM
37#define TRACE_DEFINE_ENUM(a) \
38 static struct trace_enum_map __used __initdata \
39 __##TRACE_SYSTEM##_##a = \
40 { \
41 .system = TRACE_SYSTEM_STRING, \
42 .enum_string = #a, \
43 .enum_value = a \
44 }; \
45 static struct trace_enum_map __used \
46 __attribute__((section("_ftrace_enum_map"))) \
47 *TRACE_SYSTEM##_##a = &__##TRACE_SYSTEM##_##a
48
21/* 49/*
22 * DECLARE_EVENT_CLASS can be used to add a generic function 50 * DECLARE_EVENT_CLASS can be used to add a generic function
23 * handlers for events. That is, if all events have the same 51 * handlers for events. That is, if all events have the same
@@ -105,7 +133,6 @@
105 133
106#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 134#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
107 135
108
109/* 136/*
110 * Stage 2 of the trace events. 137 * Stage 2 of the trace events.
111 * 138 *
@@ -122,6 +149,9 @@
122 * The size of an array is also encoded, in the higher 16 bits of <item>. 149 * The size of an array is also encoded, in the higher 16 bits of <item>.
123 */ 150 */
124 151
152#undef TRACE_DEFINE_ENUM
153#define TRACE_DEFINE_ENUM(a)
154
125#undef __field 155#undef __field
126#define __field(type, item) 156#define __field(type, item)
127 157
@@ -539,7 +569,7 @@ static inline notrace int ftrace_get_offsets_##call( \
539 * .trace = ftrace_raw_output_<call>, <-- stage 2 569 * .trace = ftrace_raw_output_<call>, <-- stage 2
540 * }; 570 * };
541 * 571 *
542 * static const char print_fmt_<call>[] = <TP_printk>; 572 * static char print_fmt_<call>[] = <TP_printk>;
543 * 573 *
544 * static struct ftrace_event_class __used event_class_<template> = { 574 * static struct ftrace_event_class __used event_class_<template> = {
545 * .system = "<system>", 575 * .system = "<system>",
@@ -690,9 +720,9 @@ static inline void ftrace_test_probe_##call(void) \
690#undef DECLARE_EVENT_CLASS 720#undef DECLARE_EVENT_CLASS
691#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 721#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
692_TRACE_PERF_PROTO(call, PARAMS(proto)); \ 722_TRACE_PERF_PROTO(call, PARAMS(proto)); \
693static const char print_fmt_##call[] = print; \ 723static char print_fmt_##call[] = print; \
694static struct ftrace_event_class __used __refdata event_class_##call = { \ 724static struct ftrace_event_class __used __refdata event_class_##call = { \
695 .system = __stringify(TRACE_SYSTEM), \ 725 .system = TRACE_SYSTEM_STRING, \
696 .define_fields = ftrace_define_fields_##call, \ 726 .define_fields = ftrace_define_fields_##call, \
697 .fields = LIST_HEAD_INIT(event_class_##call.fields),\ 727 .fields = LIST_HEAD_INIT(event_class_##call.fields),\
698 .raw_init = trace_event_raw_init, \ 728 .raw_init = trace_event_raw_init, \
@@ -719,7 +749,7 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
719#undef DEFINE_EVENT_PRINT 749#undef DEFINE_EVENT_PRINT
720#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ 750#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \
721 \ 751 \
722static const char print_fmt_##call[] = print; \ 752static char print_fmt_##call[] = print; \
723 \ 753 \
724static struct ftrace_event_call __used event_##call = { \ 754static struct ftrace_event_call __used event_##call = { \
725 .class = &event_class_##template, \ 755 .class = &event_class_##template, \
@@ -735,6 +765,7 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
735 765
736#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 766#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
737 767
768#undef TRACE_SYSTEM_VAR
738 769
739#ifdef CONFIG_PERF_EVENTS 770#ifdef CONFIG_PERF_EVENTS
740 771