This patch invokes function coresight_emergency_stop() to stop Arm CoreSight before kdump is started. This feature is needed to stop CoreSight tracers and dump trace data from sink to buffer, the buffer can be either the aux buffer in perf mode or small size buffer within driver data structure for SysFS mode.
The related buffer can be saved in the vmcore file by kdump, users can retrieve the trace data from buffer in the vmcore and use it for post mortem analysis and reverse the program flow before panic.
Signed-off-by: Leo Yan leo.yan@linaro.org --- arch/arm64/kernel/smp.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 25fcd22..823d49a 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -41,6 +41,7 @@ #include <linux/of.h> #include <linux/irq_work.h> #include <linux/kexec.h> +#include <linux/coresight.h>
#include <asm/alternative.h> #include <asm/atomic.h> @@ -830,6 +831,8 @@ static void ipi_cpu_crash_stop(unsigned int cpu, struct pt_regs *regs) #ifdef CONFIG_KEXEC_CORE crash_save_cpu(regs, cpu);
+ coresight_emergency_stop(); + atomic_dec(&waiting_for_crash_ipi);
local_irq_disable(); @@ -973,6 +976,8 @@ void crash_smp_send_stop(void)
cpus_stopped = 1;
+ coresight_emergency_stop(); + if (num_online_cpus() == 1) { sdei_mask_local_cpu(); return;