All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tracing/eprobe: Fix alloc event dir failed when event name no set
@ 2022-09-18 12:29 Tao Chen
  2022-09-23  5:29 ` Masami Hiramatsu
  0 siblings, 1 reply; 3+ messages in thread
From: Tao Chen @ 2022-09-18 12:29 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar, Masami Hiramatsu, Tzvetomir Stoyanov
  Cc: linux-kernel, Tao Chen

The event dir will alloc failed when event name no set, using the
command:
"echo "e:esys/ syscalls/sys_enter_openat file=\$filename:string"
>> 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.

Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace
events")
Signed-off-by: Tao Chen <chentao.kernel@linux.alibaba.com>
---
 kernel/trace/trace_eprobe.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/trace/trace_eprobe.c b/kernel/trace/trace_eprobe.c
index 1783e3478912..a8938e54cd34 100644
--- a/kernel/trace/trace_eprobe.c
+++ b/kernel/trace/trace_eprobe.c
@@ -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;
 	}
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tracing/eprobe: Fix alloc event dir failed when event name no set
  2022-09-18 12:29 [PATCH] tracing/eprobe: Fix alloc event dir failed when event name no set Tao Chen
@ 2022-09-23  5:29 ` Masami Hiramatsu
  2022-09-24 13:25   ` Tao Chen
  0 siblings, 1 reply; 3+ messages in thread
From: Masami Hiramatsu @ 2022-09-23  5:29 UTC (permalink / raw)
  To: Tao Chen; +Cc: Steven Rostedt, Ingo Molnar, Tzvetomir Stoyanov, linux-kernel

On Sun, 18 Sep 2022 20:29:08 +0800
Tao Chen <chentao.kernel@linux.alibaba.com> wrote:

> The event dir will alloc failed when event name no set, using the
> command:
> "echo "e:esys/ syscalls/sys_enter_openat file=\$filename:string"
> >> 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! 

> 
> Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace
> events")

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")

Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Thank you!

> Signed-off-by: Tao Chen <chentao.kernel@linux.alibaba.com>
> ---
>  kernel/trace/trace_eprobe.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/kernel/trace/trace_eprobe.c b/kernel/trace/trace_eprobe.c
> index 1783e3478912..a8938e54cd34 100644
> --- a/kernel/trace/trace_eprobe.c
> +++ b/kernel/trace/trace_eprobe.c
> @@ -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;
>  	}
>  
> -- 
> 2.32.0
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tracing/eprobe: Fix alloc event dir failed when event name no set
  2022-09-23  5:29 ` Masami Hiramatsu
@ 2022-09-24 13:25   ` Tao Chen
  0 siblings, 0 replies; 3+ messages in thread
From: Tao Chen @ 2022-09-24 13:25 UTC (permalink / raw)
  To: Masami Hiramatsu (Google)
  Cc: Steven Rostedt, Ingo Molnar, Tzvetomir Stoyanov, linux-kernel

在 2022/9/23 下午1:29, Masami Hiramatsu (Google) 写道:
> On Sun, 18 Sep 2022 20:29:08 +0800
> Tao Chen <chentao.kernel@linux.alibaba.com> wrote:
> 
>> The event dir will alloc failed when event name no set, using the
>> command:
>> "echo "e:esys/ syscalls/sys_enter_openat file=\$filename:string"
>>>> 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!
> 
>>
>> Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace
>> events")
> 
> 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")
> 
> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> Thank you!
> 
>> Signed-off-by: Tao Chen <chentao.kernel@linux.alibaba.com>
>> ---
>>   kernel/trace/trace_eprobe.c | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/kernel/trace/trace_eprobe.c b/kernel/trace/trace_eprobe.c
>> index 1783e3478912..a8938e54cd34 100644
>> --- a/kernel/trace/trace_eprobe.c
>> +++ b/kernel/trace/trace_eprobe.c
>> @@ -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;
>>   	}
>>   
>> -- 
>> 2.32.0
>>
> 
> 
Thank you for your review, i will change it in v2.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-24 13:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-18 12:29 [PATCH] tracing/eprobe: Fix alloc event dir failed when event name no set Tao Chen
2022-09-23  5:29 ` Masami Hiramatsu
2022-09-24 13:25   ` Tao Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.