diff options
author | Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | 2011-03-16 19:05:14 -0400 |
---|---|---|
committer | Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | 2011-03-16 19:05:14 -0400 |
commit | c08d27b6ee8b74745cf38ba1bfa3230cbbb5788d (patch) | |
tree | 36f371c9ddcf99d58faf317d0a0c594f4b08131e /kernel | |
parent | 554a96e3526699f5b5dd20e54d3ce5ae663e3d86 (diff) |
lttng-instrumentation-panic
LTTng instrumentation panic
Instrumentation of following panic and kexec related events are added:
panic
kernel_kexec
crash_kexec
It is useful for build flight-recorder program based on lttng infrastructure.
From: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/kexec.c | 8 | ||||
-rw-r--r-- | kernel/panic.c | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/kernel/kexec.c b/kernel/kexec.c index ec19b92c7eb..779f0031929 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c @@ -33,6 +33,7 @@ #include <linux/vmalloc.h> #include <linux/swap.h> #include <linux/kmsg_dump.h> +#include <trace/kernel.h> #include <asm/page.h> #include <asm/uaccess.h> @@ -40,6 +41,9 @@ #include <asm/system.h> #include <asm/sections.h> +DEFINE_TRACE(kernel_kernel_kexec); +DEFINE_TRACE(kernel_crash_kexec); + /* Per cpu memory for storing cpu states in case of system crash. */ note_buf_t __percpu *crash_notes; @@ -1066,6 +1070,8 @@ asmlinkage long compat_sys_kexec_load(unsigned long entry, void crash_kexec(struct pt_regs *regs) { + trace_kernel_crash_kexec(kexec_crash_image, regs); + /* Take the kexec_mutex here to prevent sys_kexec_load * running on one cpu from replacing the crash kernel * we are using after a panic on a different cpu. @@ -1495,6 +1501,8 @@ int kernel_kexec(void) { int error = 0; + trace_kernel_kernel_kexec(kexec_image); + if (!mutex_trylock(&kexec_mutex)) return -EBUSY; if (!kexec_image) { diff --git a/kernel/panic.c b/kernel/panic.c index 991bb87a170..3fd05f5708c 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -23,6 +23,9 @@ #include <linux/init.h> #include <linux/nmi.h> #include <linux/dmi.h> +#include <trace/kernel.h> + +DEFINE_TRACE(kernel_panic); #define PANIC_TIMER_STEP 100 #define PANIC_BLINK_SPD 18 @@ -64,6 +67,10 @@ NORET_TYPE void panic(const char * fmt, ...) long i, i_next = 0; int state = 0; + va_start(args, fmt); + trace_kernel_panic(fmt, args); + va_end(args); + /* * It's possible to come here directly from a panic-assertion and * not have preempt disabled. Some functions called from here want |