[PATCH v2 1/2] tracing: add missing trace_probe_log_clear for eprobes

Paul Cacheux via B4 Relay posted 2 patches 9 months, 1 week ago
There is a newer version of this series
[PATCH v2 1/2] tracing: add missing trace_probe_log_clear for eprobes
Posted by Paul Cacheux via B4 Relay 9 months, 1 week ago
From: Paul Cacheux <paulcacheux@gmail.com>

Make sure trace_probe_log_clear is called in the tracing
eprobe code path, matching the trace_probe_log_init call.

Signed-off-by: Paul Cacheux <paulcacheux@gmail.com>
---
 kernel/trace/trace_eprobe.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/trace/trace_eprobe.c b/kernel/trace/trace_eprobe.c
index c08355c3ef32b4124ac944d7e3a03efb66492269..916555f0de811f03feed9d923c63078b0e4c993b 100644
--- a/kernel/trace/trace_eprobe.c
+++ b/kernel/trace/trace_eprobe.c
@@ -969,10 +969,13 @@ static int __trace_eprobe_create(int argc, const char *argv[])
 			goto error;
 		}
 	}
+	trace_probe_log_clear();
 	return ret;
+
 parse_error:
 	ret = -EINVAL;
 error:
+	trace_probe_log_clear();
 	trace_event_probe_cleanup(ep);
 	return ret;
 }

-- 
2.49.0
Re: [PATCH v2 1/2] tracing: add missing trace_probe_log_clear for eprobes
Posted by Masami Hiramatsu (Google) 9 months ago
On Fri, 02 May 2025 15:15:52 +0200
Paul Cacheux via B4 Relay <devnull+paulcacheux.gmail.com@kernel.org> wrote:

> From: Paul Cacheux <paulcacheux@gmail.com>
> 
> Make sure trace_probe_log_clear is called in the tracing
> eprobe code path, matching the trace_probe_log_init call.
> 
> Signed-off-by: Paul Cacheux <paulcacheux@gmail.com>

Looks good to me.

Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events")
Cc: stable@vger.kernel.org

Thank you,

> ---
>  kernel/trace/trace_eprobe.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/kernel/trace/trace_eprobe.c b/kernel/trace/trace_eprobe.c
> index c08355c3ef32b4124ac944d7e3a03efb66492269..916555f0de811f03feed9d923c63078b0e4c993b 100644
> --- a/kernel/trace/trace_eprobe.c
> +++ b/kernel/trace/trace_eprobe.c
> @@ -969,10 +969,13 @@ static int __trace_eprobe_create(int argc, const char *argv[])
>  			goto error;
>  		}
>  	}
> +	trace_probe_log_clear();
>  	return ret;
> +
>  parse_error:
>  	ret = -EINVAL;
>  error:
> +	trace_probe_log_clear();
>  	trace_event_probe_cleanup(ep);
>  	return ret;
>  }
> 
> -- 
> 2.49.0
> 
> 


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