sched/tracing: Show stacktrace for wakeup tracers
Subsystems (3)
PATCH v2 1/1 sched/tracing: Show stacktrace for wakeup tracers
This align the behavior of wakeup tracers with irqsoff latency tracer that we record stacktrace at the beginning and end of waking up. The stacktrace shows us what is happening in the kernel.
Signed-off-by Changbin Du <[email protected]>
--- kernel/trace/trace_sched_wakeup.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/trace/trace_sched_wakeup.c +2 -0
@@ -475,6 +475,7 @@ probe_wakeup_sched_switch(void *ignore, bool preempt,__trace_function (wakeup_trace,CALLER_ADDR0 ,CALLER_ADDR1 , flags, pc);tracing_sched_switch_trace (wakeup_trace, prev, next, flags, pc); +__trace_stack (wakeup_trace, flags,0 , pc);T0 = data->preempt_timestamp;T1 =ftrace_now (cpu);
@@ -586,6 +587,7 @@ probe_wakeup(void *ignore, struct task_struct *p) data =per_cpu_ptr (wakeup_trace->trace_buffer.data, wakeup_cpu); data->preempt_timestamp =ftrace_now (cpu);tracing_sched_wakeup_trace (wakeup_trace, p, current, flags, pc); +__trace_stack (wakeup_trace, flags,0 , pc);/* * We must be careful in using CALLER_ADDR2. But since wake_up
Signature · 1 line
2.17.1
Steven Rostedt
maintainerQuoted 5 lines · On Thu, 17 Jan 2019 00:02:49 +0800 Changbin Du <[email protected]> wrote:
This align the behavior of wakeup tracers with irqsoff latency tracer that we record stacktrace at the beginning and end of waking up. The stacktrace shows us what is happening in the kernel.
Signed-off-by Changbin Du <[email protected]>
I've applied your patch, but it may be a while before you see it in linux-next. I'll be traveling for a bit and wont be able to do the full tests which I do before pushing to my linux-next branch.
You may see them soon in my ftrace/core branch on kernel.org.
-- Steve
Quoted 24 lines
--- kernel/trace/trace_sched_wakeup.c | 2 ++ 1 file changed, 2 insertions(+)kernel/trace/trace_sched_wakeup.c +2
-0@@ -475,6 +475,7 @@ probe_wakeup_sched_switch(void *ignore, bool preempt,__trace_function (wakeup_trace,CALLER_ADDR0 ,CALLER_ADDR1 , flags, pc);tracing_sched_switch_trace (wakeup_trace, prev, next, flags, pc); +__trace_stack (wakeup_trace, flags,0 , pc);T0 = data->preempt_timestamp;T1 =ftrace_now (cpu);@@ -586,6 +587,7 @@ probe_wakeup(void *ignore, struct task_struct *p) data =per_cpu_ptr (wakeup_trace->trace_buffer.data, wakeup_cpu); data->preempt_timestamp =ftrace_now (cpu);tracing_sched_wakeup_trace (wakeup_trace, p, current, flags, pc); +__trace_stack (wakeup_trace, flags,0 , pc);/* * We must be careful in using CALLER_ADDR2. But since wake_up