Skip to content

Commit

Permalink
tracing: Have system enable return error if one of the events fail
Browse files Browse the repository at this point in the history
If one of the events within a system fails to enable when "1" is written
to the system "enable" file, it should return an error. Note, some events
may still be enabled, but the user should know that something did go wrong.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt (Red Hat) committed Dec 9, 2016
1 parent 1dd349a commit 989a0a3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions kernel/trace/trace_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ __ftrace_set_clr_event_nolock(struct trace_array *tr, const char *match,
struct trace_event_call *call;
const char *name;
int ret = -EINVAL;
int eret = 0;

list_for_each_entry(file, &tr->events, list) {

Expand All @@ -725,9 +726,17 @@ __ftrace_set_clr_event_nolock(struct trace_array *tr, const char *match,
if (event && strcmp(event, name) != 0)
continue;

ftrace_event_enable_disable(file, set);
ret = ftrace_event_enable_disable(file, set);

ret = 0;
/*
* Save the first error and return that. Some events
* may still have been enabled, but let the user
* know that something went wrong.
*/
if (ret && !eret)
eret = ret;

ret = eret;
}

return ret;
Expand Down

0 comments on commit 989a0a3

Please sign in to comment.