Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [ltt-dev] [PATCH v4 0/2] add tracepoints and markers for panic and kexec event
@ 2009-02-19  9:22 Zhaolei
  2009-02-19  9:24 ` [ltt-dev] [PATCH v4 1/2] add tracepoints " Zhaolei
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zhaolei @ 2009-02-19  9:22 UTC (permalink / raw)


Hello,

Panic and kexec related events are useful for flight-recorder.
I updated this patch to top of lttng git tree(2.6.29-rc3-lttng-0.92).
And add marker interface to these tracepoints.

Changelog:
v4: (based on v2)
    Update patch to top of lttng git tree(2.6.29-rc3-lttng-0.92).
    Add marker interface to these tracepoints.
v3: Move tracepoint header from include/trace/kernel.h
    to include/trace/notifier.h(it is wrong, discard)
v2: Move tracepoint header from include/trace/panic(kexec).h
    to include/trace/kernel.h
v1: Add panic and kexec related tracepoints.

B.R.
Zhaolei





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ltt-dev] [PATCH v4 1/2] add tracepoints for panic and kexec event
  2009-02-19  9:22 [ltt-dev] [PATCH v4 0/2] add tracepoints and markers for panic and kexec event Zhaolei
@ 2009-02-19  9:24 ` Zhaolei
  2009-02-19  9:25 ` [ltt-dev] [PATCH v4 2/2] Add marker interface for panic and kexec related events Zhaolei
  2009-03-14  3:14 ` [ltt-dev] [PATCH v4 0/2] add tracepoints and markers for panic and kexec event Mathieu Desnoyers
  2 siblings, 0 replies; 4+ messages in thread
From: Zhaolei @ 2009-02-19  9:24 UTC (permalink / raw)


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.

Signed-off-by: Zhao Lei <zhaolei at cn.fujitsu.com>
---
 include/trace/kernel.h |   10 ++++++++++
 kernel/kexec.c         |    8 ++++++++
 kernel/panic.c         |    7 +++++++
 3 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/include/trace/kernel.h b/include/trace/kernel.h
index d2c3320..06d585f 100644
--- a/include/trace/kernel.h
+++ b/include/trace/kernel.h
@@ -2,6 +2,7 @@
 #define _TRACE_KERNEL_H
 
 #include <linux/tracepoint.h>
