diff options
author | Steven Rostedt <srostedt@redhat.com> | 2008-05-12 15:20:41 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-23 14:31:15 -0400 |
commit | 502825282e6f79c975a644afc124432ec1744de4 (patch) | |
tree | 79d26dd2f945358cb3df6716c885978217823f6f /include/linux/preempt.h | |
parent | 7c731e0a495e25e79dc1e9e68772a67a55721a65 (diff) |
ftrace: add preempt_enable/disable notrace macros
The tracer may need to call preempt_enable and disable functions
for time keeping and such. The trace gets ugly when we see these
functions show up for all traces. To make the output cleaner
this patch adds preempt_enable_notrace and preempt_disable_notrace
to be used by tracer (and debugging) functions.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/preempt.h')
-rw-r--r-- | include/linux/preempt.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index 23f0c54175cd..36b03d50bf40 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
@@ -52,6 +52,34 @@ do { \ | |||
52 | preempt_check_resched(); \ | 52 | preempt_check_resched(); \ |
53 | } while (0) | 53 | } while (0) |
54 | 54 | ||
55 | /* For debugging and tracer internals only! */ | ||
56 | #define add_preempt_count_notrace(val) \ | ||
57 | do { preempt_count() += (val); } while (0) | ||
58 | #define sub_preempt_count_notrace(val) \ | ||
59 | do { preempt_count() -= (val); } while (0) | ||
60 | #define inc_preempt_count_notrace() add_preempt_count_notrace(1) | ||
61 | #define dec_preempt_count_notrace() sub_preempt_count_notrace(1) | ||
62 | |||
63 | #define preempt_disable_notrace() \ | ||
64 | do { \ | ||
65 | inc_preempt_count_notrace(); \ | ||
66 | barrier(); \ | ||
67 | } while (0) | ||
68 | |||
69 | #define preempt_enable_no_resched_notrace() \ | ||
70 | do { \ | ||
71 | barrier(); \ | ||
72 | dec_preempt_count_notrace(); \ | ||
73 | } while (0) | ||
74 | |||
75 | /* preempt_check_resched is OK to trace */ | ||
76 | #define preempt_enable_notrace() \ | ||
77 | do { \ | ||
78 | preempt_enable_no_resched_notrace(); \ | ||
79 | barrier(); \ | ||
80 | preempt_check_resched(); \ | ||
81 | } while (0) | ||
82 | |||
55 | #else | 83 | #else |
56 | 84 | ||
57 | #define preempt_disable() do { } while (0) | 85 | #define preempt_disable() do { } while (0) |
@@ -59,6 +87,10 @@ do { \ | |||
59 | #define preempt_enable() do { } while (0) | 87 | #define preempt_enable() do { } while (0) |
60 | #define preempt_check_resched() do { } while (0) | 88 | #define preempt_check_resched() do { } while (0) |
61 | 89 | ||
90 | #define preempt_disable_notrace() do { } while (0) | ||
91 | #define preempt_enable_no_resched_notrace() do { } while (0) | ||
92 | #define preempt_enable_notrace() do { } while (0) | ||
93 | |||
62 | #endif | 94 | #endif |
63 | 95 | ||
64 | #ifdef CONFIG_PREEMPT_NOTIFIERS | 96 | #ifdef CONFIG_PREEMPT_NOTIFIERS |