aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rcupdate.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2016-03-21 19:46:04 -0700
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2016-03-31 13:29:08 -0700
commit274529ba9bda86c91c2c06da3a641aaf617dd30f (patch)
tree3bf398577e821ee17bec1457fc0cd55d7d4d7403 /include/linux/rcupdate.h
parentLinux 4.6-rc1 (diff)
downloadlinux-dev-274529ba9bda86c91c2c06da3a641aaf617dd30f.tar.xz
linux-dev-274529ba9bda86c91c2c06da3a641aaf617dd30f.zip
rcu: Consolidate dumping of ftrace buffer
This commit consolidates a couple definitions and several calls for single-shot ftrace-buffer dumping. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'include/linux/rcupdate.h')
-rw-r--r--include/linux/rcupdate.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 2657aff2725b..45de591657a6 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -1144,4 +1144,17 @@ static inline void rcu_sysidle_force_exit(void)
#endif /* #else #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */
+/*
+ * Dump the ftrace buffer, but only one time per callsite per boot.
+ */
+#define rcu_ftrace_dump(oops_dump_mode) \
+do { \
+ static atomic_t ___rfd_beenhere = ATOMIC_INIT(0); \
+ \
+ if (!atomic_read(&___rfd_beenhere) && \
+ !atomic_xchg(&___rfd_beenhere, 1)) \
+ ftrace_dump(oops_dump_mode); \
+} while (0)
+
+
#endif /* __LINUX_RCUPDATE_H */