Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116677
b: refs/heads/master
c: 3ea2e6d
h: refs/heads/master
i:
  116675: 046eb66
v: v3
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Oct 14, 2008
1 parent 8666094 commit 33219b9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bf41a158cacba6ca5fc6407a54e7ad8ce1567e2e
refs/heads/master: 3ea2e6d71aafe35b8aaf89ed711a283815acfae6
10 changes: 2 additions & 8 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,6 @@ ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3)
{
struct trace_array *tr = &global_trace;
struct trace_array_cpu *data;
long disabled;
int cpu;
int pc;

Expand All @@ -850,12 +849,10 @@ ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3)
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();
}

Expand Down Expand Up @@ -2961,7 +2958,6 @@ int trace_vprintk(unsigned long ip, const char *fmt, va_list args)
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)
Expand All @@ -2971,9 +2967,8 @@ int trace_vprintk(unsigned long ip, const char *fmt, va_list args)
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);
Expand All @@ -2999,7 +2994,6 @@ int trace_vprintk(unsigned long ip, const char *fmt, va_list args)
spin_unlock_irqrestore(&trace_buf_lock, flags);

out:
atomic_dec(&data->disabled);
preempt_enable_notrace();

return len;
Expand Down
10 changes: 2 additions & 8 deletions trunk/kernel/trace/trace_sched_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ probe_sched_switch(struct rq *__rq, struct task_struct *prev,
{
struct trace_array_cpu *data;
unsigned long flags;
long disabled;
int cpu;
int pc;

Expand All @@ -41,12 +40,10 @@ probe_sched_switch(struct rq *__rq, struct task_struct *prev,
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);
}

Expand All @@ -55,7 +52,6 @@ probe_sched_wakeup(struct rq *__rq, struct task_struct *wakee)
{
struct trace_array_cpu *data;
unsigned long flags;
long disabled;
int cpu, pc;

if (!likely(tracer_enabled))
Expand All @@ -67,13 +63,11 @@ probe_sched_wakeup(struct rq *__rq, struct task_struct *wakee)
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);
}

Expand Down

0 comments on commit 33219b9

Please sign in to comment.