diff options
Diffstat (limited to 'include/linux/ftrace.h')
-rw-r--r-- | include/linux/ftrace.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 469ceb3e85ba..b295d3106bfe 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/init.h> | 7 | #include <linux/init.h> |
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #include <linux/kallsyms.h> | 9 | #include <linux/kallsyms.h> |
10 | #include <linux/bitops.h> | ||
10 | 11 | ||
11 | #ifdef CONFIG_FUNCTION_TRACER | 12 | #ifdef CONFIG_FUNCTION_TRACER |
12 | 13 | ||
@@ -391,4 +392,49 @@ static inline void ftrace_graph_init_task(struct task_struct *t) { } | |||
391 | static inline void ftrace_graph_exit_task(struct task_struct *t) { } | 392 | static inline void ftrace_graph_exit_task(struct task_struct *t) { } |
392 | #endif | 393 | #endif |
393 | 394 | ||
395 | #ifdef CONFIG_TRACING | ||
396 | #include <linux/sched.h> | ||
397 | |||
398 | /* flags for current->trace */ | ||
399 | enum { | ||
400 | TSK_TRACE_FL_TRACE_BIT = 0, | ||
401 | TSK_TRACE_FL_GRAPH_BIT = 1, | ||
402 | }; | ||
403 | enum { | ||
404 | TSK_TRACE_FL_TRACE = 1 << TSK_TRACE_FL_TRACE_BIT, | ||
405 | TSK_TRACE_FL_GRAPH = 1 << TSK_TRACE_FL_GRAPH_BIT, | ||
406 | }; | ||
407 | |||
408 | static inline void set_tsk_trace_trace(struct task_struct *tsk) | ||
409 | { | ||
410 | set_bit(TSK_TRACE_FL_TRACE_BIT, &tsk->trace); | ||
411 | } | ||
412 | |||
413 | static inline void clear_tsk_trace_trace(struct task_struct *tsk) | ||
414 | { | ||
415 | clear_bit(TSK_TRACE_FL_TRACE_BIT, &tsk->trace); | ||
416 | } | ||
417 | |||
418 | static inline int test_tsk_trace_trace(struct task_struct *tsk) | ||
419 | { | ||
420 | return tsk->trace & TSK_TRACE_FL_TRACE; | ||
421 | } | ||
422 | |||
423 | static inline void set_tsk_trace_graph(struct task_struct *tsk) | ||
424 | { | ||
425 | set_bit(TSK_TRACE_FL_GRAPH_BIT, &tsk->trace); | ||
426 | } | ||
427 | |||
428 | static inline void clear_tsk_trace_graph(struct task_struct *tsk) | ||
429 | { | ||
430 | clear_bit(TSK_TRACE_FL_GRAPH_BIT, &tsk->trace); | ||
431 | } | ||
432 | |||
433 | static inline int test_tsk_trace_graph(struct task_struct *tsk) | ||
434 | { | ||
435 | return tsk->trace & TSK_TRACE_FL_GRAPH; | ||
436 | } | ||
437 | |||
438 | #endif /* CONFIG_TRACING */ | ||
439 | |||
394 | #endif /* _LINUX_FTRACE_H */ | 440 | #endif /* _LINUX_FTRACE_H */ |