diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2008-12-05 21:43:41 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-08 09:11:45 -0500 |
commit | 380c4b1411ccd6885f92b2c8ceb08433a720f44e (patch) | |
tree | f3b571e1caff2de3e6b4cace87c2b1ec332667d7 /include/linux/ftrace.h | |
parent | 8e1b82e0866befaa0b2920be296c6e4c3fc7f422 (diff) |
tracing/function-graph-tracer: append the tracing_graph_flag
Impact: Provide a way to pause the function graph tracer
As suggested by Steven Rostedt, the previous patch that prevented from
spinlock function tracing shouldn't use the raw_spinlock to fix it.
It's much better to follow lockdep with normal spinlock, so this patch
adds a new flag for each task to make the function graph tracer able
to be paused. We also can send an ftrace_printk whithout worrying of
the irrelevant traced spinlock during insertion.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/ftrace.h')
-rw-r--r-- | include/linux/ftrace.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 449fa8e9e34f..11cac81eed08 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -401,6 +401,16 @@ static inline int task_curr_ret_stack(struct task_struct *t) | |||
401 | { | 401 | { |
402 | return t->curr_ret_stack; | 402 | return t->curr_ret_stack; |
403 | } | 403 | } |
404 | |||
405 | static inline void pause_graph_tracing(void) | ||
406 | { | ||
407 | atomic_inc(¤t->tracing_graph_pause); | ||
408 | } | ||
409 | |||
410 | static inline void unpause_graph_tracing(void) | ||
411 | { | ||
412 | atomic_dec(¤t->tracing_graph_pause); | ||
413 | } | ||
404 | #else | 414 | #else |
405 | 415 | ||
406 | #define __notrace_funcgraph | 416 | #define __notrace_funcgraph |
@@ -412,6 +422,9 @@ static inline int task_curr_ret_stack(struct task_struct *tsk) | |||
412 | { | 422 | { |
413 | return -1; | 423 | return -1; |
414 | } | 424 | } |
425 | |||
426 | static inline void pause_graph_tracing(void) { } | ||
427 | static inline void unpause_graph_tracing(void) { } | ||
415 | #endif | 428 | #endif |
416 | 429 | ||
417 | #ifdef CONFIG_TRACING | 430 | #ifdef CONFIG_TRACING |