mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
kexec: add dmesg log symbols to /proc/vmcoreinfo lists
It would be nice to be able to extract the dmesg log from a vmcore file without needing to keep the debug symbols for the running kernel handy all the time. We have a facility to do this in /proc/vmcore. This patch adds the log_buf and log_end symbols to the vmcoreinfo area so that tools (like makedumpfile) can easily extract the dmesg logs from a vmcore image. [[email protected]: several fixes and cleanups] [[email protected]: fix unused log_buf_kexec_setup()] [[email protected]: build fix] Signed-off-by: Neil Horman <[email protected]> Cc: Simon Horman <[email protected]> Acked-by: Vivek Goyal <[email protected]> Cc: Neil Horman <[email protected]> Cc: Simon Horman <[email protected]> Cc: Vivek Goyal <[email protected]> Cc: Randy Dunlap <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
23c36c1aec
commit
04d491ab2a
3 changed files with 24 additions and 0 deletions
|
|
@ -32,6 +32,7 @@
|
|||
#include <linux/security.h>
|
||||
#include <linux/bootmem.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/kexec.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
|
|
@ -135,6 +136,24 @@ static char *log_buf = __log_buf;
|
|||
static int log_buf_len = __LOG_BUF_LEN;
|
||||
static unsigned logged_chars; /* Number of chars produced since last read+clear operation */
|
||||
|
||||
#ifdef CONFIG_KEXEC
|
||||
/*
|
||||
* This appends the listed symbols to /proc/vmcoreinfo
|
||||
*
|
||||
* /proc/vmcoreinfo is used by various utiilties, like crash and makedumpfile to
|
||||
* obtain access to symbols that are otherwise very difficult to locate. These
|
||||
* symbols are specifically used so that utilities can access and extract the
|
||||
* dmesg log from a vmcore file after a crash.
|
||||
*/
|
||||
void log_buf_kexec_setup(void)
|
||||
{
|
||||
VMCOREINFO_SYMBOL(log_buf);
|
||||
VMCOREINFO_SYMBOL(log_end);
|
||||
VMCOREINFO_SYMBOL(log_buf_len);
|
||||
VMCOREINFO_SYMBOL(logged_chars);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int __init log_buf_len_setup(char *str)
|
||||
{
|
||||
unsigned size = memparse(str, &str);
|
||||
|
|
|
|||
Loading…
Reference in a new issue