aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-04-28 11:39:34 -0400
committerSteven Rostedt <rostedt@goodmis.org>2009-04-28 11:39:34 -0400
commitcd891ae0305601bdb4d2e7e85282961c4ff256cd (patch)
treeb425f3c4eba7bd80eb0566d3b233503a9f76cc9d /kernel/trace/trace.c
parent701970b3a83cc639c1ec8fc6f40a7871cb99426f (diff)
tracing: convert ftrace_dump spinlocks to raw
ftrace_dump is used for printing out the contents of the ftrace ring buffer to the console on failure. Currently it uses a spinlock to synchronize the output from multiple failures on different CPUs. This spin lock currently is a normal spinlock and can cause issues with lockdep and lock tracing. This patch converts it to raw since it is for error handling only. The lock is local to the ftrace_dump and is not used by any other infrastructure. [ Impact: prevent ftrace_dump from locking up by internal tracing ] Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index b6183bc9ecae..5d704a41f836 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4114,7 +4114,8 @@ trace_printk_seq(struct trace_seq *s)
4114 4114
4115static void __ftrace_dump(bool disable_tracing) 4115static void __ftrace_dump(bool disable_tracing)
4116{ 4116{
4117 static DEFINE_SPINLOCK(ftrace_dump_lock); 4117 static raw_spinlock_t ftrace_dump_lock =
4118 (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
4118 /* use static because iter can be a bit big for the stack */ 4119 /* use static because iter can be a bit big for the stack */
4119 static struct trace_iterator iter; 4120 static struct trace_iterator iter;
4120 unsigned int old_userobj; 4121 unsigned int old_userobj;
@@ -4123,7 +4124,8 @@ static void __ftrace_dump(bool disable_tracing)
4123 int cnt = 0, cpu; 4124 int cnt = 0, cpu;
4124 4125
4125 /* only one dump */ 4126 /* only one dump */
4126 spin_lock_irqsave(&ftrace_dump_lock, flags); 4127 local_irq_save(flags);
4128 __raw_spin_lock(&ftrace_dump_lock);
4127 if (dump_ran) 4129 if (dump_ran)
4128 goto out; 4130 goto out;
4129 4131
@@ -4195,7 +4197,8 @@ static void __ftrace_dump(bool disable_tracing)
4195 } 4197 }
4196 4198
4197 out: 4199 out:
4198 spin_unlock_irqrestore(&ftrace_dump_lock, flags); 4200 __raw_spin_unlock(&ftrace_dump_lock);
4201 local_irq_restore(flags);
4199} 4202}
4200 4203
4201/* By default: disable tracing after the dump */ 4204/* By default: disable tracing after the dump */