diff options
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 12539f72f4a5..c8abbb0c8397 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -623,7 +623,7 @@ static unsigned map_pid_to_cmdline[PID_MAX_DEFAULT+1]; | |||
623 | static unsigned map_cmdline_to_pid[SAVED_CMDLINES]; | 623 | static unsigned map_cmdline_to_pid[SAVED_CMDLINES]; |
624 | static char saved_cmdlines[SAVED_CMDLINES][TASK_COMM_LEN]; | 624 | static char saved_cmdlines[SAVED_CMDLINES][TASK_COMM_LEN]; |
625 | static int cmdline_idx; | 625 | static int cmdline_idx; |
626 | static DEFINE_SPINLOCK(trace_cmdline_lock); | 626 | static raw_spinlock_t trace_cmdline_lock = __RAW_SPIN_LOCK_UNLOCKED; |
627 | 627 | ||
628 | /* temporary disable recording */ | 628 | /* temporary disable recording */ |
629 | static atomic_t trace_record_cmdline_disabled __read_mostly; | 629 | static atomic_t trace_record_cmdline_disabled __read_mostly; |
@@ -735,7 +735,7 @@ static void trace_save_cmdline(struct task_struct *tsk) | |||
735 | * nor do we want to disable interrupts, | 735 | * nor do we want to disable interrupts, |
736 | * so if we miss here, then better luck next time. | 736 | * so if we miss here, then better luck next time. |
737 | */ | 737 | */ |
738 | if (!spin_trylock(&trace_cmdline_lock)) | 738 | if (!__raw_spin_trylock(&trace_cmdline_lock)) |
739 | return; | 739 | return; |
740 | 740 | ||
741 | idx = map_pid_to_cmdline[tsk->pid]; | 741 | idx = map_pid_to_cmdline[tsk->pid]; |
@@ -753,7 +753,7 @@ static void trace_save_cmdline(struct task_struct *tsk) | |||
753 | 753 | ||
754 | memcpy(&saved_cmdlines[idx], tsk->comm, TASK_COMM_LEN); | 754 | memcpy(&saved_cmdlines[idx], tsk->comm, TASK_COMM_LEN); |
755 | 755 | ||
756 | spin_unlock(&trace_cmdline_lock); | 756 | __raw_spin_unlock(&trace_cmdline_lock); |
757 | } | 757 | } |
758 | 758 | ||
759 | char *trace_find_cmdline(int pid) | 759 | char *trace_find_cmdline(int pid) |
@@ -3751,7 +3751,7 @@ static __init int tracer_init_debugfs(void) | |||
3751 | 3751 | ||
3752 | int trace_vprintk(unsigned long ip, int depth, const char *fmt, va_list args) | 3752 | int trace_vprintk(unsigned long ip, int depth, const char *fmt, va_list args) |
3753 | { | 3753 | { |
3754 | static DEFINE_SPINLOCK(trace_buf_lock); | 3754 | static raw_spinlock_t trace_buf_lock = __RAW_SPIN_LOCK_UNLOCKED; |
3755 | static char trace_buf[TRACE_BUF_SIZE]; | 3755 | static char trace_buf[TRACE_BUF_SIZE]; |
3756 | 3756 | ||
3757 | struct ring_buffer_event *event; | 3757 | struct ring_buffer_event *event; |
@@ -3773,7 +3773,8 @@ int trace_vprintk(unsigned long ip, int depth, const char *fmt, va_list args) | |||
3773 | goto out; | 3773 | goto out; |
3774 | 3774 | ||
3775 | pause_graph_tracing(); | 3775 | pause_graph_tracing(); |
3776 | spin_lock_irqsave(&trace_buf_lock, irq_flags); | 3776 | raw_local_irq_save(irq_flags); |
3777 | __raw_spin_lock(&trace_buf_lock); | ||
3777 | len = vsnprintf(trace_buf, TRACE_BUF_SIZE, fmt, args); | 3778 | len = vsnprintf(trace_buf, TRACE_BUF_SIZE, fmt, args); |
3778 | 3779 | ||
3779 | len = min(len, TRACE_BUF_SIZE-1); | 3780 | len = min(len, TRACE_BUF_SIZE-1); |
@@ -3792,7 +3793,8 @@ int trace_vprintk(unsigned long ip, int depth, const char *fmt, va_list args) | |||
3792 | ring_buffer_unlock_commit(tr->buffer, event); | 3793 | ring_buffer_unlock_commit(tr->buffer, event); |
3793 | 3794 | ||
3794 | out_unlock: | 3795 | out_unlock: |
3795 | spin_unlock_irqrestore(&trace_buf_lock, irq_flags); | 3796 | __raw_spin_unlock(&trace_buf_lock); |
3797 | raw_local_irq_restore(irq_flags); | ||
3796 | unpause_graph_tracing(); | 3798 | unpause_graph_tracing(); |
3797 | out: | 3799 | out: |
3798 | preempt_enable_notrace(); | 3800 | preempt_enable_notrace(); |