{
return t->curr_ret_stack;
}
+
+static inline void pause_graph_tracing(void)
+{
+ atomic_inc(¤t->tracing_graph_pause);
+}
+
+static inline void unpause_graph_tracing(void)
+{
+ atomic_dec(¤t->tracing_graph_pause);
+}
#else
#define __notrace_funcgraph
{
return -1;
}
+
+static inline void pause_graph_tracing(void) { }
+static inline void unpause_graph_tracing(void) { }
#endif
#ifdef CONFIG_TRACING
/* Make sure IRQs see the -1 first: */
barrier();
t->ret_stack = ret_stack_list[start++];
+ atomic_set(&t->tracing_graph_pause, 0);
atomic_set(&t->trace_overrun, 0);
}
} while_each_thread(g, t);
if (!t->ret_stack)
return;
t->curr_ret_stack = -1;
+ atomic_set(&t->tracing_graph_pause, 0);
atomic_set(&t->trace_overrun, 0);
} else
t->ret_stack = NULL;
int trace_vprintk(unsigned long ip, int depth, const char *fmt, va_list args)
{
- /*
- * Raw Spinlock because a normal spinlock would be traced here
- * and append an irrelevant couple spin_lock_irqsave/
- * spin_unlock_irqrestore traced by ftrace around this
- * TRACE_PRINTK trace.
- */
- static raw_spinlock_t trace_buf_lock =
- (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(trace_buf_lock);
static char trace_buf[TRACE_BUF_SIZE];
struct ring_buffer_event *event;
if (unlikely(atomic_read(&data->disabled)))
goto out;
- local_irq_save(flags);
- __raw_spin_lock(&trace_buf_lock);
+ pause_graph_tracing();
+ spin_lock_irqsave(&trace_buf_lock, irq_flags);
len = vsnprintf(trace_buf, TRACE_BUF_SIZE, fmt, args);
len = min(len, TRACE_BUF_SIZE-1);
ring_buffer_unlock_commit(tr->buffer, event, irq_flags);
out_unlock:
- __raw_spin_unlock(&trace_buf_lock);
- local_irq_restore(flags);
-
+ spin_unlock_irqrestore(&trace_buf_lock, irq_flags);
+ unpause_graph_tracing();
out:
preempt_enable_notrace();