Skip to content

Commit bbf5b1a

Browse files
Steven RostedtIngo Molnar
authored andcommitted
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>
1 parent 49833fc commit bbf5b1a

11 files changed

Lines changed: 29 additions & 101 deletions

‎kernel/trace/trace.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3357,8 +3357,6 @@ __init static int tracer_alloc_buffers(void)
33573357

33583358
register_tracer(&nop_trace);
33593359
#ifdef CONFIG_BOOT_TRACER
3360-
/* We don't want to launch sched_switch tracer yet */
3361-
global_trace.ctrl = 0;
33623360
register_tracer(&boot_tracer);
33633361
current_trace = &boot_tracer;
33643362
current_trace->init(&global_trace);

‎kernel/trace/trace.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ struct tracer {
244244
ssize_t (*read)(struct trace_iterator *iter,
245245
struct file *filp, char __user *ubuf,
246246
size_t cnt, loff_t *ppos);
247-
void (*ctrl_update)(struct trace_array *tr);
248247
#ifdef CONFIG_FTRACE_STARTUP_TEST
249248
int (*selftest)(struct tracer *trace,
250249
struct trace_array *tr);

‎kernel/trace/trace_boot.c‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,6 @@ static void boot_trace_init(struct trace_array *tr)
5858
tracing_sched_switch_assign_trace(tr);
5959
}
6060

61-
static void boot_trace_ctrl_update(struct trace_array *tr)
62-
{
63-
if (tr->ctrl)
64-
enable_boot_trace();
65-
else
66-
disable_boot_trace();
67-
}
68-
6961
static enum print_line_t initcall_print_line(struct trace_iterator *iter)
7062
{
7163
int ret;
@@ -102,7 +94,6 @@ struct tracer boot_tracer __read_mostly =
10294
.name = "initcall",
10395
.init = boot_trace_init,
10496
.reset = reset_boot_trace,
105-
.ctrl_update = boot_trace_ctrl_update,
10697
.print_line = initcall_print_line,
10798
};
10899

‎kernel/trace/trace_functions.c‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,6 @@ static void function_trace_reset(struct trace_array *tr)
5454
stop_function_trace(tr);
5555
}
5656

57-
static void function_trace_ctrl_update(struct trace_array *tr)
58-
{
59-
if (tr->ctrl)
60-
start_function_trace(tr);
61-
else
62-
stop_function_trace(tr);
63-
}
64-
6557
static void function_trace_start(struct trace_array *tr)
6658
{
6759
function_reset(tr);
@@ -73,7 +65,6 @@ static struct tracer function_trace __read_mostly =
7365
.init = function_trace_init,
7466
.reset = function_trace_reset,
7567
.start = function_trace_start,
76-
.ctrl_update = function_trace_ctrl_update,
7768
#ifdef CONFIG_FTRACE_SELFTEST
7869
.selftest = trace_selftest_startup_function,
7970
#endif

‎kernel/trace/trace_irqsoff.c‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -394,14 +394,6 @@ static void irqsoff_tracer_reset(struct trace_array *tr)
394394
stop_irqsoff_tracer(tr);
395395
}
396396

397-
static void irqsoff_tracer_ctrl_update(struct trace_array *tr)
398-
{
399-
if (tr->ctrl)
400-
start_irqsoff_tracer(tr);
401-
else
402-
stop_irqsoff_tracer(tr);
403-
}
404-
405397
static void irqsoff_tracer_start(struct trace_array *tr)
406398
{
407399
tracer_enabled = 1;
@@ -442,7 +434,6 @@ static struct tracer irqsoff_tracer __read_mostly =
442434
.stop = irqsoff_tracer_stop,
443435
.open = irqsoff_tracer_open,
444436
.close = irqsoff_tracer_close,
445-
.ctrl_update = irqsoff_tracer_ctrl_update,
446437
.print_max = 1,
447438
#ifdef CONFIG_FTRACE_SELFTEST
448439
.selftest = trace_selftest_startup_irqsoff,
@@ -470,7 +461,6 @@ static struct tracer preemptoff_tracer __read_mostly =
470461
.stop = irqsoff_tracer_stop,
471462
.open = irqsoff_tracer_open,
472463
.close = irqsoff_tracer_close,
473-
.ctrl_update = irqsoff_tracer_ctrl_update,
474464
.print_max = 1,
475465
#ifdef CONFIG_FTRACE_SELFTEST
476466
.selftest = trace_selftest_startup_preemptoff,
@@ -500,7 +490,6 @@ static struct tracer preemptirqsoff_tracer __read_mostly =
500490
.stop = irqsoff_tracer_stop,
501491
.open = irqsoff_tracer_open,
502492
.close = irqsoff_tracer_close,
503-
.ctrl_update = irqsoff_tracer_ctrl_update,
504493
.print_max = 1,
505494
#ifdef CONFIG_FTRACE_SELFTEST
506495
.selftest = trace_selftest_startup_preemptirqsoff,

‎kernel/trace/trace_mmiotrace.c‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,10 @@ static void mmio_trace_reset(struct trace_array *tr)
4949
mmio_trace_array = NULL;
5050
}
5151

52-
static void mmio_trace_ctrl_update(struct trace_array *tr)
52+
static void mmio_trace_start(struct trace_array *tr)
5353
{
5454
pr_debug("in %s\n", __func__);
55-
if (tr->ctrl) {
56-
mmio_reset_data(tr);
57-
enable_mmiotrace();
58-
} else {
59-
disable_mmiotrace();
60-
}
55+
mmio_reset_data(tr);
6156
}
6257

6358
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 =
298293
.name = "mmiotrace",
299294
.init = mmio_trace_init,
300295
.reset = mmio_trace_reset,
296+
.start = mmio_trace_start,
301297
.pipe_open = mmio_pipe_open,
302298
.close = mmio_close,
303299
.read = mmio_read,
304-
.ctrl_update = mmio_trace_ctrl_update,
305300
.print_line = mmio_print_line,
306301
};
307302

‎kernel/trace/trace_nop.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,11 @@ static void nop_trace_reset(struct trace_array *tr)
4242
stop_nop_trace(tr);
4343
}
4444

45-
static void nop_trace_ctrl_update(struct trace_array *tr)
46-
{
47-
/* When starting a new trace, reset the buffers */
48-
if (tr->ctrl)
49-
start_nop_trace(tr);
50-
else
51-
stop_nop_trace(tr);
52-
}
53-
5445
struct tracer nop_trace __read_mostly =
5546
{
5647
.name = "nop",
5748
.init = nop_trace_init,
5849
.reset = nop_trace_reset,
59-
.ctrl_update = nop_trace_ctrl_update,
6050
#ifdef CONFIG_FTRACE_SELFTEST
6151
.selftest = trace_selftest_startup_nop,
6252
#endif

‎kernel/trace/trace_sched_switch.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,6 @@ static void sched_switch_trace_reset(struct trace_array *tr)
220220
stop_sched_trace(tr);
221221
}
222222

223-
static void sched_switch_trace_ctrl_update(struct trace_array *tr)
224-
{
225-
/* When starting a new trace, reset the buffers */
226-
if (tr->ctrl)
227-
start_sched_trace(tr);
228-
else
229-
stop_sched_trace(tr);
230-
}
231-
232223
static void sched_switch_trace_start(struct trace_array *tr)
233224
{
234225
sched_switch_reset(tr);
@@ -247,7 +238,6 @@ static struct tracer sched_switch_trace __read_mostly =
247238
.reset = sched_switch_trace_reset,
248239
.start = sched_switch_trace_start,
249240
.stop = sched_switch_trace_stop,
250-
.ctrl_update = sched_switch_trace_ctrl_update,
251241
#ifdef CONFIG_FTRACE_SELFTEST
252242
.selftest = trace_selftest_startup_sched_switch,
253243
#endif

‎kernel/trace/trace_sched_wakeup.c‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -348,14 +348,6 @@ static void wakeup_tracer_reset(struct trace_array *tr)
348348
}
349349
}
350350

351-
static void wakeup_tracer_ctrl_update(struct trace_array *tr)
352-
{
353-
if (tr->ctrl)
354-
start_wakeup_tracer(tr);
355-
else
356-
stop_wakeup_tracer(tr);
357-
}
358-
359351
static void wakeup_tracer_start(struct trace_array *tr)
360352
{
361353
wakeup_reset(tr);
@@ -393,7 +385,6 @@ static struct tracer wakeup_tracer __read_mostly =
393385
.stop = wakeup_tracer_stop,
394386
.open = wakeup_tracer_open,
395387
.close = wakeup_tracer_close,
396-
.ctrl_update = wakeup_tracer_ctrl_update,
397388
.print_max = 1,
398389
#ifdef CONFIG_FTRACE_SELFTEST
399390
.selftest = trace_selftest_startup_wakeup,

‎kernel/trace/trace_selftest.c‎

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -134,20 +134,21 @@ int trace_selftest_startup_dynamic_tracing(struct tracer *trace,
134134
msleep(100);
135135

136136
/* stop the tracing. */
137-
tr->ctrl = 0;
138-
trace->ctrl_update(tr);
137+
tracing_stop();
139138
ftrace_enabled = 0;
140139

141140
/* check the trace buffer */
142141
ret = trace_test_buffer(tr, &count);
143142
trace->reset(tr);
143+
tracing_start();
144144

145145
/* we should only have one item */
146146
if (!ret && count != 1) {
147147
printk(KERN_CONT ".. filter failed count=%ld ..", count);
148148
ret = -1;
149149
goto out;
150150
}
151+
151152
out:
152153
ftrace_enabled = save_ftrace_enabled;
153154
tracer_enabled = save_tracer_enabled;
@@ -185,13 +186,13 @@ trace_selftest_startup_function(struct tracer *trace, struct trace_array *tr)
185186
/* Sleep for a 1/10 of a second */
186187
msleep(100);
187188
/* stop the tracing. */
188-
tr->ctrl = 0;
189-
trace->ctrl_update(tr);
189+
tracing_stop();
190190
ftrace_enabled = 0;
191191

192192
/* check the trace buffer */
193193
ret = trace_test_buffer(tr, &count);
194194
trace->reset(tr);
195+
tracing_start();
195196

196197
if (!ret && !count) {
197198
printk(KERN_CONT ".. no entries found ..");
@@ -232,13 +233,13 @@ trace_selftest_startup_irqsoff(struct tracer *trace, struct trace_array *tr)
232233
udelay(100);
233234
local_irq_enable();
234235
/* stop the tracing. */
235-
tr->ctrl = 0;
236-
trace->ctrl_update(tr);
236+
tracing_stop();
237237
/* check both trace buffers */
238238
ret = trace_test_buffer(tr, NULL);
239239
if (!ret)
240240
ret = trace_test_buffer(&max_tr, &count);
241241
trace->reset(tr);
242+
tracing_start();
242243

243244
if (!ret && !count) {
244245
printk(KERN_CONT ".. no entries found ..");
@@ -269,13 +270,13 @@ trace_selftest_startup_preemptoff(struct tracer *trace, struct trace_array *tr)
269270
udelay(100);
270271
preempt_enable();
271272
/* stop the tracing. */
272-
tr->ctrl = 0;
273-
trace->ctrl_update(tr);
273+
tracing_stop();
274274
/* check both trace buffers */
275275
ret = trace_test_buffer(tr, NULL);
276276
if (!ret)
277277
ret = trace_test_buffer(&max_tr, &count);
278278
trace->reset(tr);
279+
tracing_start();
279280

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

314315
/* stop the tracing. */
315-
tr->ctrl = 0;
316-
trace->ctrl_update(tr);
316+
tracing_stop();
317317
/* check both trace buffers */
318318
ret = trace_test_buffer(tr, NULL);
319-
if (ret)
319+
if (ret) {
320+
tracing_start();
320321
goto out;
322+
}
321323

322324
ret = trace_test_buffer(&max_tr, &count);
323-
if (ret)
325+
if (ret) {
326+
tracing_start();
324327
goto out;
328+
}
325329

326330
if (!ret && !count) {
327331
printk(KERN_CONT ".. no entries found ..");
328332
ret = -1;
333+
tracing_start();
329334
goto out;
330335
}
331336

332337
/* do the test by disabling interrupts first this time */
333338
tracing_max_latency = 0;
334-
tr->ctrl = 1;
335-
trace->ctrl_update(tr);
339+
tracing_start();
336340
preempt_disable();
337341
local_irq_disable();
338342
udelay(100);
@@ -341,8 +345,7 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *
341345
local_irq_enable();
342346

343347
/* stop the tracing. */
344-
tr->ctrl = 0;
345-
trace->ctrl_update(tr);
348+
tracing_stop();
346349
/* check both trace buffers */
347350
ret = trace_test_buffer(tr, NULL);
348351
if (ret)
@@ -358,6 +361,7 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *
358361

359362
out:
360363
trace->reset(tr);
364+
tracing_start();
361365
tracing_max_latency = save_max;
362366

363367
return ret;
@@ -448,15 +452,15 @@ trace_selftest_startup_wakeup(struct tracer *trace, struct trace_array *tr)
448452
msleep(100);
449453

450454
/* stop the tracing. */
451-
tr->ctrl = 0;
452-
trace->ctrl_update(tr);
455+
tracing_stop();
453456
/* check both trace buffers */
454457
ret = trace_test_buffer(tr, NULL);
455458
if (!ret)
456459
ret = trace_test_buffer(&max_tr, &count);
457460

458461

459462
trace->reset(tr);
463+
tracing_start();
460464

461465
tracing_max_latency = save_max;
462466

@@ -485,11 +489,11 @@ trace_selftest_startup_sched_switch(struct tracer *trace, struct trace_array *tr
485489
/* Sleep for a 1/10 of a second */
486490
msleep(100);
487491
/* stop the tracing. */
488-
tr->ctrl = 0;
489-
trace->ctrl_update(tr);
492+
tracing_stop();
490493
/* check the trace buffer */
491494
ret = trace_test_buffer(tr, &count);
492495
trace->reset(tr);
496+
tracing_start();
493497

494498
if (!ret && !count) {
495499
printk(KERN_CONT ".. no entries found ..");
@@ -513,11 +517,11 @@ trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr)
513517
/* Sleep for a 1/10 of a second */
514518
msleep(100);
515519
/* stop the tracing. */
516-
tr->ctrl = 0;
517-
trace->ctrl_update(tr);
520+
tracing_stop();
518521
/* check the trace buffer */
519522
ret = trace_test_buffer(tr, &count);
520523
trace->reset(tr);
524+
tracing_start();
521525

522526
return ret;
523527
}

0 commit comments

Comments
 (0)