ANDROID: bug: add vendor hook for bug trap
Add hook to gather data of bug trap and summarize it with other information. It helps the bootloader produce the summary information when kernel panic or watchdog reset occurs. It can be obtained through Ramdump, etc., and this information can be used to quickly classify and respond to problems. Bug: 326888644 Bug: 381974812 Change-Id: I4aa398f42e13b50b719f91042d89290d03090d2a Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com> (cherry picked from commit e74b4da79162aaf5ad40d1df6200da47953d0ff1) Signed-off-by: Cixi Geng <cixi.geng1@unisoc.com>
This commit is contained in:
committed by
Treehugger Robot
parent
043fda56b3
commit
1950b66a01
@@ -47,6 +47,7 @@
|
||||
#include <trace/hooks/rwsem.h>
|
||||
#include <trace/hooks/bl_hib.h>
|
||||
#include <trace/hooks/futex.h>
|
||||
#include <trace/hooks/bug.h>
|
||||
|
||||
/*
|
||||
* Export tracepoints that act as a bare tracehook (ie: have no trace event
|
||||
@@ -166,3 +167,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_hibernation_swap);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_save_cpu_resume);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_save_hib_resume_bdev);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alter_futex_plist_add);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_report_bug);
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM bug
|
||||
#define TRACE_INCLUDE_PATH trace/hooks
|
||||
|
||||
#if !defined(_TRACE_HOOK_BUG_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _TRACE_HOOK_BUG_H
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_report_bug,
|
||||
TP_PROTO(const char *file, unsigned int line, unsigned long bugaddr),
|
||||
TP_ARGS(file, line, bugaddr), 1);
|
||||
|
||||
#endif /* _TRACE_HOOK_BUG_H */
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
@@ -49,6 +49,8 @@
|
||||
#include <linux/ftrace.h>
|
||||
#include <linux/context_tracking.h>
|
||||
|
||||
#include <trace/hooks/bug.h>
|
||||
|
||||
extern struct bug_entry __start___bug_table[], __stop___bug_table[];
|
||||
|
||||
static inline unsigned long bug_addr(const struct bug_entry *bug)
|
||||
@@ -207,6 +209,8 @@ static enum bug_trap_type __report_bug(unsigned long bugaddr, struct pt_regs *re
|
||||
pr_crit("Kernel BUG at %pB [verbose debug info unavailable]\n",
|
||||
(void *)bugaddr);
|
||||
|
||||
trace_android_rvh_report_bug(file, line, bugaddr);
|
||||
|
||||
return BUG_TRAP_TYPE_BUG;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user