ftrace: remove ctrl_update method

Impact: Remove the ctrl_update tracer method

With the new quick start/stop method of tracing, the ctrl_update
method is out of date.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Steven Rostedt 2008-11-07 22:36:02 -05:00 committed by Ingo Molnar
parent 49833fc232
commit bbf5b1a0ce
11 changed files with 29 additions and 101 deletions

View File

@ -3357,8 +3357,6 @@ __init static int tracer_alloc_buffers(void)
register_tracer(&nop_trace); register_tracer(&nop_trace);
#ifdef CONFIG_BOOT_TRACER #ifdef CONFIG_BOOT_TRACER
/* We don't want to launch sched_switch tracer yet */
global_trace.ctrl = 0;
register_tracer(&boot_tracer); register_tracer(&boot_tracer);
current_trace = &boot_tracer; current_trace = &boot_tracer;
current_trace->init(&global_trace); current_trace->init(&global_trace);

View File

@ -244,7 +244,6 @@ struct tracer {
ssize_t (*read)(struct trace_iterator *iter, ssize_t (*read)(struct trace_iterator *iter,
struct file *filp, char __user *ubuf, struct file *filp, char __user *ubuf,
size_t cnt, loff_t *ppos); size_t cnt, loff_t *ppos);
void (*ctrl_update)(struct trace_array *tr);
#ifdef CONFIG_FTRACE_STARTUP_TEST #ifdef CONFIG_FTRACE_STARTUP_TEST
int (*selftest)(struct tracer *trace, int (*selftest)(struct tracer *trace,
struct trace_array *tr); struct trace_array *tr);

View File

@ -58,14 +58,6 @@ static void boot_trace_init(struct trace_array *tr)
tracing_sched_switch_assign_trace(tr); tracing_sched_switch_assign_trace(tr);
} }
static void boot_trace_ctrl_update(struct trace_array *tr)
{
if (tr->ctrl)
enable_boot_trace();
else
disable_boot_trace();
}
static enum print_line_t initcall_print_line(struct trace_iterator *iter) static enum print_line_t initcall_print_line(struct trace_iterator *iter)
{ {
int ret; int ret;
@ -102,7 +94,6 @@ struct tracer boot_tracer __read_mostly =
.name = "initcall", .name = "initcall",
.init = boot_trace_init, .init = boot_trace_init,
.reset = reset_boot_trace, .reset = reset_boot_trace,
.ctrl_update = boot_trace_ctrl_update,
.print_line = initcall_print_line, .print_line = initcall_print_line,
}; };

View File

