]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Don't succeed if event_enable_func did not register anything
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Thu, 9 May 2013 05:44:14 +0000 (14:44 +0900)
committerSteven Rostedt <rostedt@goodmis.org>
Thu, 9 May 2013 15:26:01 +0000 (11:26 -0400)
commitc266fbf50b600e45dd60ca0b90474002bbec6d94
treef1c0c60e26e7f10e6e05cca9af1639bf651a7bf4
parent63b3f6ab6d1375e1d65d184000703c762e419a63
tracing: Don't succeed if event_enable_func did not register anything

Return 0 instead of the number of activated ftrace function probes if
event_enable_func succeeded and return an error code if it failed or
did not register any functions. But it currently returns the number
of registered functions and if it didn't register anything, it returns 0,
but that is considered success.

This also fixes the return value. As if it succeeds, it returns the
number of functions that were enabled, which is returned back to
the user in ftrace_regex_write (the write() return code). If only
one function is enabled, then the return code of the write is one,
and this can confuse the user program in thinking it only wrote 1
byte.

Link: http://lkml.kernel.org/r/20130509054413.30398.55650.stgit@mhiramat-M0-7522
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
[ Rewrote change log to reflect that this fixes two bugs - SR ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace_events.c