tracing: Do not warn when connecting eprobe to non existing event
Steven Rostedt
maintainerLinus,
Do not WARN when attaching event probe to non-existent event
If the user tries to attach an event probe (eprobe) to an event that does not exist, it will trigger a warning. There's an error check that only expects memory issues otherwise it is considered a bug. But changes in the code to move around the locking made it that it can error out if the user attempts to attach to an event that does not exist, returning an -ENODEV. As this path can be caused by user space putting in a bad value, do not trigger a WARN.
Please pull the latest trace-v5.15-rc6-2 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-v5.15-rc6-2
Tag SHA1: 9fae737f622d42e0b9469ff6f481eed539363d90 Head SHA1: 7fa598f9706d40bd16f2ab286bdf5808e1393d35
Steven Rostedt (VMware) (1):
tracing: Do not warn when connecting eprobe to non existing event
----
kernel/trace/trace_eprobe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --------------------------- commit 7fa598f9706d40bd16f2ab286bdf5808e1393d35 Author: Steven Rostedt (VMware) <[email protected]> Date: Wed Oct 27 12:08:54 2021 -0400
tracing: Do not warn when connecting eprobe to non existing event
When the syscall trace points are not configured in, the kselftests for ftrace will try to attach an event probe (eprobe) to one of the system call trace points. This triggered a WARNING, because the failure only expects to see memory issues. But this is not the only failure. The user may attempt to attach to a non existent event, and the kernel must not warn about it.
kernel/trace/trace_eprobe.c +2 -2
@@ -904,8 +904,8 @@ static int __trace_eprobe_create(int argc, const char *argv[])if (IS_ERR (ep)) { ret =PTR_ERR (ep); -/* This must return -ENOMEM, else there is a bug */ -WARN_ON_ONCE (ret != -ENOMEM ); +/* This must return -ENOMEM or misssing event, else there is a bug */ +WARN_ON_ONCE (ret != -ENOMEM && ret != -ENODEV ); ep =NULL ; goto error; }
The pull request you sent on Wed, 27 Oct 2021 22:16:11 -0400:
The pull request you sent on Wed, 27 Oct 2021 22:16:11 -0400:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.gittrace-v5.15-rc6-2
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/fc18cc89b9802dbe710cbfb52d0b11b3197ead18
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html