aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ftrace.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ftrace.h')
-rw-r--r--include/linux/ftrace.h46
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) { }
391static inline void ftrace_graph_exit_task(struct task_struct *t) { } 392static 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 */
399enum {
400 TSK_TRACE_FL_TRACE_BIT = 0,
401 TSK_TRACE_FL_GRAPH_BIT = 1,
402};
403enum {
404 TSK_TRACE_FL_TRACE = 1 << TSK_TRACE_FL_TRACE_BIT,
405 TSK_TRACE_FL_GRAPH = 1 << TSK_TRACE_FL_GRAPH_BIT,
406};
407
408static inline void set_tsk_trace_trace(struct task_struct *tsk)
409{
410 set_bit(TSK_TRACE_FL_TRACE_BIT, &tsk->trace);
411}
412
413static inline void clear_tsk_trace_trace(struct task_struct *tsk)
414{
415 clear_bit(TSK_TRACE_FL_TRACE_BIT, &tsk->trace);
416}
417
418static inline int test_tsk_trace_trace(struct task_struct *tsk)
419{
420 return tsk->trace & TSK_TRACE_FL_TRACE;
421}
422
423static inline void set_tsk_trace_graph(struct task_struct *tsk)
424{
425 set_bit(TSK_TRACE_FL_GRAPH_BIT, &tsk->trace);
426}
427
428static inline void clear_tsk_trace_graph(struct task_struct *tsk)
429{
430 clear_bit(TSK_TRACE_FL_GRAPH_BIT, &tsk->trace);
431}
432
433static 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 */