This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 1/1] stp: rt: force to enable preempt


-rt mode preempt lead to __might_sleep calltrace.
Enabling preempt solves the problem.

Call Trace:
 [<ffffffff818d83f1>] dump_stack+0x19/0x1b
 [<ffffffff81070e3f>] __might_sleep+0xef/0x160
 [<ffffffff818de710>] rt_spin_lock+0x20/0x50
 [<ffffffff81178699>] d_path+0x79/0x1a0
 [<ffffffffa0058ae9>] __stp_get_mm_path.constprop.80+0x49/0x90 [stap_9e04047d79e94b52d0e35b78e6537085_2077]
 [<ffffffffa005e1a7>] __stp_utrace_attach_match_tsk.isra.54+0x77/0x1a0 [stap_9e04047d79e94b52d0e35b78e6537085_2077]
 [<ffffffffa005e30c>] __stp_utrace_task_finder_report_exec+0x3c/0x50 [stap_9e04047d79e94b52d0e35b78e6537085_2077]
 [<ffffffffa0058a59>] utrace_report_exec+0xb9/0x100 [stap_9e04047d79e94b52d0e35b78e6537085_2077]
 [<ffffffff811674b2>] search_binary_handler+0x332/0x380
 [<ffffffff81168d0c>] do_execve_common.isra.24+0x55c/0x640
 [<ffffffff81168e08>] do_execve+0x18/0x20
 [<ffffffff81169082>] SyS_execve+0x32/0x50
 [<ffffffff818e6979>] stub_execve+0x69/0xa0

After this patch is applied, the above backtrace disappears.

Signed-off-by: Zhu Yanjun <yanjun.zhu@windriver.com>
---
 runtime/stp_utrace.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/runtime/stp_utrace.c b/runtime/stp_utrace.c
index c69dec1..ba858a3 100644
--- a/runtime/stp_utrace.c
+++ b/runtime/stp_utrace.c
@@ -1979,6 +1979,9 @@ static void utrace_report_exec(void *cb_data __attribute__ ((unused)),
 {
 	struct utrace *utrace;
 
+#ifdef CONFIG_PREEMPT_RT_FULL
+	preempt_enable();
+#endif
 	if (atomic_read(&utrace_state) != __UTRACE_REGISTERED)
 		return;
 	utrace = task_utrace_struct(task);
@@ -1990,6 +1993,9 @@ static void utrace_report_exec(void *cb_data __attribute__ ((unused)),
 		REPORT(task, utrace, &report, UTRACE_EVENT(EXEC),
 		       report_exec, NULL, NULL, NULL /* regs */);
 	}
+#ifdef CONFIG_PREEMPT_RT_FULL
+	preempt_disable();
+#endif
 }
 
 #if 0
-- 
1.7.9.5


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]