[ltt-dev] [PATCH v4 2/2] Add marker interface for panic and kexec related events

Zhaolei zhaolei at cn.fujitsu.com
Thu Feb 19 04:25:53 EST 2009


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






More information about the lttng-dev mailing list