aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/ftrace_event.h10
-rw-r--r--include/linux/tracepoint.h12
-rw-r--r--include/trace/define_trace.h1
-rw-r--r--include/trace/events/sched.h12
-rw-r--r--include/trace/ftrace.h31
5 files changed, 52 insertions, 14 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index df5b085c4150..ace2da9e0a0d 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -140,9 +140,17 @@ extern int filter_current_check_discard(struct ftrace_event_call *call,
140 void *rec, 140 void *rec,
141 struct ring_buffer_event *event); 141 struct ring_buffer_event *event);
142 142
143enum {
144 FILTER_OTHER = 0,
145 FILTER_STATIC_STRING,
146 FILTER_DYN_STRING,
147 FILTER_PTR_STRING,
148};
149
143extern int trace_define_field(struct ftrace_event_call *call, 150extern int trace_define_field(struct ftrace_event_call *call,
144 const char *type, const char *name, 151 const char *type, const char *name,
145 int offset, int size, int is_signed); 152 int offset, int size, int is_signed,
153 int filter_type);
146extern int trace_define_common_fields(struct ftrace_event_call *call); 154extern int trace_define_common_fields(struct ftrace_event_call *call);
147 155
148#define is_signed_type(type) (((type)(-1)) < 0) 156#define is_signed_type(type) (((type)(-1)) < 0)
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 846a4ae501eb..63a3f7a80580 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -165,6 +165,15 @@ static inline void tracepoint_synchronize_unregister(void)
165 165
166#define PARAMS(args...) args 166#define PARAMS(args...) args
167 167
168#endif /* _LINUX_TRACEPOINT_H */
169
170/*
171 * Note: we keep the TRACE_EVENT outside the include file ifdef protection.
172 * This is due to the way trace events work. If a file includes two
173 * trace event headers under one "CREATE_TRACE_POINTS" the first include
174 * will override the TRACE_EVENT and break the second include.
175 */
176
168#ifndef TRACE_EVENT 177#ifndef TRACE_EVENT
169/* 178/*
170 * For use with the TRACE_EVENT macro: 179 * For use with the TRACE_EVENT macro:
@@ -276,6 +285,5 @@ static inline void tracepoint_synchronize_unregister(void)
276#define TRACE_EVENT_FN(name, proto, args, struct, \ 285#define TRACE_EVENT_FN(name, proto, args, struct, \
277 assign, print, reg, unreg) \ 286 assign, print, reg, unreg) \
278 DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) 287 DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
279#endif
280 288
281#endif 289#endif /* ifdef TRACE_EVENT (see note above) */
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
index 2a969850736d..a89ed590597a 100644
--- a/include/trace/define_trace.h
+++ b/include/trace/define_trace.h
@@ -61,6 +61,7 @@
61#include <trace/ftrace.h> 61#include <trace/ftrace.h>
62#endif 62#endif
63 63
64#undef TRACE_EVENT
64#undef TRACE_HEADER_MULTI_READ 65#undef TRACE_HEADER_MULTI_READ
65 66
66/* Only undef what we defined in this file */ 67/* Only undef what we defined in this file */
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 8949bb7eb082..a581ef211ff5 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -94,6 +94,7 @@ TRACE_EVENT(sched_wakeup,
94 __field( pid_t, pid ) 94 __field( pid_t, pid )
95 __field( int, prio ) 95 __field( int, prio )
96 __field( int, success ) 96 __field( int, success )
97 __field( int, cpu )
97 ), 98 ),
98 99
99 TP_fast_assign( 100 TP_fast_assign(
@@ -101,11 +102,12 @@ TRACE_EVENT(sched_wakeup,
101 __entry->pid = p->pid; 102 __entry->pid = p->pid;
102 __entry->prio = p->prio; 103 __entry->prio = p->prio;
103 __entry->success = success; 104 __entry->success = success;
105 __entry->cpu = task_cpu(p);
104 ), 106 ),
105 107
106 TP_printk("task %s:%d [%d] success=%d", 108 TP_printk("task %s:%d [%d] success=%d [%03d]",
107 __entry->comm, __entry->pid, __entry->prio, 109 __entry->comm, __entry->pid, __entry->prio,
108 __entry->success) 110 __entry->success, __entry->cpu)
109); 111);
110 112
111/* 113/*
@@ -125,6 +127,7 @@ TRACE_EVENT(sched_wakeup_new,
125 __field( pid_t, pid ) 127 __field( pid_t, pid )
126 __field( int, prio ) 128 __field( int, prio )
127 __field( int, success ) 129 __field( int, success )
130 __field( int, cpu )
128 ), 131 ),
129 132
130 TP_fast_assign( 133 TP_fast_assign(
@@ -132,11 +135,12 @@ TRACE_EVENT(sched_wakeup_new,
132 __entry->pid = p->pid; 135 __entry->pid = p->pid;
133 __entry->prio = p->prio; 136 __entry->prio = p->prio;
134 __entry->success = success; 137 __entry->success = success;
138 __entry->cpu = task_cpu(p);
135 ), 139 ),
136 140
137 TP_printk("task %s:%d [%d] success=%d", 141 TP_printk("task %s:%d [%d] success=%d [%03d]",
138 __entry->comm, __entry->pid, __entry->prio, 142 __entry->comm, __entry->pid, __entry->prio,
139 __entry->success) 143 __entry->success, __entry->cpu)
140); 144);
141 145
142/* 146/*
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 3a0b44bdabf7..360a77ad79e1 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -21,6 +21,9 @@
21#undef __field 21#undef __field
22#define __field(type, item) type item; 22#define __field(type, item) type item;
23 23
24#undef __field_ext
25#define __field_ext(type, item, filter_type) type item;
26
24#undef __array 27#undef __array
25#define __array(type, item, len) type item[len]; 28#define __array(type, item, len) type item[len];
26 29
@@ -71,7 +74,10 @@
71 */ 74 */
72 75
73#undef __field 76#undef __field
74#define __field(type, item); 77#define __field(type, item)
78
79#undef __field_ext
80#define __field_ext(type, item, filter_type)
75 81
76#undef __array 82#undef __array
77#define __array(type, item, len) 83#define __array(type, item, len)
@@ -119,6 +125,9 @@
119 if (!ret) \ 125 if (!ret) \
120 return 0; 126 return 0;
121 127
128#undef __field_ext
129#define __field_ext(type, item, filter_type) __field(type, item)
130
122#undef __array 131#undef __array
123#define __array(type, item, len) \ 132#define __array(type, item, len) \
124 ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \ 133 ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \
@@ -274,28 +283,33 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
274 283
275#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 284#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
276 285
277#undef __field 286#undef __field_ext
278#define __field(type, item) \ 287#define __field_ext(type, item, filter_type) \
279 ret = trace_define_field(event_call, #type, #item, \ 288 ret = trace_define_field(event_call, #type, #item, \
280 offsetof(typeof(field), item), \ 289 offsetof(typeof(field), item), \
281 sizeof(field.item), is_signed_type(type)); \ 290 sizeof(field.item), \
291 is_signed_type(type), filter_type); \
282 if (ret) \ 292 if (ret) \
283 return ret; 293 return ret;
284 294
295#undef __field
296#define __field(type, item) __field_ext(type, item, FILTER_OTHER)
297
285#undef __array 298#undef __array
286#define __array(type, item, len) \ 299#define __array(type, item, len) \
287 BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ 300 BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \
288 ret = trace_define_field(event_call, #type "[" #len "]", #item, \ 301 ret = trace_define_field(event_call, #type "[" #len "]", #item, \
289 offsetof(typeof(field), item), \ 302 offsetof(typeof(field), item), \
290 sizeof(field.item), 0); \ 303 sizeof(field.item), 0, FILTER_OTHER); \
291 if (ret) \ 304 if (ret) \
292 return ret; 305 return ret;
293 306
294#undef __dynamic_array 307#undef __dynamic_array
295#define __dynamic_array(type, item, len) \ 308#define __dynamic_array(type, item, len) \
296 ret = trace_define_field(event_call, "__data_loc " #type "[]", #item, \ 309 ret = trace_define_field(event_call, "__data_loc " #type "[]", #item, \
297 offsetof(typeof(field), __data_loc_##item), \ 310 offsetof(typeof(field), __data_loc_##item), \
298 sizeof(field.__data_loc_##item), 0); 311 sizeof(field.__data_loc_##item), 0, \
312 FILTER_OTHER);
299 313
300#undef __string 314#undef __string
301#define __string(item, src) __dynamic_array(char, item, -1) 315#define __string(item, src) __dynamic_array(char, item, -1)
@@ -329,6 +343,9 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \
329#undef __field 343#undef __field
330#define __field(type, item) 344#define __field(type, item)
331 345
346#undef __field_ext
347#define __field_ext(type, item, filter_type)
348
332#undef __array 349#undef __array
333#define __array(type, item, len) 350#define __array(type, item, len)
334 351