|
@@ -137,8 +137,8 @@ static int ftrace_event_enable_disable(struct ftrace_event_call *call,
|
|
|
|
|
|
switch (enable) {
|
|
switch (enable) {
|
|
case 0:
|
|
case 0:
|
|
- if (call->enabled) {
|
|
|
|
- call->enabled = 0;
|
|
|
|
|
|
+ if (call->flags & TRACE_EVENT_FL_ENABLED) {
|
|
|
|
+ call->flags &= ~TRACE_EVENT_FL_ENABLED;
|
|
tracing_stop_cmdline_record();
|
|
tracing_stop_cmdline_record();
|
|
if (call->class->reg)
|
|
if (call->class->reg)
|
|
call->class->reg(call, TRACE_REG_UNREGISTER);
|
|
call->class->reg(call, TRACE_REG_UNREGISTER);
|
|
@@ -149,7 +149,7 @@ static int ftrace_event_enable_disable(struct ftrace_event_call *call,
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
- if (!call->enabled) {
|
|
|
|
|
|
+ if (!(call->flags & TRACE_EVENT_FL_ENABLED)) {
|
|
tracing_start_cmdline_record();
|
|
tracing_start_cmdline_record();
|
|
if (call->class->reg)
|
|
if (call->class->reg)
|
|
ret = call->class->reg(call, TRACE_REG_REGISTER);
|
|
ret = call->class->reg(call, TRACE_REG_REGISTER);
|
|
@@ -163,7 +163,7 @@ static int ftrace_event_enable_disable(struct ftrace_event_call *call,
|
|
"%s\n", call->name);
|
|
"%s\n", call->name);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- call->enabled = 1;
|
|
|
|
|
|
+ call->flags |= TRACE_EVENT_FL_ENABLED;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -352,7 +352,7 @@ s_next(struct seq_file *m, void *v, loff_t *pos)
|
|
(*pos)++;
|
|
(*pos)++;
|
|
|
|
|
|
list_for_each_entry_continue(call, &ftrace_events, list) {
|
|
list_for_each_entry_continue(call, &ftrace_events, list) {
|
|
- if (call->enabled)
|
|
|
|
|
|
+ if (call->flags & TRACE_EVENT_FL_ENABLED)
|
|
return call;
|
|
return call;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -411,7 +411,7 @@ event_enable_read(struct file *filp, char __user *ubuf, size_t cnt,
|
|
struct ftrace_event_call *call = filp->private_data;
|
|
struct ftrace_event_call *call = filp->private_data;
|
|
char *buf;
|
|
char *buf;
|
|
|
|
|
|
- if (call->enabled)
|
|
|
|
|
|
+ if (call->flags & TRACE_EVENT_FL_ENABLED)
|
|
buf = "1\n";
|
|
buf = "1\n";
|
|
else
|
|
else
|
|
buf = "0\n";
|
|
buf = "0\n";
|
|
@@ -486,7 +486,7 @@ system_enable_read(struct file *filp, char __user *ubuf, size_t cnt,
|
|
* or if all events or cleared, or if we have
|
|
* or if all events or cleared, or if we have
|
|
* a mixture.
|
|
* a mixture.
|
|
*/
|
|
*/
|
|
- set |= (1 << !!call->enabled);
|
|
|
|
|
|
+ set |= (1 << !!(call->flags & TRACE_EVENT_FL_ENABLED));
|
|
|
|
|
|
/*
|
|
/*
|
|
* If we have a mixture, no need to look further.
|
|
* If we have a mixture, no need to look further.
|
|
@@ -1447,7 +1447,7 @@ static __init void event_trace_self_tests(void)
|
|
* If an event is already enabled, someone is using
|
|
* If an event is already enabled, someone is using
|
|
* it and the self test should not be on.
|
|
* it and the self test should not be on.
|
|
*/
|
|
*/
|
|
- if (call->enabled) {
|
|
|
|
|
|
+ if (call->flags & TRACE_EVENT_FL_ENABLED) {
|
|
pr_warning("Enabled event during self test!\n");
|
|
pr_warning("Enabled event during self test!\n");
|
|
WARN_ON_ONCE(1);
|
|
WARN_ON_ONCE(1);
|
|
continue;
|
|
continue;
|