summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2016-05-25 14:03:50 +0200
committerSteven Rostedt <rostedt@goodmis.org>2017-11-23 00:49:47 -0500
commit59f0482a8045c438eee8c1e42cea167164726a62 (patch)
treea2e54c0b5efc1d703790f50570d524a0bb821bb7
parent7ab3b071b0f75ddd12af6b6e4d96d12e8ca3fd0d (diff)
downloadlinux-rt-59f0482a8045c438eee8c1e42cea167164726a62.tar.gz
trace: correct off by one while recording the trace-event
Trace events like raw_syscalls show always a preempt code of one. The reason is that on PREEMPT kernels rcu_read_lock_sched_notrace() increases the preemption counter and the function recording the counter is caller within the RCU section. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> [ Changed this to upstream version. See commit e947841c0dce ] Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--include/trace/ftrace.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 763bf05ccb27..73aab555b42d 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -530,6 +530,9 @@ ftrace_raw_event_##call(void *__data, proto) \
\
local_save_flags(irq_flags); \
pc = preempt_count(); \
+ /* Account for tracepoint preempt disable */ \
+ if (IS_ENABLED(CONFIG_PREEMPT)) \
+ pc--; \
\
__data_size = ftrace_get_offsets_##call(&__data_offsets, args); \
\