History

tracing: Have system enable return error if one of the events fail

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.

Steven Rostedt (Red Hat) committed 9 years ago

Commit 989a0a31 parent 1dd349a1 file · +11 −2Browse files

Showing the changes to kernel/trace (1 of 1 file). Show all

Unified · Split

kernel/trace/trace_events.c+11−2
@@ -702,6 +702,7 @@ __ftrace_set_clr_event_nolock(struct trace_array *tr, const char *match, · 701 unmodified lines
702702 struct trace_event_call *call;
703703 const char *name;
704704 int ret = -EINVAL;
705+ int eret = 0;
705706
706707 list_for_each_entry(file, &tr->events, list) {
707708
@@ -725,9 +726,17 @@ __ftrace_set_clr_event_nolock(struct trace_array *tr, const char *match, · 17 unmodified lines
725726 if (event && strcmp(event, name) != 0)
726727 continue;
727728
728− ftrace_event_enable_disable(file, set);
729+ ret = ftrace_event_enable_disable(file, set);
729730
730− ret = 0;
731+ /*
732+ * Save the first error and return that. Some events
733+ * may still have been enabled, but let the user
734+ * know that something went wrong.
735+ */
736+ if (ret && !eret)
737+ eret = ret;
738+
739+ ret = eret;
731740 }
732741
733742 return ret;