aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_events.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace_events.c')
-rw-r--r--kernel/trace/trace_events.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 8daaca5475b5..53cffc0b0801 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -137,8 +137,8 @@ static int ftrace_event_enable_disable(struct ftrace_event_call *call,
137 137
138 switch (enable) { 138 switch (enable) {
139 case 0: 139 case 0:
140 if (call->enabled) { 140 if (call->flags & TRACE_EVENT_FL_ENABLED) {
141 call->enabled = 0; 141 call->flags &= ~TRACE_EVENT_FL_ENABLED;
142 tracing_stop_cmdline_record(); 142 tracing_stop_cmdline_record();
143 if (call->class->reg) 143 if (call->class->reg)
144 call->class->reg(call, TRACE_REG_UNREGISTER); 144 call->class->reg(call, TRACE_REG_UNREGISTER);
@@ -149,7 +149,7 @@ static int ftrace_event_enable_disable(struct ftrace_event_call *call,
149 } 149 }
150 break; 150 break;
151 case 1: 151 case 1:
152 if (!call->enabled) { 152 if (!(call->flags & TRACE_EVENT_FL_ENABLED)) {
153 tracing_start_cmdline_record(); 153 tracing_start_cmdline_record();
154 if (call->class->reg) 154 if (call->class->reg)
155 ret = call->class->reg(call, TRACE_REG_REGISTER); 155 ret = call->class->reg(call, TRACE_REG_REGISTER);
@@ -163,7 +163,7 @@ static int ftrace_event_enable_disable(struct ftrace_event_call *call,
163 "%s\n", call->name); 163 "%s\n", call->name);
164 break; 164 break;
165 } 165 }
166 call->enabled = 1; 166 call->flags |= TRACE_EVENT_FL_ENABLED;
167 } 167 }
168 break; 168 break;
169 } 169 }
@@ -352,7 +352,7 @@ s_next(struct seq_file *m, void *v, loff_t *pos)
352 (*pos)++; 352 (*pos)++;
353 353
354 list_for_each_entry_continue(call, &ftrace_events, list) { 354 list_for_each_entry_continue(call, &ftrace_events, list) {
355 if (call->enabled) 355 if (call->flags & TRACE_EVENT_FL_ENABLED)
356 return call; 356 return call;
357 } 357 }
358 358
@@ -411,7 +411,7 @@ event_enable_read(struct file *filp, char __user *ubuf, size_t cnt,
411 struct ftrace_event_call *call = filp->private_data; 411 struct ftrace_event_call *call = filp->private_data;
412 char *buf; 412 char *buf;
413 413
414 if (call->enabled) 414 if (call->flags & TRACE_EVENT_FL_ENABLED)
415 buf = "1\n"; 415 buf = "1\n";
416 else 416 else
417 buf = "0\n"; 417 buf = "0\n";
@@ -486,7 +486,7 @@ system_enable_read(struct file *filp, char __user *ubuf, size_t cnt,
486 * or if all events or cleared, or if we have 486 * or if all events or cleared, or if we have
487 * a mixture. 487 * a mixture.
488 */ 488 */
489 set |= (1 << !!call->enabled); 489 set |= (1 << !!(call->flags & TRACE_EVENT_FL_ENABLED));
490 490
491 /* 491 /*
492 * If we have a mixture, no need to look further. 492 * If we have a mixture, no need to look further.
@@ -1447,7 +1447,7 @@ static __init void event_trace_self_tests(void)
1447 * If an event is already enabled, someone is using 1447 * If an event is already enabled, someone is using
1448 * it and the self test should not be on. 1448 * it and the self test should not be on.
1449 */ 1449 */
1450 if (call->enabled) { 1450 if (call->flags & TRACE_EVENT_FL_ENABLED) {
1451 pr_warning("Enabled event during self test!\n"); 1451 pr_warning("Enabled event during self test!\n");
1452 WARN_ON_ONCE(1); 1452 WARN_ON_ONCE(1);
1453 continue; 1453 continue;