+#include <linux/kexec.h>
 
 DECLARE_TRACE(kernel_printk,
 	TPPROTO(unsigned long retaddr),
@@ -15,5 +16,14 @@ DECLARE_TRACE(kernel_module_free,
 DECLARE_TRACE(kernel_module_load,
 	TPPROTO(struct module *mod),
 	TPARGS(mod));
+DECLARE_TRACE(kernel_panic,
+	TPPROTO(const char *fmt, va_list args),
+	TPARGS(fmt, args));
+DECLARE_TRACE(kernel_kernel_kexec,
+	TPPROTO(struct kimage *image),
+	TPARGS(image));
+DECLARE_TRACE(kernel_crash_kexec,
+	TPPROTO(struct kimage *image, struct pt_regs *regs),
+	TPARGS(image, regs));
 
 #endif
diff --git a/kernel/kexec.c b/kernel/kexec.c
index 8a6d7b0..5c6d9e4 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -31,6 +31,7 @@
 #include <linux/cpu.h>
 #include <linux/console.h>
 #include <linux/vmalloc.h>
+#include <trace/kernel.h>
 
 #include <asm/page.h>
 #include <asm/uaccess.h>
@@ -38,6 +39,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* crash_notes;
 
@@ -1062,6 +1066,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.
@@ -1430,6 +1436,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 2a2ff36..66092cb 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -22,6 +22,9 @@
 #include <linux/random.h>
 #include <linux/kallsyms.h>
 #include <linux/dmi.h>
+#include <trace/kernel.h>
+
+DEFINE_TRACE(kernel_panic);
 
 int panic_on_oops;
 static unsigned long tainted_mask;
@@ -62,6 +65,10 @@ NORET_TYPE void panic(const char * fmt, ...)
 	unsigned long caller = (unsigned long) __builtin_return_address(0);
 #endif
 
+	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
-- 
1.5.5.3






^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ltt-dev] [PATCH v4 2/2] Add marker interface for panic and kexec related events
  2009-02-19  9:22 [ltt-dev] [PATCH v4 0/2] add tracepoints and markers for panic and kexec event Zhaolei
  2009-02-19  9:24 ` [ltt-dev] [PATCH v4 1/2] add tracepoints " Zhaolei
@ 2009-02-19  9:25 ` Zhaolei
  2009-03-14  3:14 ` [ltt-dev] [PATCH v4 0/2] add tracepoints and markers for panic and kexec event Mathieu Desnoyers
  2 siblings, 0 replies; 4+ messages in thread
From: Zhaolei @ 2009-02-19  9:25 UTC (permalink / raw)


By this patch, people can trace there events by marker interface.
LTTng can also trace there events.

Signed-off-by: Zhao Lei <zhaolei at cn.fujitsu.com>
---
 ltt/probes/kernel-trace.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/ltt/probes/kernel-trace.c b/ltt/probes/kernel-trace.c
index 89552cb..eb03755 100644
--- a/ltt/probes/kernel-trace.c
+++ b/ltt/probes/kernel-trace.c
@@ -395,6 +395,27 @@ void probe_kernel_module_load(struct module *mod)
 }
 #endif
 
+void probe_kernel_panic(const char *fmt, va_list args)
+{
+	char info[64];
+	vsnprintf(info, sizeof(info), fmt, args);
+	trace_mark_tp(kernel, panic, kernel_panic, probe_kernel_panic,
+		"info %s", info);
+}
+
+void probe_kernel_kernel_kexec(struct kimage *image)
+{
+	trace_mark_tp(kernel, kernel_kexec, kernel_kernel_kexec,
+		probe_kernel_kernel_kexec, "image %p", image);
+}
+
+void probe_kernel_crash_kexec(struct kimage *image, struct pt_regs *regs)
+{
+	trace_mark_tp(kernel, crash_kexec, kernel_crash_kexec,
+		probe_kernel_crash_kexec, "image %p ip %p", image,
+		regs ? (void *)instruction_pointer(regs) : NULL);
+}
+
 /* kernel_page_fault_entry specialized tracepoint probe */
 
 void probe_kernel_page_fault_entry(struct pt_regs *regs, int trapnr,
-- 
1.5.5.3






^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ltt-dev] [PATCH v4 0/2] add tracepoints and markers for panic and kexec event
  2009-02-19  9:22 [ltt-dev] [PATCH v4 0/2] add tracepoints and markers for panic and kexec event Zhaolei
  2009-02-19  9:24 ` [ltt-dev] [PATCH v4 1/2] add tracepoints " Zhaolei
  2009-02-19  9:25 ` [ltt-dev] [PATCH v4 2/2] Add marker interface for panic and kexec related events Zhaolei
@ 2009-03-14  3:14 ` Mathieu Desnoyers
  2 siblings, 0 replies; 4+ messages in thread
From: Mathieu Desnoyers @ 2009-03-14  3:14 UTC (permalink / raw)


* Zhaolei (zhaolei at cn.fujitsu.com) wrote:
> Hello,
> 

Hi Zhaolei,

I lagged a bit behind my mailbox those last weeks. This patchset is good
to go, I'm merging it.

Thanks !

Mathieu

> Panic and kexec related events are useful for flight-recorder.
> I updated this patch to top of lttng git tree(2.6.29-rc3-lttng-0.92).
> And add marker interface to these tracepoints.
> 
> Changelog:
> v4: (based on v2)
>     Update patch to top of lttng git tree(2.6.29-rc3-lttng-0.92).
>     Add marker interface to these tracepoints.
> v3: Move tracepoint header from include/trace/kernel.h
>     to include/trace/notifier.h(it is wrong, discard)
> v2: Move tracepoint header from include/trace/panic(kexec).h
>     to include/trace/kernel.h
> v1: Add panic and kexec related tracepoints.
> 
> B.R.
> Zhaolei
> 
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-03-14  3:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-19  9:22 [ltt-dev] [PATCH v4 0/2] add tracepoints and markers for panic and kexec event Zhaolei
2009-02-19  9:24 ` [ltt-dev] [PATCH v4 1/2] add tracepoints " Zhaolei
2009-02-19  9:25 ` [ltt-dev] [PATCH v4 2/2] Add marker interface for panic and kexec related events Zhaolei
2009-03-14  3:14 ` [ltt-dev] [PATCH v4 0/2] add tracepoints and markers for panic and kexec event Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox