ANDROID: vendor_hooks: Add new android vendor hooks for ipi stop

When a kernel panic occurred, it is sometimes caused by a other cpu
than the panic cpu. When a panic cpu sends smp stop IPI, it can help to
solve the problem even more if aonther cpu stores registers and
run cache flush.

Bug: 165956922

Change-Id: I21c74fe0d047e49b676c502bc9b8d8830e5431de
Signed-off-by: Changki Kim <changki.kim@samsung.com>
This commit is contained in:
Changki Kim 2020-08-23 14:36:48 +09:00 • committed by Todd Kjos
commit 55ff3b05bf
3 changed files with 29 additions and 0 deletions

View file

@ -53,6 +53,8 @@
#define CREATE_TRACE_POINTS
#include <trace/events/ipi.h>
#undef CREATE_TRACE_POINTS
#include <trace/hooks/debug.h>
DEFINE_PER_CPU_READ_MOSTLY(int, cpu_number);
EXPORT_PER_CPU_SYMBOL(cpu_number);
@ -899,6 +901,7 @@ void handle_IPI(int ipinr, struct pt_regs *regs)
break;
case IPI_CPU_STOP:
trace_android_vh_ipi_stop(regs);
irq_enter();
local_cpu_stop();
irq_exit();

View file

@ -16,6 +16,7 @@
#include <trace/hooks/futex.h>
#include <trace/hooks/fpsimd.h>
#include <trace/hooks/topology.h>
#include <trace/hooks/debug.h>
/*
* Export tracepoints that act as a bare tracehook (ie: have no trace event
@ -53,3 +54,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_write_finished);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alter_rwsem_list_add);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alter_futex_plist_add);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_is_fpsimd_save);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ipi_stop);

View file

@ -0,0 +1,24 @@
/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM debug
#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_DEBUG_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_DEBUG_H
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS)
DECLARE_HOOK(android_vh_ipi_stop,
TP_PROTO(struct pt_regs *regs),
TP_ARGS(regs))
#else
#define trace_android_vh_ipi_stop(regs)
#endif
#endif /* _TRACE_HOOK_DEBUG_H */
/* This part must be outside protection */
#include <trace/define_trace.h>