From mboxrd@z Thu Jan 1 00:00:00 1970 From: zhaolei@cn.fujitsu.com (Zhaolei) Date: Thu, 18 Dec 2008 11:02:30 +0800 Subject: [ltt-dev] [PATCH 2/1] tracepoints-panic In-Reply-To: <4949BD17.2000704@cn.fujitsu.com> References: <4949BD17.2000704@cn.fujitsu.com> Message-ID: <4949BD46.3020806@cn.fujitsu.com> Instrumentation of panic related events : now include panic event only. It is useful for build flight-recorder program based on lttng infrastructure. Signed-off-by: Zhao lei --- include/trace/panic.h | 10 ++++++++++ kernel/panic.c | 7 +++++++ 2 files changed, 17 insertions(+), 0 deletions(-) create mode 100644 include/trace/panic.h diff --git a/include/trace/panic.h b/include/trace/panic.h new file mode 100644 index 0000000..eede4ca --- /dev/null +++ b/include/trace/panic.h @@ -0,0 +1,10 @@ +#ifndef _TRACE_PANIC_H +#define _TRACE_PANIC_H + +#include + +DECLARE_TRACE(panic_panic, + TPPROTO(const char *fmt, va_list args), + TPARGS(fmt, args)); + +#endif diff --git a/kernel/panic.c b/kernel/panic.c index 12c5a0a..33b4440 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -21,6 +21,9 @@ #include #include #include +#include + +DEFINE_TRACE(panic_panic); int panic_on_oops; int tainted; @@ -68,6 +71,10 @@ NORET_TYPE void panic(const char * fmt, ...) unsigned long caller = (unsigned long) __builtin_return_address(0); #endif + va_start(args, fmt); + trace_panic_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 -- 1.5.5.3