register_tracer(&nop_trace);
#ifdef CONFIG_BOOT_TRACER
+ /* We don't want to launch sched_switch tracer yet */
+ global_trace.ctrl = 0;
register_tracer(&boot_tracer);
current_trace = &boot_tracer;
current_trace->init(&global_trace);
unsigned long parent_ip;
};
extern struct tracer boot_tracer;
+extern struct tracer sched_switch_trace; /* Used by the boot tracer */
/*
* Context switch trace entry - which task (and prio) we switched from/to:
void enable_boot_trace(void)
{
+ if (pre_initcalls_finished)
+ tracing_start_cmdline_record();
}
void disable_boot_trace(void)
{
+ if (pre_initcalls_finished)
+ tracing_stop_cmdline_record();
}
void reset_boot_trace(struct trace_array *tr)
for_each_cpu_mask(cpu, cpu_possible_map)
tracing_reset(tr, cpu);
+
+ sched_switch_trace.init(tr);
}
static void boot_trace_ctrl_update(struct trace_array *tr)
long ref;
mutex_lock(&tracepoint_mutex);
+ tracer_enabled = 1;
ref = atomic_inc_return(&sched_ref);
if (ref == 1)
tracing_sched_register();
long ref;
mutex_lock(&tracepoint_mutex);
+ tracer_enabled = 0;
ref = atomic_dec_and_test(&sched_ref);
if (ref)
tracing_sched_unregister();
{
sched_switch_reset(tr);
tracing_start_cmdline_record();
- tracer_enabled = 1;
}
static void stop_sched_trace(struct trace_array *tr)
{
- tracer_enabled = 0;
tracing_stop_cmdline_record();
}
stop_sched_trace(tr);
}
-static struct tracer sched_switch_trace __read_mostly =
+struct tracer sched_switch_trace __read_mostly =
{
.name = "sched_switch",
.init = sched_switch_trace_init,