summaryrefslogtreecommitdiffstats
path: root/include/linux/preempt.h
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2008-05-12 21:20:41 +0200
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 20:31:15 +0200
commit502825282e6f79c975a644afc124432ec1744de4 (patch)
tree79d26dd2f945358cb3df6716c885978217823f6f /include/linux/preempt.h
parent7c731e0a495e25e79dc1e9e68772a67a55721a65 (diff)
downloadlinux-502825282e6f79c975a644afc124432ec1744de4.tar.gz
linux-502825282e6f79c975a644afc124432ec1744de4.tar.bz2
linux-502825282e6f79c975a644afc124432ec1744de4.zip
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.h32
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 { \
preempt_check_resched(); \
} while (0)
+/* For debugging and tracer internals only! */
+#define add_preempt_count_notrace(val) \
+ do { preempt_count() += (val); } while (0)
+#define sub_preempt_count_notrace(val) \
+ do { preempt_count() -= (val); } while (0)
+#define inc_preempt_count_notrace() add_preempt_count_notrace(1)
+#define dec_preempt_count_notrace() sub_preempt_count_notrace(1)
+
+#define preempt_disable_notrace() \
+do { \
+ inc_preempt_count_notrace(); \
+ barrier(); \
+} while (0)
+
+#define preempt_enable_no_resched_notrace() \
+do { \
+ barrier(); \
+ dec_preempt_count_notrace(); \
+} while (0)
+
+/* preempt_check_resched is OK to trace */
+#define preempt_enable_notrace() \
+do { \
+ preempt_enable_no_resched_notrace(); \
+ barrier(); \
+ preempt_check_resched(); \
+} while (0)
+
#else
#define preempt_disable() do { } while (0)
@@ -59,6 +87,10 @@ do { \
#define preempt_enable() do { } while (0)
#define preempt_check_resched() do { } while (0)
+#define preempt_disable_notrace() do { } while (0)
+#define preempt_enable_no_resched_notrace() do { } while (0)
+#define preempt_enable_notrace() do { } while (0)
+
#endif
#ifdef CONFIG_PREEMPT_NOTIFIERS