tracing/eprobe: Fix alloc event dir failed when event name no set
PATCH 1/1 tracing/eprobe: Fix alloc event dir failed when event name no set
The event dir will alloc failed when event name no set, using the command:
"echo "e:esys/ syscalls/sys_enter_openat file=\$filename:string"
Quoted 1 line
Quoted 1 line
dynamic_events"
It seems that dir name="syscalls/sys_enter_openat" is not allowed in debugfs. So just use the "sys_enter_openat" as the event name.
events")
--- kernel/trace/trace_eprobe.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/trace/trace_eprobe.c +1 -2
@@ -968,8 +968,7 @@ static int __trace_eprobe_create(int argc, const char *argv[]) }if (!event) { -strscpy (buf1, argv[1 ],MAX_EVENT_NAME_LEN ); -sanitize_event_name (buf1); +strscpy (buf1, sys_event,MAX_EVENT_NAME_LEN ); event = buf1; }
Signature · 1 line
2.32.0
Quoted 6 lines · On Sun, 18 Sep 2022 20:29:08 +0800 Tao Chen <[email protected]>…
The event dir will alloc failed when event name no set, using the command:
"echo "e:esys/ syscalls/sys_enter_openat file=\$filename:string"Quoted 1 line
Quoted 1 line
dynamic_events"It seems that dir name="syscalls/sys_enter_openat" is not allowed in debugfs. So just use the "
sys_enter_openat" as the event name.
Good catch!
Quoted 3 lines
Fixes 7491e2c44278 ("tracing: Add a probe that attaches to traceevents")
But actually, this code was introduced by below commit, so Fixes tag must be updated. (this is important because stable backport version will be decided by this tag.)
Thank you!
Quoted 22 lines
Signed-off-by Tao Chen <[email protected]>--- kernel/trace/trace_eprobe.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)kernel/trace/trace_eprobe.c +1
-2@@ -968,8 +968,7 @@ static int __trace_eprobe_create(int argc, const char *argv[]) }if (!event) { -strscpy (buf1, argv[1 ],MAX_EVENT_NAME_LEN ); -sanitize_event_name (buf1); +strscpy (buf1, sys_event,MAX_EVENT_NAME_LEN ); event = buf1; }Signature · 1 line
2.32.0
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>
Quoted 45 lines · Masami Hiramatsu (Google)
Quoted 6 lines · On Sun, 18 Sep 2022 20:29:08 +0800 Tao Chen <[email protected]>…
The event dir will alloc failed when event name no set, using the command:
"echo "e:esys/ syscalls/sys_enter_openat file=\$filename:string"Quoted 1 line
Quoted 1 line
dynamic_events"It seems that dir name="syscalls/sys_enter_openat" is not allowed in debugfs. So just use the "
sys_enter_openat" as the event name.Good catch!
Quoted 3 lines
Fixes 7491e2c44278 ("tracing: Add a probe that attaches to traceevents")
But actually, this code was introduced by below commit, so Fixes tag must be updated. (this is important because stable backport version will be decided by this tag.)
Fixes 95c104c378dc ("tracing: Auto generate event name when creating a group of events")Thank you!
Quoted 19 lines
Signed-off-by Tao Chen <[email protected]>--- kernel/trace/trace_eprobe.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)kernel/trace/trace_eprobe.c +1
-2@@ -968,8 +968,7 @@ static int __trace_eprobe_create(int argc, const char *argv[]) }if (!event) { -strscpy (buf1, argv[1 ],MAX_EVENT_NAME_LEN ); -sanitize_event_name (buf1); +strscpy (buf1, sys_event,MAX_EVENT_NAME_LEN ); event = buf1; }
Quoted 5 lines
Quoted 3 lines
Signature · 1 line
2.32.0
Thank you for your review, i will change it in v2.