diff options
Diffstat (limited to 'include/linux/ftrace_event.h')
-rw-r--r-- | include/linux/ftrace_event.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index cdc30111d2f8..d16da3e53bc7 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/percpu.h> | 7 | #include <linux/percpu.h> |
8 | #include <linux/hardirq.h> | 8 | #include <linux/hardirq.h> |
9 | #include <linux/perf_event.h> | 9 | #include <linux/perf_event.h> |
10 | #include <linux/tracepoint.h> | ||
10 | 11 | ||
11 | struct trace_array; | 12 | struct trace_array; |
12 | struct trace_buffer; | 13 | struct trace_buffer; |
@@ -232,6 +233,7 @@ enum { | |||
232 | TRACE_EVENT_FL_IGNORE_ENABLE_BIT, | 233 | TRACE_EVENT_FL_IGNORE_ENABLE_BIT, |
233 | TRACE_EVENT_FL_WAS_ENABLED_BIT, | 234 | TRACE_EVENT_FL_WAS_ENABLED_BIT, |
234 | TRACE_EVENT_FL_USE_CALL_FILTER_BIT, | 235 | TRACE_EVENT_FL_USE_CALL_FILTER_BIT, |
236 | TRACE_EVENT_FL_TRACEPOINT_BIT, | ||
235 | }; | 237 | }; |
236 | 238 | ||
237 | /* | 239 | /* |
@@ -244,6 +246,7 @@ enum { | |||
244 | * (used for module unloading, if a module event is enabled, | 246 | * (used for module unloading, if a module event is enabled, |
245 | * it is best to clear the buffers that used it). | 247 | * it is best to clear the buffers that used it). |
246 | * USE_CALL_FILTER - For ftrace internal events, don't use file filter | 248 | * USE_CALL_FILTER - For ftrace internal events, don't use file filter |
249 | * TRACEPOINT - Event is a tracepoint | ||
247 | */ | 250 | */ |
248 | enum { | 251 | enum { |
249 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), | 252 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), |
@@ -252,12 +255,17 @@ enum { | |||
252 | TRACE_EVENT_FL_IGNORE_ENABLE = (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT), | 255 | TRACE_EVENT_FL_IGNORE_ENABLE = (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT), |
253 | TRACE_EVENT_FL_WAS_ENABLED = (1 << TRACE_EVENT_FL_WAS_ENABLED_BIT), | 256 | TRACE_EVENT_FL_WAS_ENABLED = (1 << TRACE_EVENT_FL_WAS_ENABLED_BIT), |
254 | TRACE_EVENT_FL_USE_CALL_FILTER = (1 << TRACE_EVENT_FL_USE_CALL_FILTER_BIT), | 257 | TRACE_EVENT_FL_USE_CALL_FILTER = (1 << TRACE_EVENT_FL_USE_CALL_FILTER_BIT), |
258 | TRACE_EVENT_FL_TRACEPOINT = (1 << TRACE_EVENT_FL_TRACEPOINT_BIT), | ||
255 | }; | 259 | }; |
256 | 260 | ||
257 | struct ftrace_event_call { | 261 | struct ftrace_event_call { |
258 | struct list_head list; | 262 | struct list_head list; |
259 | struct ftrace_event_class *class; | 263 | struct ftrace_event_class *class; |
260 | char *name; | 264 | union { |
265 | char *name; | ||
266 | /* Set TRACE_EVENT_FL_TRACEPOINT flag when using "tp" */ | ||
267 | struct tracepoint *tp; | ||
268 | }; | ||
261 | struct trace_event event; | 269 | struct trace_event event; |
262 | const char *print_fmt; | 270 | const char *print_fmt; |
263 | struct event_filter *filter; | 271 | struct event_filter *filter; |
@@ -271,6 +279,7 @@ struct ftrace_event_call { | |||
271 | * bit 3: ftrace internal event (do not enable) | 279 | * bit 3: ftrace internal event (do not enable) |
272 | * bit 4: Event was enabled by module | 280 | * bit 4: Event was enabled by module |
273 | * bit 5: use call filter rather than file filter | 281 | * bit 5: use call filter rather than file filter |
282 | * bit 6: Event is a tracepoint | ||
274 | */ | 283 | */ |
275 | int flags; /* static flags of different events */ | 284 | int flags; /* static flags of different events */ |
276 | 285 | ||
@@ -283,6 +292,15 @@ struct ftrace_event_call { | |||
283 | #endif | 292 | #endif |
284 | }; | 293 | }; |
285 | 294 | ||
295 | static inline const char * | ||
296 | ftrace_event_name(struct ftrace_event_call *call) | ||
297 | { | ||
298 | if (call->flags & TRACE_EVENT_FL_TRACEPOINT) | ||
299 | return call->tp ? call->tp->name : NULL; | ||
300 | else | ||
301 | return call->name; | ||
302 | } | ||
303 | |||
286 | struct trace_array; | 304 | struct trace_array; |
287 | struct ftrace_subsystem_dir; | 305 | struct ftrace_subsystem_dir; |
288 | 306 | ||
@@ -353,7 +371,7 @@ struct ftrace_event_file { | |||
353 | #define __TRACE_EVENT_FLAGS(name, value) \ | 371 | #define __TRACE_EVENT_FLAGS(name, value) \ |
354 | static int __init trace_init_flags_##name(void) \ | 372 | static int __init trace_init_flags_##name(void) \ |
355 | { \ | 373 | { \ |
356 | event_##name.flags = value; \ | 374 | event_##name.flags |= value; \ |
357 | return 0; \ | 375 | return 0; \ |
358 | } \ | 376 | } \ |
359 | early_initcall(trace_init_flags_##name); | 377 | early_initcall(trace_init_flags_##name); |