Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: zhaolei@cn.fujitsu.com (Zhaolei)
Subject: [ltt-dev] [PATCH 2/1] tracepoints-panic
Date: Thu, 18 Dec 2008 11:02:30 +0800	[thread overview]
Message-ID: <4949BD46.3020806@cn.fujitsu.com> (raw)
In-Reply-To: <4949BD17.2000704@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 <zhaolei at cn.fujitsu.com>
---
 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 <linux/tracepoint.h>
+
+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 <linux/debug_locks.h>
 #include <linux/random.h>
 #include <linux/kallsyms.h>
+#include <trace/panic.h>
+
+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






  reply	other threads:[~2008-12-18  3:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-18  3:01 [ltt-dev] [PATCH 0/2] Add tracepoint of panic and kexec Zhaolei
2008-12-18  3:02 ` Zhaolei [this message]
2008-12-18  4:14   ` [ltt-dev] [PATCH 2/1] tracepoints-panic Mathieu Desnoyers
2008-12-18  5:38     ` Zhaolei
2008-12-18  5:38       ` [ltt-dev] [PATCH v2] add tracepoints of panic and kexec Zhaolei
2008-12-18 18:47         ` Mathieu Desnoyers
2008-12-19  1:36           ` Zhaolei
2009-01-03 14:02             ` Mathieu Desnoyers
2009-01-12  5:55               ` Zhaolei
2009-01-12 16:32                 ` Mathieu Desnoyers
2009-01-16  6:47                   ` Lai Jiangshan
2009-01-16 15:43                     ` Mathieu Desnoyers
2009-01-19  6:29                       ` KOSAKI Motohiro
2009-01-20  2:08                         ` Mathieu Desnoyers
2009-02-19  4:14             ` Mathieu Desnoyers
2009-02-19  5:31               ` Zhaolei
2009-02-19  5:46                 ` Mathieu Desnoyers
2009-02-19  6:13                   ` Mathieu Desnoyers
2009-02-19  6:25                     ` Zhaolei
2008-12-30  1:52           ` [ltt-dev] [PATCH v3 0/1] " Zhaolei
2008-12-30  1:53             ` [ltt-dev] [PATCH v3 1/1] " Zhaolei
2009-01-03 13:45               ` Mathieu Desnoyers
2008-12-18  3:03 ` [ltt-dev] [PATCH 2/2] tracepoints-kexec Zhaolei
2008-12-18  4:19   ` Mathieu Desnoyers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4949BD46.3020806@cn.fujitsu.com \
    --to=zhaolei@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox