Commit cd891ae0 authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt

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: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 701970b3
...@@ -4114,7 +4114,8 @@ trace_printk_seq(struct trace_seq *s) ...@@ -4114,7 +4114,8 @@ trace_printk_seq(struct trace_seq *s)
static void __ftrace_dump(bool disable_tracing) static void __ftrace_dump(bool disable_tracing)
{ {
static DEFINE_SPINLOCK(ftrace_dump_lock); static raw_spinlock_t ftrace_dump_lock =
(raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
/* use static because iter can be a bit big for the stack */ /* use static because iter can be a bit big for the stack */
static struct trace_iterator iter; static struct trace_iterator iter;
unsigned int old_userobj; unsigned int old_userobj;
...@@ -4123,7 +4124,8 @@ static void __ftrace_dump(bool disable_tracing) ...@@ -4123,7 +4124,8 @@ static void __ftrace_dump(bool disable_tracing)
int cnt = 0, cpu; int cnt = 0, cpu;
/* only one dump */ /* only one dump */
spin_lock_irqsave(&ftrace_dump_lock, flags); local_irq_save(flags);
__raw_spin_lock(&ftrace_dump_lock);
if (dump_ran) if (dump_ran)
goto out; goto out;
...@@ -4195,7 +4197,8 @@ static void __ftrace_dump(bool disable_tracing) ...@@ -4195,7 +4197,8 @@ static void __ftrace_dump(bool disable_tracing)
} }
out: out:
spin_unlock_irqrestore(&ftrace_dump_lock, flags); __raw_spin_unlock(&ftrace_dump_lock);
local_irq_restore(flags);
} }
/* By default: disable tracing after the dump */ /* By default: disable tracing after the dump */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment