Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121076
b: refs/heads/master
c: bbf5b1a
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Nov 8, 2008
1 parent 273e712 commit 0f37fd4
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 102 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: 49833fc232bd6a5076496994d855f601354501d7
refs/heads/master: bbf5b1a0cecb56de6236db8b01c5bfb7ab8ba8b2
2 changes: 0 additions & 2 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -3357,8 +3357,6 @@ __init static int tracer_alloc_buffers(void)

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);
Expand Down
1 change: 0 additions & 1 deletion trunk/kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ struct tracer {
ssize_t (*read)(struct trace_iterator *iter,
struct file *filp, char __user *ubuf,
size_t cnt, loff_t *ppos);
void (*ctrl_update)(struct trace_array *tr);
#ifdef CONFIG_FTRACE_STARTUP_TEST
int (*selftest)(struct tracer *trace,
struct trace_array *tr);
Expand Down
9 changes: 0 additions & 9 deletions trunk/kernel/trace/trace_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ static void boot_trace_init(struct trace_array *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)
{
int ret;
Expand Down Expand Up @@ -102,7 +94,6 @@ struct tracer boot_tracer __read_mostly =
.name = "initcall",
.init = boot_trace_init,
.reset = reset_boot_trace,
.ctrl_update = boot_trace_ctrl_update,
.print_line = initcall_print_line,
};

Expand Down
9 changes: 0 additions & 9 deletions trunk/kernel/trace/trace_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ static void function_trace_reset(struct trace_array *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)
{
function_reset(tr);
Expand All @@ -73,7 +65,6 @@ static struct tracer function_trace __read_mostly =
.init = function_trace_init,
.reset = function_trace_reset,
.start = function_trace_start,
.ctrl_update = function_trace_ctrl_update,
#ifdef CONFIG_FTRACE_SELFTEST
.selftest = trace_selftest_startup_function,
#endif
Expand Down
11 changes: 0 additions & 11 deletions trunk/kernel/trace/trace_irqsoff.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,14 +394,6 @@ static void irqsoff_tracer_reset(struct trace_array *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)
{
tracer_enabled = 1;
Expand Down Expand Up @@ -442,7 +434,6 @@ static struct tracer irqsoff_tracer __read_mostly =
.stop = irqsoff_tracer_stop,
.open = irqsoff_tracer_open,
.close = irqsoff_tracer_close,
.ctrl_update = irqsoff_tracer_ctrl_update,
.print_max = 1,
#ifdef CONFIG_FTRACE_SELFTEST
.selftest = trace_selftest_startup_irqsoff,
Expand Down Expand Up @@ -470,7 +461,6 @@ static struct tracer preemptoff_tracer __read_mostly =
.stop = irqsoff_tracer_stop,
.open = irqsoff_tracer_open,
.close = irqsoff_tracer_close,
.ctrl_update = irqsoff_tracer_ctrl_update,
.print_max = 1,
#ifdef CONFIG_FTRACE_SELFTEST
.selftest = trace_selftest_startup_preemptoff,
Expand Down Expand Up @@ -500,7 +490,6 @@ static struct tracer preemptirqsoff_tracer __read_mostly =
.stop = irqsoff_tracer_stop,
.open = irqsoff_tracer_open,
.close = irqsoff_tracer_close,
.ctrl_update = irqsoff_tracer_ctrl_update,
.print_max = 1,
#ifdef CONFIG_FTRACE_SELFTEST
.selftest = trace_selftest_startup_preemptirqsoff,
Expand Down
11 changes: 3 additions & 8 deletions trunk/kernel/trace/trace_mmiotrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,10 @@ static void mmio_trace_reset(struct trace_array *tr)
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__);
if (tr->ctrl) {
mmio_reset_data(tr);
enable_mmiotrace();
} else {
disable_mmiotrace();
}
mmio_reset_data(tr);
}

static int mmio_print_pcidev(struct trace_seq *s, const struct pci_dev *dev)
Expand Down Expand Up @@ -298,10 +293,10 @@ static struct tracer mmio_tracer __read_mostly =
.name = "mmiotrace",
.init = mmio_trace_init,
.reset = mmio_trace_reset,
.start = mmio_trace_start,
.pipe_open = mmio_pipe_open,
.close = mmio_close,
.read = mmio_read,
.ctrl_update = mmio_trace_ctrl_update,
.print_line = mmio_print_line,
};

