diff options
author | Namhyung Kim <namhyung@kernel.org> | 2025-05-02 13:40:56 -0700 |
---|---|---|
committer | Namhyung Kim <namhyung@kernel.org> | 2025-06-24 10:27:50 -0700 |
commit | 317fa41b47da63730145e336c9ef47c62b78ee4f (patch) | |
tree | c2ee842b5fd9feab51ae3a8550d7b793c75d0fae | |
parent | c21986d33d6beb269a35b38dcb8adaa5bd228527 (diff) |
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>
-rw-r--r-- | tools/perf/builtin-trace.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index bf9b5d0630d3..61650be8fccd 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -1124,12 +1124,14 @@ static bool syscall_arg__strtoul_btf_type(char *bf __maybe_unused, size_t size _ #define STRARRAY(name, array) \ { .scnprintf = SCA_STRARRAY, \ .strtoul = STUL_STRARRAY, \ - .parm = &strarray__##array, } + .parm = &strarray__##array, \ + .show_zero = true, } #define STRARRAY_FLAGS(name, array) \ { .scnprintf = SCA_STRARRAY_FLAGS, \ .strtoul = STUL_STRARRAY_FLAGS, \ - .parm = &strarray__##array, } + .parm = &strarray__##array, \ + .show_zero = true, } #include "trace/beauty/eventfd.c" #include "trace/beauty/futex_op.c" |