@ -54,14 +54,6 @@ static void function_trace_reset(struct trace_array *tr)
stop_function_trace(tr); stop_function_trace(tr);
} }
static void function_trace_ctrl_update(struct trace_array *tr)
{
if (tr->ctrl)
start_function_trace(tr);
else
stop_function_trace(tr);
}
static void function_trace_start(struct trace_array *tr) static void function_trace_start(struct trace_array *tr)
{ {
function_reset(tr); function_reset(tr);
@ -73,7 +65,6 @@ static struct tracer function_trace __read_mostly =
.init = function_trace_init, .init = function_trace_init,
.reset = function_trace_reset, .reset = function_trace_reset,
.start = function_trace_start, .start = function_trace_start,
.ctrl_update = function_trace_ctrl_update,
#ifdef CONFIG_FTRACE_SELFTEST #ifdef CONFIG_FTRACE_SELFTEST
.selftest = trace_selftest_startup_function, .selftest = trace_selftest_startup_function,
#endif #endif

View File

@ -394,14 +394,6 @@ static void irqsoff_tracer_reset(struct trace_array *tr)
stop_irqsoff_tracer(tr); stop_irqsoff_tracer(tr);
} }
static void irqsoff_tracer_ctrl_update(struct trace_array *tr)
{
if (tr->ctrl)
start_irqsoff_tracer(tr);
else
stop_irqsoff_tracer(tr);
}
static void irqsoff_tracer_start(struct trace_array *tr) static void irqsoff_tracer_start(struct trace_array *tr)
{ {
tracer_enabled = 1; tracer_enabled = 1;
@ -442,7 +434,6 @@ static struct tracer irqsoff_tracer __read_mostly =
.stop = irqsoff_tracer_stop, .stop = irqsoff_tracer_stop,
.open = irqsoff_tracer_open, .open = irqsoff_tracer_open,
.close = irqsoff_tracer_close, .close = irqsoff_tracer_close,
.ctrl_update = irqsoff_tracer_ctrl_update,
.print_max = 1, .print_max = 1,
#ifdef CONFIG_FTRACE_SELFTEST #ifdef CONFIG_FTRACE_SELFTEST
.selftest = trace_selftest_startup_irqsoff, .selftest = trace_selftest_startup_irqsoff,
@ -470,7 +461,6 @@ static struct tracer preemptoff_tracer __read_mostly =
.stop = irqsoff_tracer_stop, .stop = irqsoff_tracer_stop,
.open = irqsoff_tracer_open, .open = irqsoff_tracer_open,
.close = irqsoff_tracer_close, .close = irqsoff_tracer_close,
.ctrl_update = irqsoff_tracer_ctrl_update,
.print_max = 1, .print_max = 1,
#ifdef CONFIG_FTRACE_SELFTEST #ifdef CONFIG_FTRACE_SELFTEST
.selftest = trace_selftest_startup_preemptoff, .selftest = trace_selftest_startup_preemptoff,
@ -500,7 +490,6 @@ static struct tracer preemptirqsoff_tracer __read_mostly =
.stop = irqsoff_tracer_stop, .stop = irqsoff_tracer_stop,
.open = irqsoff_tracer_open, .open = irqsoff_tracer_open,
.close = irqsoff_tracer_close, .close = irqsoff_tracer_close,
.ctrl_update = irqsoff_tracer_ctrl_update,
.print_max = 1, .print_max = 1,
#ifdef CONFIG_FTRACE_SELFTEST #ifdef CONFIG_FTRACE_SELFTEST
.selftest = trace_selftest_startup_preemptirqsoff, .selftest = trace_selftest_startup_preemptirqsoff,

View File

@ -49,15 +49,10 @@ static void mmio_trace_reset(struct trace_array *tr)
mmio_trace_array = NULL; mmio_trace_array = NULL;
} }
static void mmio_trace_ctrl_update(struct trace_array *tr) static void mmio_trace_start(struct trace_array *tr)
{ {
pr_debug("in %s\n", __func__); pr_debug("in %s\n", __func__);
if (tr->ctrl) { mmio_reset_data(tr);
mmio_reset_data(tr);
enable_mmiotrace();
} else {
disable_mmiotrace();
}
} }
static int mmio_print_pcidev(struct trace_seq *s, const struct pci_dev *dev) static int mmio_print_pcidev(struct trace_seq *s, const struct pci_dev *dev)
@ -298,10 +293,10 @@ static struct tracer mmio_tracer __read_mostly =
.name = "mmiotrace", .name = "mmiotrace",
.init = mmio_trace_init, .init = mmio_trace_init,
.reset = mmio_trace_reset, .reset = mmio_trace_reset,
.start = mmio_trace_start,
.pipe_open = mmio_pipe_open, .pipe_open = mmio_pipe_open,
.close = mmio_close, .close = mmio_close,
.read = mmio_read, .read = mmio_read,
.ctrl_update = mmio_trace_ctrl_update,
.print_line = mmio_print_line, .print_line = mmio_print_line,
}; };

View File

