From 250af0997c71a4e45e07a35321fcd0db1c7a61c0 Mon Sep 17 00:00:00 2001 From: Neil Horman Date: Thu, 2 Apr 2009 16:58:57 -0700 Subject: [PATCH] --- yaml --- r: 139727 b: refs/heads/master c: 04d491ab2a53008a1aa98ac09561768c7f3adda3 h: refs/heads/master i: 139725: db02602779c8b121edf370628d518e22772b7aba 139723: 21438b203f2e7a6c23846f8f421564b97dc65082 139719: 60ad9d9691113a036594d735fea8479391bbc776 139711: bfbdd06ae4d97601d57b5e483d1fb3e04207b0c0 v: v3 --- [refs] | 2 +- trunk/include/linux/kernel.h | 4 ++++ trunk/kernel/kexec.c | 1 + trunk/kernel/printk.c | 19 +++++++++++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index e56d9c0d8481..97ed9579c600 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 23c36c1aec895fd52d7dd8cd3ce4bbce43c969fd +refs/heads/master: 04d491ab2a53008a1aa98ac09561768c7f3adda3 diff --git a/trunk/include/linux/kernel.h b/trunk/include/linux/kernel.h index e720b0da7751..556d781e69fe 100644 --- a/trunk/include/linux/kernel.h +++ b/trunk/include/linux/kernel.h @@ -242,6 +242,7 @@ extern struct ratelimit_state printk_ratelimit_state; extern int printk_ratelimit(void); extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, unsigned int interval_msec); +void log_buf_kexec_setup(void); #else static inline int vprintk(const char *s, va_list args) __attribute__ ((format (printf, 1, 0))); @@ -253,6 +254,9 @@ static inline int printk_ratelimit(void) { return 0; } static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ unsigned int interval_msec) \ { return false; } +static inline void log_buf_kexec_setup(void) +{ +} #endif extern int printk_needs_cpu(int cpu); diff --git a/trunk/kernel/kexec.c b/trunk/kernel/kexec.c index 93eed85fe017..589832aac41f 100644 --- a/trunk/kernel/kexec.c +++ b/trunk/kernel/kexec.c @@ -1409,6 +1409,7 @@ static int __init crash_save_vmcoreinfo_init(void) VMCOREINFO_OFFSET(list_head, prev); VMCOREINFO_OFFSET(vm_struct, addr); VMCOREINFO_LENGTH(zone.free_area, MAX_ORDER); + log_buf_kexec_setup(); VMCOREINFO_LENGTH(free_area.free_list, MIGRATE_TYPES); VMCOREINFO_NUMBER(NR_FREE_PAGES); VMCOREINFO_NUMBER(PG_lru); diff --git a/trunk/kernel/printk.c b/trunk/kernel/printk.c index e3602d0755b0..a5f61a9acedb 100644 --- a/trunk/kernel/printk.c +++ b/trunk/kernel/printk.c @@ -32,6 +32,7 @@ #include #include #include +#include #include @@ -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);