]> Git Repo - linux.git/commitdiff
tracing: Do not warn when connecting eprobe to non existing event
authorSteven Rostedt (VMware) <[email protected]>
Wed, 27 Oct 2021 16:08:54 +0000 (12:08 -0400)
committerSteven Rostedt (VMware) <[email protected]>
Thu, 28 Oct 2021 01:47:55 +0000 (21:47 -0400)
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.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: 7491e2c442781 ("tracing: Add a probe that attaches to trace events")
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
kernel/trace/trace_eprobe.c

index c4a15aef36afa3c1e3a97ad6030167e69604796a..5c5f208c15d341fc06be6bc8367626aa69954cdb 100644 (file)
@@ -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;
        }
This page took 0.076925 seconds and 4 git commands to generate.