aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
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 */