android_kernel_xiaomi_sm8350/kernel/trace
Frederic Weisbecker 4a2b8dda3f tracing/function-graph-tracer: fix a regression while suspend to disk
Impact: fix a crash while kernel image restore

When the function graph tracer is running and while suspend to disk, some racy
and dangerous things happen against this tracer.

The current task will save its registers including the stack pointer which
contains the return address hooked by the tracer. But the current task will
continue to enter other functions after that to save the memory, and then
it will store other return addresses, and finally loose the old depth which
matches the return address saved in the old stack (during the registers saving).

So on image restore, the code will return to wrong addresses.
And there are other things: on restore, the task will have it's "current"
pointer overwritten during registers restoring....switching from one task to
another... That would be insane to try to trace function graphs at these
stages.

This patch makes the function graph tracer listening on power events, making
it's tracing disabled for the current task (the one that performs the
hibernation work) while suspend/resume to disk, making the tracing safe
during hibernation.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-01-15 09:47:40 +01:00
..
ftrace.c tracing/function-graph-tracer: fix a regression while suspend to disk 2009-01-15 09:47:40 +01:00
Kconfig tracing: add a new workqueue tracer 2009-01-14 12:11:43 +01:00
kmemtrace.c kmemtrace: add kmemtrace_init() 2009-01-06 10:16:35 +01:00
Makefile tracing: add a new workqueue tracer 2009-01-14 12:11:43 +01:00
ring_buffer.c ring_buffer: reset write when reserve buffer fail 2009-01-15 09:46:40 +01:00
trace_boot.c Merge branches 'tracing/kmemtrace2' and 'tracing/ftrace' into tracing/urgent 2009-01-06 10:18:43 +01:00
trace_branch.c tracing/ftrace: separate events tracing and stats tracing engine 2009-01-14 12:11:37 +01:00
trace_functions_graph.c Merge branches 'tracing/kmemtrace2' and 'tracing/ftrace' into tracing/urgent 2009-01-06 10:18:43 +01:00
trace_functions.c ftrace: introduce tracing_reset_online_cpus() helper 2008-12-19 16:29:34 +01:00
trace_hw_branches.c Merge branches 'tracing/kmemtrace2' and 'tracing/ftrace' into tracing/urgent 2009-01-06 10:18:43 +01:00
trace_irqsoff.c tracing/ftrace: change the type of the init() callback 2008-11-16 07:55:23 +01:00
trace_mmiotrace.c mmiotrace: count events lost due to not recording 2009-01-11 04:01:30 +01:00
trace_nop.c tracing/ftrace: make nop tracer using tracer flags 2008-11-18 11:10:59 +01:00
trace_output.c ftrace: change trace.c to use registered events 2008-12-29 12:46:12 +01:00
trace_output.h ftrace: change trace.c to use registered events 2008-12-29 12:46:12 +01:00
trace_power.c Merge branches 'tracing/kmemtrace2' and 'tracing/ftrace' into tracing/urgent 2009-01-06 10:18:43 +01:00
trace_sched_switch.c sched, trace: update trace_sched_wakeup() 2008-12-25 13:10:21 +01:00
trace_sched_wakeup.c sched, trace: update trace_sched_wakeup() 2008-12-25 13:10:21 +01:00
trace_selftest_dynamic.c
trace_selftest.c tracing/selftest: remove TRACE_CONT reference 2008-12-29 15:07:47 +01:00
trace_stack.c trace: better use of stack_trace_enabled for boot up code 2008-12-18 12:56:56 +01:00
trace_stat.c tracing/ftrace: separate events tracing and stats tracing engine 2009-01-14 12:11:37 +01:00
trace_stat.h tracing/ftrace: separate events tracing and stats tracing engine 2009-01-14 12:11:37 +01:00
trace_sysprof.c cpumask: convert kernel trace functions 2009-01-01 10:12:22 +10:30
trace_workqueue.c tracing: add a new workqueue tracer 2009-01-14 12:11:43 +01:00
trace.c trace: stop all recording to ring buffer on ftrace_dump 2009-01-15 09:47:13 +01:00
trace.h tracing/ftrace: separate events tracing and stats tracing engine 2009-01-14 12:11:37 +01:00