static void blk_tracer_start(struct trace_array *tr)
{
- tracing_reset_online_cpus(tr);
-
mutex_lock(&blk_probe_mutex);
if (atomic_add_return(1, &blk_probes_ref) == 1)
if (blk_register_tracepoints())
return simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
}
+int tracer_init(struct tracer *t, struct trace_array *tr)
+{
+ tracing_reset_online_cpus(tr);
+ return t->init(tr);
+}
+
static int tracing_set_tracer(const char *buf)
{
struct trace_array *tr = &global_trace;
current_trace = t;
if (t->init) {
- ret = t->init(tr);
+ ret = tracer_init(t, tr);
if (ret)
goto out;
}
cpumask_var_t started;
};
+int tracer_init(struct tracer *t, struct trace_array *tr);
int tracing_is_enabled(void);
void trace_wake_up(void);
void tracing_reset(struct trace_array *tr, int cpu);
static int branch_trace_init(struct trace_array *tr)
{
- tracing_reset_online_cpus(tr);
start_branch_trace(tr);
return 0;
}
static void tracing_start_function_trace(void);
static void tracing_stop_function_trace(void);
-static void start_function_trace(struct trace_array *tr)
+static int function_trace_init(struct trace_array *tr)
{
func_trace = tr;
tr->cpu = get_cpu();
- tracing_reset_online_cpus(tr);
put_cpu();
tracing_start_cmdline_record();
tracing_start_function_trace();
-}
-
-static void stop_function_trace(struct trace_array *tr)
-{
- tracing_stop_function_trace();
- tracing_stop_cmdline_record();
-}
-
-static int function_trace_init(struct trace_array *tr)
-{
- start_function_trace(tr);
return 0;
}
static void function_trace_reset(struct trace_array *tr)
{
- stop_function_trace(tr);
+ tracing_stop_function_trace();
+ tracing_stop_cmdline_record();
}
static void function_trace_start(struct trace_array *tr)
&trace_graph_entry);
if (ret)
return ret;
- tracing_reset_online_cpus(tr);
tracing_start_cmdline_record();
return 0;
hw_branch_trace = tr;
register_hotcpu_notifier(&bts_hotcpu_notifier);
- tracing_reset_online_cpus(tr);
bts_trace_start(tr);
return 0;
static int nop_trace_init(struct trace_array *tr)
{
ctx_trace = tr;
- tracing_reset_online_cpus(tr);
start_nop_trace(tr);
return 0;
}
ctx_trace = tr;
}
-static void start_sched_trace(struct trace_array *tr)
-{
- tracing_reset_online_cpus(tr);
- tracing_start_sched_switch_record();
-}
-
static void stop_sched_trace(struct trace_array *tr)
{
tracing_stop_sched_switch_record();
static int sched_switch_trace_init(struct trace_array *tr)
{
ctx_trace = tr;
- start_sched_trace(tr);
+ tracing_start_sched_switch_record();
return 0;
}
ftrace_set_filter(func_name, strlen(func_name), 1);
/* enable tracing */
- ret = trace->init(tr);
+ ret = tracer_init(trace, tr);
if (ret) {
warn_failed_init_tracer(trace, ret);
goto out;
ftrace_enabled = 1;
tracer_enabled = 1;
- ret = trace->init(tr);
+ ret = tracer_init(trace, tr);
if (ret) {
warn_failed_init_tracer(trace, ret);
goto out;
int ret;
/* start the tracing */
- ret = trace->init(tr);
+ ret = tracer_init(trace, tr);
if (ret) {
warn_failed_init_tracer(trace, ret);
return ret;
}
/* start the tracing */
- ret = trace->init(tr);
+ ret = tracer_init(trace, tr);
if (ret) {
warn_failed_init_tracer(trace, ret);
return ret;
}
/* start the tracing */
- ret = trace->init(tr);
+ ret = tracer_init(trace, tr);
if (ret) {
warn_failed_init_tracer(trace, ret);
goto out;
wait_for_completion(&isrt);
/* start the tracing */
- ret = trace->init(tr);
+ ret = tracer_init(trace, tr);
if (ret) {
warn_failed_init_tracer(trace, ret);
return ret;
int ret;
/* start the tracing */
- ret = trace->init(tr);
+ ret = tracer_init(trace, tr);
if (ret) {
warn_failed_init_tracer(trace, ret);
return ret;
int ret;
/* start the tracing */
- ret = trace->init(tr);
+ ret = tracer_init(trace, tr);
if (ret) {
warn_failed_init_tracer(trace, ret);
return 0;
int ret;
/* start the tracing */
- ret = trace->init(tr);
+ ret = tracer_init(trace, tr);
if (ret) {
warn_failed_init_tracer(trace, ret);
return ret;
stop_stack_timer(cpu);
}
-static void start_stack_trace(struct trace_array *tr)
-{
- mutex_lock(&sample_timer_lock);
- tracing_reset_online_cpus(tr);
- start_stack_timers();
- tracer_enabled = 1;
- mutex_unlock(&sample_timer_lock);
-}
-
static void stop_stack_trace(struct trace_array *tr)
{
mutex_lock(&sample_timer_lock);
{
sysprof_trace = tr;
- start_stack_trace(tr);
+ mutex_lock(&sample_timer_lock);
+ start_stack_timers();
+ tracer_enabled = 1;
+ mutex_unlock(&sample_timer_lock);
return 0;
}