From mboxrd@z Thu Jan 1 00:00:00 1970 From: mathieu.desnoyers@polymtl.ca (Mathieu Desnoyers) Date: Wed, 17 Dec 2008 23:14:02 -0500 Subject: [ltt-dev] [PATCH 2/1] tracepoints-panic In-Reply-To: <4949BD46.3020806@cn.fujitsu.com> References: <4949BD17.2000704@cn.fujitsu.com> <4949BD46.3020806@cn.fujitsu.com> Message-ID: <20081218041402.GA21563@Krystal> * Zhaolei (zhaolei at cn.fujitsu.com) wrote: > 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)); > + Interesting idea. Maybe kernel_panic would be more appropriate, in include/trace/kernel.h ? Mathieu > +#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 > > -- Mathieu Desnoyers OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68