From: Masami Hiramatsu (Google) <[email protected]>

fentry_perf_func() calls memset(&entry[1], 0, dsize) prior to calling
store_trace_args(). store_trace_args() populates the entry buffer and
handles dynamic data fields.

Furthermore, passing dsize (the dynamic data byte length) to memset at
&entry[1] (the start of fixed trace arguments) is inaccurate as it zeroes
from the fixed args area rather than the dynamic data region.

Remove this redundant memset call to align with fexit_perf_func() and other
probe perf functions.

Assisted-by: Antigravity:gemini-3.5-flash
Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
---
 kernel/trace/trace_fprobe.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/kernel/trace/trace_fprobe.c b/kernel/trace/trace_fprobe.c
index 566b64853c61..ec9105fca4a6 100644
--- a/kernel/trace/trace_fprobe.c
+++ b/kernel/trace/trace_fprobe.c
@@ -471,7 +471,6 @@ static int fentry_perf_func(struct trace_fprobe *tf, 
unsigned long entry_ip,
        regs = ftrace_fill_perf_regs(fregs, regs);
 
        entry->ip = entry_ip;
-       memset(&entry[1], 0, dsize);
        store_trace_args(&entry[1], &tf->tp, fregs, NULL, sizeof(*entry), 
dsize);
        perf_trace_buf_submit(entry, size, rctx, call->event.type, 1, regs,
                              head, NULL);


Reply via email to