Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100556
b: refs/heads/master
c: 4902f88
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt authored and Thomas Gleixner committed May 26, 2008
1 parent 06e8d3d commit 75f74fb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 27 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: 19384c0314342222b18d4c7f09cdce1ca74dfd2a
refs/heads/master: 4902f8849da6d2805bd291551a6dfd48f1b4f604
27 changes: 25 additions & 2 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,30 @@ tracing_sched_wakeup_trace(struct trace_array *tr,
trace_wake_up();
}

void
ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3)
{
struct trace_array *tr = &global_trace;
struct trace_array_cpu *data;
unsigned long flags;
long disabled;
int cpu;

if (tracing_disabled || current_trace == &no_tracer || !tr->ctrl)
return;

local_irq_save(flags);
cpu = raw_smp_processor_id();
data = tr->data[cpu];
disabled = atomic_inc_return(&data->disabled);

if (likely(disabled == 1))
__trace_special(tr, data, arg1, arg2, arg3);

atomic_dec(&data->disabled);
local_irq_restore(flags);
}

#ifdef CONFIG_FTRACE
static void
function_trace_call(unsigned long ip, unsigned long parent_ip)
Expand Down Expand Up @@ -2941,8 +2965,6 @@ __init static int tracer_alloc_buffers(void)
int ret = -ENOMEM;
int i;

global_trace.ctrl = tracer_enabled;

/* TODO: make the number of buffers hot pluggable with CPUS */
tracing_nr_buffers = num_possible_cpus();
tracing_buffer_mask = cpu_possible_map;
Expand Down Expand Up @@ -3012,6 +3034,7 @@ __init static int tracer_alloc_buffers(void)
current_trace = &no_tracer;

/* All seems OK, enable tracing */
global_trace.ctrl = tracer_enabled;
tracing_disabled = 0;

return 0;
Expand Down
24 changes: 0 additions & 24 deletions trunk/kernel/trace/trace_sched_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,30 +125,6 @@ wake_up_callback(void *probe_data, void *call_data,
wakeup_func(probe_data, __rq, task, curr);
}

void
ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3)
{
struct trace_array *tr = ctx_trace;
struct trace_array_cpu *data;
unsigned long flags;
long disabled;
int cpu;

if (!tracer_enabled)
return;

local_irq_save(flags);
cpu = raw_smp_processor_id();
data = tr->data[cpu];
disabled = atomic_inc_return(&data->disabled);

if (likely(disabled == 1))
__trace_special(tr, data, arg1, arg2, arg3);

atomic_dec(&data->disabled);
local_irq_restore(flags);
}

static void sched_switch_reset(struct trace_array *tr)
{
int cpu;
Expand Down

0 comments on commit 75f74fb

Please sign in to comment.