]> git.baikalelectronics.ru Git - kernel.git/commit
tracing/boottime: Fix kprobe multiple events
authorSascha Ortmann <sascha.ortmann@stud.uni-hannover.de>
Thu, 18 Jun 2020 16:33:01 +0000 (18:33 +0200)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 24 Jun 2020 01:51:50 +0000 (21:51 -0400)
commitc7eac03fb7fd6328e1d7c602721dbe5bd46e549e
tree5d576c0db4095400b0d3ec3403304936a9bc6966
parent862462eba8e569eed9295ed390fd183a5c07bad6
tracing/boottime: Fix kprobe multiple events

Fix boottime kprobe events to report and abort after each failure when
adding probes.

As an example, when we try to set multiprobe kprobe events in
bootconfig like this:

ftrace.event.kprobes.vfsevents {
        probes = "vfs_read $arg1 $arg2,,
                 !error! not reported;?", // leads to error
                 "vfs_write $arg1 $arg2"
}

This will not work as expected. After
commit f4cf187417cb56bab ("tracing/boottime: Fix kprobe event API usage"),
the function trace_boot_add_kprobe_event will not produce any error
message when adding a probe fails at kprobe_event_gen_cmd_start.
Furthermore, we continue to add probes when kprobe_event_gen_cmd_end fails
(and kprobe_event_gen_cmd_start did not fail). In this case the function
even returns successfully when the last call to kprobe_event_gen_cmd_end
is successful.

The behaviour of reporting and aborting after failures is not
consistent.

The function trace_boot_add_kprobe_event now reports each failure and
stops adding probes immediately.

Link: https://lkml.kernel.org/r/20200618163301.25854-1-sascha.ortmann@stud.uni-hannover.de
Cc: stable@vger.kernel.org
Cc: linux-kernel@i4.cs.fau.de
Co-developed-by: Maximilian Werner <maximilian.werner96@gmail.com>
Fixes: f4cf187417cb ("tracing/boottime: Fix kprobe event API usage")
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Maximilian Werner <maximilian.werner96@gmail.com>
Signed-off-by: Sascha Ortmann <sascha.ortmann@stud.uni-hannover.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_boot.c