Expand Down
10 changes: 0 additions & 10 deletions trunk/kernel/trace/trace_nop.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,11 @@ static void nop_trace_reset(struct trace_array *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 =
{
.name = "nop",
.init = nop_trace_init,
.reset = nop_trace_reset,
.ctrl_update = nop_trace_ctrl_update,
#ifdef CONFIG_FTRACE_SELFTEST
.selftest = trace_selftest_startup_nop,
#endif
Expand Down
10 changes: 0 additions & 10 deletions trunk/kernel/trace/trace_sched_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,6 @@ static void sched_switch_trace_reset(struct trace_array *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)
{
sched_switch_reset(tr);
Expand All @@ -247,7 +238,6 @@ static struct tracer sched_switch_trace __read_mostly =
.reset = sched_switch_trace_reset,
.start = sched_switch_trace_start,
.stop = sched_switch_trace_stop,
.ctrl_update = sched_switch_trace_ctrl_update,
#ifdef CONFIG_FTRACE_SELFTEST
.selftest = trace_selftest_startup_sched_switch,
#endif
Expand Down
9 changes: 0 additions & 9 deletions trunk/kernel/trace/trace_sched_wakeup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
wakeup_reset(tr);
Expand Down Expand Up @@ -393,7 +385,6 @@ static struct tracer wakeup_tracer __read_mostly =
.stop = wakeup_tracer_stop,
.open = wakeup_tracer_open,
.close = wakeup_tracer_close,
.ctrl_update = wakeup_tracer_ctrl_update,
.print_max = 1,
#ifdef CONFIG_FTRACE_SELFTEST
.selftest = trace_selftest_startup_wakeup,
Expand Down
48 changes: 26 additions & 22 deletions trunk/kernel/trace/trace_selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,20 +134,21 @@ int trace_selftest_startup_dynamic_tracing(struct tracer *trace,
msleep(100);

/* stop the tracing. */
tr->ctrl = 0;
trace->ctrl_update(tr);
tracing_stop();
ftrace_enabled = 0;

/* check the trace buffer */
ret = trace_test_buffer(tr, &count);
trace->reset(tr);
tracing_start();

/* we should only have one item */
if (!ret && count != 1) {
printk(KERN_CONT ".. filter failed count=%ld ..", count);
ret = -1;
goto out;
}

out:
ftrace_enabled = save_ftrace_enabled;
tracer_enabled = save_tracer_enabled;
Expand Down Expand Up @@ -185,13 +186,13 @@ trace_selftest_startup_function(struct tracer *trace, struct trace_array *tr)
/* Sleep for a 1/10 of a second */
msleep(100);
/* stop the tracing. */
tr->ctrl = 0;
trace->ctrl_update(tr);
tracing_stop();
ftrace_enabled = 0;

/* check the trace buffer */
ret = trace_test_buffer(tr, &count);
trace->reset(tr);
tracing_start();

if (!ret && !count) {
printk(KERN_CONT ".. no entries found ..");
Expand Down Expand Up @@ -232,13 +233,13 @@ trace_selftest_startup_irqsoff(struct tracer *trace, struct trace_array *tr)
udelay(100);
local_irq_enable();
/* stop the tracing. */
tr->ctrl = 0;
trace->ctrl_update(tr);
tracing_stop();
/* check both trace buffers */
ret = trace_test_buffer(tr, NULL);
if (!ret)
ret = trace_test_buffer(&max_tr, &count);
trace->reset(tr);
tracing_start();

if (!ret && !count) {
printk(KERN_CONT ".. no entries found ..");
Expand Down Expand Up @@ -269,13 +270,13 @@ trace_selftest_startup_preemptoff(struct tracer *trace, struct trace_array *tr)
udelay(100);
preempt_enable();
/* stop the tracing. */
tr->ctrl = 0;
trace->ctrl_update(tr);
tracing_stop();
/* check both trace buffers */
ret = trace_test_buffer(tr, NULL);
if (!ret)
ret = trace_test_buffer(&max_tr, &count);
trace->reset(tr);
tracing_start();

if (!ret && !count) {
printk(KERN_CONT ".. no entries found ..");
Expand Down Expand Up @@ -312,27 +313,30 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *
local_irq_enable();

/* stop the tracing. */
tr->ctrl = 0;
trace->ctrl_update(tr);
tracing_stop();
/* check both trace buffers */
ret = trace_test_buffer(tr, NULL);
if (ret)
if (ret) {
tracing_start();
goto out;
}

ret = trace_test_buffer(&max_tr, &count);
if (ret)
if (ret) {
tracing_start();
goto out;
}

if (!ret && !count) {
printk(KERN_CONT ".. no entries found ..");
ret = -1;
tracing_start();
goto out;
}

/* do the test by disabling interrupts first this time */
tracing_max_latency = 0;
tr->ctrl = 1;
trace->ctrl_update(tr);
tracing_start();
preempt_disable();
local_irq_disable();
udelay(100);
Expand All @@ -341,8 +345,7 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *
local_irq_enable();

/* stop the tracing. */
tr->ctrl = 0;
trace->ctrl_update(tr);
tracing_stop();
/* check both trace buffers */
ret = trace_test_buffer(tr, NULL);
if (ret)
Expand All @@ -358,6 +361,7 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *

out:
trace->reset(tr);
tracing_start();
tracing_max_latency = save_max;

return ret;
Expand Down Expand Up @@ -448,15 +452,15 @@ trace_selftest_startup_wakeup(struct tracer *trace, struct trace_array *tr)
msleep(100);

/* stop the tracing. */
tr->ctrl = 0;
trace->ctrl_update(tr);
tracing_stop();
/* check both trace buffers */
ret = trace_test_buffer(tr, NULL);
if (!ret)
ret = trace_test_buffer(&max_tr, &count);


trace->reset(tr);
tracing_start();

tracing_max_latency = save_max;

Expand Down Expand Up @@ -485,11 +489,11 @@ trace_selftest_startup_sched_switch(struct tracer *trace, struct trace_array *tr
/* Sleep for a 1/10 of a second */
msleep(100);
/* stop the tracing. */
tr->ctrl = 0;
trace->ctrl_update(tr);
tracing_stop();
/* check the trace buffer */
ret = trace_test_buffer(tr, &count);
trace->reset(tr);
tracing_start();

if (!ret && !count) {
printk(KERN_CONT ".. no entries found ..");
Expand All @@ -513,11 +517,11 @@ trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr)
/* Sleep for a 1/10 of a second */
msleep(100);
/* stop the tracing. */
tr->ctrl = 0;
trace->ctrl_update(tr);
tracing_stop();
/* check the trace buffer */
ret = trace_test_buffer(tr, &count);
trace->reset(tr);
tracing_start();

return ret;
}
Expand Down
10 changes: 0 additions & 10 deletions trunk/kernel/trace/trace_sysprof.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,21 +275,11 @@ static void stack_trace_reset(struct trace_array *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 =
{
.name = "sysprof",
.init = stack_trace_init,
.reset = stack_trace_reset,
.ctrl_update = stack_trace_ctrl_update,
#ifdef CONFIG_FTRACE_SELFTEST
.selftest = trace_selftest_startup_sysprof,
#endif
Expand Down

0 comments on commit 0f37fd4

Please sign in to comment.