lkml.org 
[lkml]   [2016]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH RT 2/4] trace: correct off by one while recording the trace-event
3.4.112-rt143-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

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>
---
include/trace/ftrace.h | 3 +++
1 file changed, 3 insertions(+)

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); \
\
--
2.8.1

\
 
 \ /
  Last update: 2016-07-12 21:41    [W:0.170 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site