Skip to content

Commit 317fa41

Browse files
committed
perf trace: Show zero value in STRARRAY
The STRARRAY macro is to print values in a pre-defined array. But sometimes it hides the value because it's 0. The value of 0 can have a meaning in this case so set 'show_zero' field. For example, it can show CREATE_MAP cmd in the bpf syscall. Acked-by: Howard Chu <howardchu95@gmail.com> Link: https://lore.kernel.org/r/20250502204056.973977-1-namhyung@kernel.org Signed-off-by: Namhyung Kim <namhyung@kernel.org>
1 parent c21986d commit 317fa41

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/perf/builtin-trace.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,12 +1124,14 @@ static bool syscall_arg__strtoul_btf_type(char *bf __maybe_unused, size_t size _
11241124
#define STRARRAY(name, array) \
11251125
{ .scnprintf = SCA_STRARRAY, \
11261126
.strtoul = STUL_STRARRAY, \
1127-
.parm = &strarray__##array, }
1127+
.parm = &strarray__##array, \
1128+
.show_zero = true, }
11281129

11291130
#define STRARRAY_FLAGS(name, array) \
11301131
{ .scnprintf = SCA_STRARRAY_FLAGS, \
11311132
.strtoul = STUL_STRARRAY_FLAGS, \
1132-
.parm = &strarray__##array, }
1133+
.parm = &strarray__##array, \
1134+
.show_zero = true, }
11331135

11341136
#include "trace/beauty/eventfd.c"
11351137
#include "trace/beauty/futex_op.c"

0 commit comments

Comments
 (0)