ANDROID: vendor_hooks: Add vendor hooks for getting printk messages
When sudden reset by watchdog occurs, kernel log is very helpful. But the log has saved structure type in log_buf. So we want to collect the log on runtime to string format at other reserved memory. Bug: 167766040 Change-Id: Ic9686acc7c284e2ab81395fb9cc076fafe142bf9 Signed-off-by: Changki Kim <changki.kim@samsung.com>
This commit is contained in:
@@ -55,3 +55,4 @@ 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);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_printk_store);
|
||||
|
||||
@@ -15,8 +15,13 @@ struct pt_regs;
|
||||
DECLARE_HOOK(android_vh_ipi_stop,
|
||||
TP_PROTO(struct pt_regs *regs),
|
||||
TP_ARGS(regs))
|
||||
|
||||
DECLARE_HOOK(android_vh_printk_store,
|
||||
TP_PROTO(int facility, int level),
|
||||
TP_ARGS(facility, level))
|
||||
#else
|
||||
#define trace_android_vh_ipi_stop(regs)
|
||||
#define trace_android_vh_printk_store(facility, level)
|
||||
#endif
|
||||
|
||||
#endif /* _TRACE_HOOK_DEBUG_H */
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
#include <trace/events/initcall.h>
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/events/printk.h>
|
||||
#undef CREATE_TRACE_POINTS
|
||||
#include <trace/hooks/debug.h>
|
||||
|
||||
#include "console_cmdline.h"
|
||||
#include "braille.h"
|
||||
@@ -2007,6 +2009,7 @@ asmlinkage int vprintk_emit(int facility, int level,
|
||||
pending_output = (curr_log_seq != log_next_seq);
|
||||
logbuf_unlock_irqrestore(flags);
|
||||
|
||||
trace_android_vh_printk_store(facility, level);
|
||||
/* If called from the scheduler, we can not call up(). */
|
||||
if (!in_sched && pending_output) {
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user