@ -42,21 +42,11 @@ static void nop_trace_reset(struct trace_array *tr)
stop_nop_trace(tr); stop_nop_trace(tr);
} }
static void nop_trace_ctrl_update(struct trace_array *tr)
{
/* When starting a new trace, reset the buffers */
if (tr->ctrl)
start_nop_trace(tr);
else
stop_nop_trace(tr);
}
struct tracer nop_trace __read_mostly = struct tracer nop_trace __read_mostly =
{ {
.name = "nop", .name = "nop",
.init = nop_trace_init, .init = nop_trace_init,
.reset = nop_trace_reset, .reset = nop_trace_reset,
.ctrl_update = nop_trace_ctrl_update,
#ifdef CONFIG_FTRACE_SELFTEST #ifdef CONFIG_FTRACE_SELFTEST
.selftest = trace_selftest_startup_nop, .selftest = trace_selftest_startup_nop,
#endif #endif

View File

@ -220,15 +220,6 @@ static void sched_switch_trace_reset(struct trace_array *tr)
stop_sched_trace(tr); stop_sched_trace(tr);
} }
static void sched_switch_trace_ctrl_update(struct trace_array *tr)
{
/* When starting a new trace, reset the buffers */
if (tr->ctrl)
start_sched_trace(tr);
else
stop_sched_trace(tr);
}
static void sched_switch_trace_start(struct trace_array *tr) static void sched_switch_trace_start(struct trace_array *tr)
{ {
sched_switch_reset(tr); sched_switch_reset(tr);
@ -247,7 +238,6 @@ static struct tracer sched_switch_trace __read_mostly =
.reset = sched_switch_trace_reset, .reset = sched_switch_trace_reset,
.start = sched_switch_trace_start, .start = sched_switch_trace_start,
.stop = sched_switch_trace_stop, .stop = sched_switch_trace_stop,
.ctrl_update = sched_switch_trace_ctrl_update,
#ifdef CONFIG_FTRACE_SELFTEST #ifdef CONFIG_FTRACE_SELFTEST
.selftest = trace_selftest_startup_sched_switch, .selftest = trace_selftest_startup_sched_switch,
#endif #endif

View File

@ -348,14 +348,6 @@ static void wakeup_tracer_reset(struct trace_array *tr)
} }
} }
static void wakeup_tracer_ctrl_update(struct trace_array *tr)
{
if (tr->ctrl)
start_wakeup_tracer(tr);
else
stop_wakeup_tracer(tr);
}
static void wakeup_tracer_start(struct trace_array *tr) static void wakeup_tracer_start(struct trace_array *tr)
{ {
wakeup_reset(tr); wakeup_reset(tr);
@ -393,7 +385,6 @@ static struct tracer wakeup_tracer __read_mostly =
.stop = wakeup_tracer_stop, .stop = wakeup_tracer_stop,
.open = wakeup_tracer_open, .open = wakeup_tracer_open,
.close = wakeup_tracer_close, .close = wakeup_tracer_close,
.ctrl_update = wakeup_tracer_ctrl_update,
.print_max = 1, .print_max = 1,
#ifdef CONFIG_FTRACE_SELFTEST #ifdef CONFIG_FTRACE_SELFTEST
.selftest = trace_selftest_startup_wakeup, .selftest = trace_selftest_startup_wakeup,

View File

@ -134,13 +134,13 @@ int trace_selftest_startup_dynamic_tracing(struct tracer *trace,
msleep(100); msleep(100);
/* stop the tracing. */ /* stop the tracing. */
tr->ctrl = 0; tracing_stop();
trace->ctrl_update(tr);
ftrace_enabled = 0; ftrace_enabled = 0;
/* check the trace buffer */ /* check the trace buffer */
ret = trace_test_buffer(tr, &count); ret = trace_test_buffer(tr, &count);
trace->reset(tr); trace->reset(tr);
tracing_start();
/* we should only have one item */ /* we should only have one item */
if (!ret && count != 1) { if (!ret && count != 1) {
@ -148,6 +148,7 @@ int trace_selftest_startup_dynamic_tracing(struct tracer *trace,
ret = -1; ret = -1;
goto out; goto out;
} }
out: out:
ftrace_enabled = save_ftrace_enabled; ftrace_enabled = save_ftrace_enabled;
tracer_enabled = save_tracer_enabled; tracer_enabled = save_tracer_enabled;
@ -185,13 +186,13 @@ trace_selftest_startup_function(struct tracer *trace, struct trace_array *tr)
/* Sleep for a 1/10 of a second */ /* Sleep for a 1/10 of a second */
msleep(100); msleep(100);
/* stop the tracing. */ /* stop the tracing. */
tr->ctrl = 0; tracing_stop();
trace->ctrl_update(tr);
ftrace_enabled = 0; ftrace_enabled = 0;
/* check the trace buffer */ /* check the trace buffer */
ret = trace_test_buffer(tr, &count); ret = trace_test_buffer(tr, &count);
trace->reset(tr); trace->reset(tr);
tracing_start();
if (!ret && !count) { if (!ret && !count) {
printk(KERN_CONT ".. no entries found .."); printk(KERN_CONT ".. no entries found ..");
@ -232,13 +233,13 @@ trace_selftest_startup_irqsoff(struct tracer *trace, struct trace_array *tr)
udelay(100); udelay(100);
local_irq_enable(); local_irq_enable();
/* stop the tracing. */ /* stop the tracing. */
tr->ctrl = 0; tracing_stop();
trace->ctrl_update(tr);
/* check both trace buffers */ /* check both trace buffers */
ret = trace_test_buffer(tr, NULL); ret = trace_test_buffer(tr, NULL);
if (!ret) if (!ret)
ret = trace_test_buffer(&max_tr, &count); ret = trace_test_buffer(&max_tr, &count);
trace->reset(tr); trace->reset(tr);
tracing_start();
if (!ret && !count) { if (!ret && !count) {
printk(KERN_CONT ".. no entries found .."); printk(KERN_CONT ".. no entries found ..");
@ -269,13 +270,13 @@ trace_selftest_startup_preemptoff(struct tracer *trace, struct trace_array *tr)
udelay(100); udelay(100);
preempt_enable(); preempt_enable();
/* stop the tracing. */ /* stop the tracing. */
tr->ctrl = 0; tracing_stop();
trace->ctrl_update(tr);
/* check both trace buffers */ /* check both trace buffers */
ret = trace_test_buffer(tr, NULL); ret = trace_test_buffer(tr, NULL);
if (!ret) if (!ret)
ret = trace_test_buffer(&max_tr, &count); ret = trace_test_buffer(&max_tr, &count);
trace->reset(tr); trace->reset(tr);
tracing_start();
if (!ret && !count) { if (!ret && !count) {
printk(KERN_CONT ".. no entries found .."); printk(KERN_CONT ".. no entries found ..");
@ -312,27 +313,30 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *
local_irq_enable(); local_irq_enable();
/* stop the tracing. */ /* stop the tracing. */
tr->ctrl = 0; tracing_stop();
trace->ctrl_update(tr);
/* check both trace buffers */ /* check both trace buffers */
ret = trace_test_buffer(tr, NULL); ret = trace_test_buffer(tr, NULL);
if (ret) if (ret) {
tracing_start();
goto out; goto out;
}
ret = trace_test_buffer(&max_tr, &count); ret = trace_test_buffer(&max_tr, &count);
if (ret) if (ret) {
tracing_start();
goto out; goto out;
}
if (!ret && !count) { if (!ret && !count) {
printk(KERN_CONT ".. no entries found .."); printk(KERN_CONT ".. no entries found ..");
ret = -1; ret = -1;
tracing_start();
goto out; goto out;
} }
/* do the test by disabling interrupts first this time */ /* do the test by disabling interrupts first this time */
tracing_max_latency = 0; tracing_max_latency = 0;
tr->ctrl = 1; tracing_start();
trace->ctrl_update(tr);
preempt_disable(); preempt_disable();
local_irq_disable(); local_irq_disable();
udelay(100); udelay(100);
@ -341,8 +345,7 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *
local_irq_enable(); local_irq_enable();
/* stop the tracing. */ /* stop the tracing. */
tr->ctrl = 0; tracing_stop();
trace->ctrl_update(tr);
/* check both trace buffers */ /* check both trace buffers */
ret = trace_test_buffer(tr, NULL); ret = trace_test_buffer(tr, NULL);
if (ret) if (ret)
@ -358,6 +361,7 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *
out: out:
trace->reset(tr); trace->reset(tr);
tracing_start();
tracing_max_latency = save_max; tracing_max_latency = save_max;
return ret; return ret;
@ -448,8 +452,7 @@ trace_selftest_startup_wakeup(struct tracer *trace, struct trace_array *tr)
msleep(100); msleep(100);
/* stop the tracing. */ /* stop the tracing. */
tr->ctrl = 0; tracing_stop();
trace->ctrl_update(tr);
/* check both trace buffers */ /* check both trace buffers */
ret = trace_test_buffer(tr, NULL); ret = trace_test_buffer(tr, NULL);
if (!ret) if (!ret)
@ -457,6 +460,7 @@ trace_selftest_startup_wakeup(struct tracer *trace, struct trace_array *tr)
trace->reset(tr); trace->reset(tr);
tracing_start();
tracing_max_latency = save_max; tracing_max_latency = save_max;
@ -485,11 +489,11 @@ trace_selftest_startup_sched_switch(struct tracer *trace, struct trace_array *tr
/* Sleep for a 1/10 of a second */ /* Sleep for a 1/10 of a second */
msleep(100); msleep(100);
/* stop the tracing. */ /* stop the tracing. */
tr->ctrl = 0; tracing_stop();
trace->ctrl_update(tr);
/* check the trace buffer */ /* check the trace buffer */
ret = trace_test_buffer(tr, &count); ret = trace_test_buffer(tr, &count);
trace->reset(tr); trace->reset(tr);
tracing_start();
if (!ret && !count) { if (!ret && !count) {
printk(KERN_CONT ".. no entries found .."); printk(KERN_CONT ".. no entries found ..");
@ -513,11 +517,11 @@ trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr)
/* Sleep for a 1/10 of a second */ /* Sleep for a 1/10 of a second */
msleep(100); msleep(100);
/* stop the tracing. */ /* stop the tracing. */
tr->ctrl = 0; tracing_stop();
trace->ctrl_update(tr);
/* check the trace buffer */ /* check the trace buffer */
ret = trace_test_buffer(tr, &count); ret = trace_test_buffer(tr, &count);
trace->reset(tr); trace->reset(tr);
tracing_start();
return ret; return ret;
} }

View File

@ -275,21 +275,11 @@ static void stack_trace_reset(struct trace_array *tr)
stop_stack_trace(tr); stop_stack_trace(tr);
} }
static void stack_trace_ctrl_update(struct trace_array *tr)
{
/* When starting a new trace, reset the buffers */
if (tr->ctrl)
start_stack_trace(tr);
else
stop_stack_trace(tr);
}
static struct tracer stack_trace __read_mostly = static struct tracer stack_trace __read_mostly =
{ {
.name = "sysprof", .name = "sysprof",
.init = stack_trace_init, .init = stack_trace_init,
.reset = stack_trace_reset, .reset = stack_trace_reset,
.ctrl_update = stack_trace_ctrl_update,
#ifdef CONFIG_FTRACE_SELFTEST #ifdef CONFIG_FTRACE_SELFTEST
.selftest = trace_selftest_startup_sysprof, .selftest = trace_selftest_startup_sysprof,
#endif #endif