[PATCH 0/2] tracing: resolve enum names for function arguments via BTF

From: Donglin Peng

Date: Mon Feb 02 2026 - 06:18:40 EST


From: Donglin Peng <pengdonglin@xxxxxxxxxx>

The print_function_args() function, used for function tracer output,
currently prints values of enum parameters in decimal format, which
reduces readability.

Utilize the BTF information to resolve enum type parameters and print
their symbolic names where possible. This enhances the trace log
readability by displaying meaningful identifiers instead of raw numbers.

Before:
count_memcg_events(memcg=0xffff888005740980, idx=20, count=0x1) {

After:
count_memcg_events(memcg=0xffff888005740980, idx=20 [PGFAULT], count=0x1) {

Donglin Peng (2):
btf: Add for_each_enum and for_each_enum64 helper macros
tracing: resolve enum names for function arguments via BTF

include/linux/btf.h | 10 ++++++
kernel/bpf/btf.c | 66 ++++++++++++++++---------------------
kernel/trace/trace_output.c | 11 ++++++-
3 files changed, 48 insertions(+), 39 deletions(-)

--
2.34.1