public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] tracing: Add sysctl to enable/disable tracing on oops
@ 2009-09-09  1:15 Li Zefan
  2009-09-09  1:15 ` [PATCH 2/2] tracing/events: Add kexec tracepoints Li Zefan
  2009-09-09  1:34 ` [PATCH 1/2] tracing: Add sysctl to enable/disable tracing on oops Steven Rostedt
  0 siblings, 2 replies; 23+ messages in thread
From: Li Zefan @ 2009-09-09  1:15 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Frederic Weisbecker, Steven Rostedt, LKML

Currently we always disable tracing on oops, and this patch
adds a sysctl so one can choose to enable it.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 include/linux/kernel.h     |    2 ++
 kernel/panic.c             |    3 ++-
 kernel/sysctl.c            |   10 ++++++++++
 kernel/trace/ring_buffer.c |    2 ++
 4 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index f61039e..5c4528f 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -516,12 +516,14 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
  * Most likely, you want to use tracing_on/tracing_off.
  */
 #ifdef CONFIG_RING_BUFFER
+extern int trace_on_oops;
 void tracing_on(void);
 void tracing_off(void);
 /* trace_off_permanent stops recording with no way to bring it back */
 void tracing_off_permanent(void);
 int tracing_is_on(void);
 #else
+#define trace_on_oops 0
 static inline void tracing_on(void) { }
 static inline void tracing_off(void) { }
 static inline void tracing_off_permanent(void) { }
diff --git a/kernel/panic.c b/kernel/panic.c
index 512ab73..22ec502 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -301,7 +301,8 @@ int oops_may_print(void)
  */
 void oops_enter(void)
 {
-	tracing_off();
+	if (!trace_on_oops)
+		tracing_off();
 	/* can't trust the integrity of the kernel anymore: */
 	debug_locks_off();
 	do_oops_enter_exit();
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index cdbe8d0..a768c15 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -537,6 +537,16 @@ static struct ctl_table kern_table[] = {
 		.proc_handler	= &stack_trace_sysctl,
 	},
 #endif
+#ifdef CONFIG_RING_BUFFER
+	{
+		.ctl_name	= CTL_UNNUMBERED,
+		.procname	= "trace_on_oops",
+		.data		= &trace_on_oops,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+	},
+#endif
 #ifdef CONFIG_TRACING
 	{
 		.ctl_name	= CTL_UNNUMBERED,
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 454e74e..fc10962 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -155,6 +155,8 @@ static unsigned long ring_buffer_flags __read_mostly = RB_BUFFERS_ON;
 
 #define BUF_PAGE_HDR_SIZE offsetof(struct buffer_data_page, data)
 
+int trace_on_oops;
+
 /**
  * tracing_on - enable all tracing buffers
  *
-- 
1.6.3

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

end of thread, other threads:[~2009-09-09 15:58 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-09  1:15 [PATCH 1/2] tracing: Add sysctl to enable/disable tracing on oops Li Zefan
2009-09-09  1:15 ` [PATCH 2/2] tracing/events: Add kexec tracepoints Li Zefan
2009-09-09  1:20   ` Daniel Walker
2009-09-09  1:26     ` Li Zefan
2009-09-09  4:59       ` Daniel Walker
2009-09-09 11:46         ` Steven Rostedt
2009-09-09 14:12           ` Daniel Walker
2009-09-09 15:19             ` Steven Rostedt
2009-09-09 15:58               ` Daniel Walker
2009-09-09  1:27   ` Eric W. Biederman
2009-09-09  1:39     ` Steven Rostedt
2009-09-09  2:02       ` Eric W. Biederman
2009-09-09  1:34 ` [PATCH 1/2] tracing: Add sysctl to enable/disable tracing on oops Steven Rostedt
2009-09-09  1:37   ` Li Zefan
2009-09-09  1:42     ` Steven Rostedt
2009-09-09  1:47       ` Li Zefan
2009-09-09  2:04         ` Steven Rostedt
2009-09-09  2:33           ` KOSAKI Motohiro
2009-09-09  2:40             ` Li Zefan
2009-09-09  2:53               ` Steven Rostedt
2009-09-09  4:19                 ` KOSAKI Motohiro
2009-09-09 11:48                   ` Steven Rostedt
2009-09-09  3:01               ` KOSAKI Motohiro

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