summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2026-09-28 11:25:47 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2026-10-01 17:33:33 +0200
commita8741aebcfc8993cbb3da51aed2a1d847880901c (patch)
tree36a639b6753e63393223cb6a5a34bbff9ac18ca3
parent19f06a89db48fa16a4dfb478ce44e9a54f2a2781 (diff)
perf trace: Stop at internal fields when walking syscall arguments
Since v6.19 syscall tracepoints may end with __data_loc char[] fields holding user space strings, these aren't syscall arguments. syscall__scnprintf_args() walks them anyway, printing the extra raw syscall arguments at those indices under the internal field's name, and trace__bpf_sys_enter_beauty_map() considers them when building the BPF beauty map. The internal fields come after the arguments, so stop at the first one. Reviewed-by: Namhyung Kim <namhyung@kernel.org> Assisted-by: Antigravity:gemini-3.1-pro Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/builtin-trace.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 1ffe824ba670..35d39a3fe803 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2647,6 +2647,9 @@ static size_t syscall__scnprintf_args(struct syscall *sc, char *bf, size_t size,
for (field = sc->args; field;
field = field->next, ++arg.idx, bit <<= 1) {
+ if (is_internal_field(field))
+ break;
+
if (arg.mask & bit)
continue;
@@ -4134,6 +4137,9 @@ static int trace__bpf_sys_enter_beauty_map(struct trace *trace, int e_machine, i
return -1;
for (i = 0, field = sc->args; field; ++i, field = field->next) {
+ if (is_internal_field(field))
+ break;
+
// XXX We're only collecting pointer payloads _from_ user space
if (!sc->arg_fmt[i].from_user)
continue;
@@ -4188,6 +4194,8 @@ static int trace__bpf_sys_enter_beauty_map(struct trace *trace, int e_machine, i
/* find the size of the buffer that appears in pairs with buf */
for (j = 0, field_tmp = sc->args; field_tmp; ++j, field_tmp = field_tmp->next) {
+ if (is_internal_field(field_tmp))
+ break;
if (!(field_tmp->flags & TEP_FIELD_IS_POINTER) && /* only integers */
(strstr(field_tmp->name, "count") ||
strstr(field_tmp->name, "siz") || /* size, bufsiz */