{
struct trace_array *tr = &global_trace;
struct trace_array_cpu *data;
- long disabled;
int cpu;
int pc;
preempt_disable_notrace();
cpu = raw_smp_processor_id();
data = tr->data[cpu];
- disabled = atomic_inc_return(&data->disabled);
- if (likely(disabled == 1))
+ if (likely(!atomic_read(&data->disabled)))
ftrace_trace_special(tr, data, arg1, arg2, arg3, pc);
- atomic_dec(&data->disabled);
preempt_enable_notrace();
}
struct trace_array_cpu *data;
struct print_entry *entry;
unsigned long flags, irq_flags;
- long disabled;
int cpu, len = 0, size, pc;
if (!tr->ctrl || tracing_disabled)
preempt_disable_notrace();
cpu = raw_smp_processor_id();
data = tr->data[cpu];
- disabled = atomic_inc_return(&data->disabled);
- if (unlikely(disabled != 1))
+ if (unlikely(atomic_read(&data->disabled)))
goto out;
spin_lock_irqsave(&trace_buf_lock, flags);
spin_unlock_irqrestore(&trace_buf_lock, flags);
out:
- atomic_dec(&data->disabled);
preempt_enable_notrace();
return len;
{
struct trace_array_cpu *data;
unsigned long flags;
- long disabled;
int cpu;
int pc;
local_irq_save(flags);
cpu = raw_smp_processor_id();
data = ctx_trace->data[cpu];
- disabled = atomic_inc_return(&data->disabled);
- if (likely(disabled == 1))
+ if (likely(!atomic_read(&data->disabled)))
tracing_sched_switch_trace(ctx_trace, data, prev, next, flags, pc);
- atomic_dec(&data->disabled);
local_irq_restore(flags);
}
{
struct trace_array_cpu *data;
unsigned long flags;
- long disabled;
int cpu, pc;
if (!likely(tracer_enabled))
local_irq_save(flags);
cpu = raw_smp_processor_id();
data = ctx_trace->data[cpu];
- disabled = atomic_inc_return(&data->disabled);
- if (likely(disabled == 1))
+ if (likely(!atomic_read(&data->disabled)))
tracing_sched_wakeup_trace(ctx_trace, data, wakee, current,
flags, pc);
- atomic_dec(&data->disabled);
local_irq_restore(flags);
}