Re: [PATCH] powerpc/trace: Print hcall names instead of opcode

From: Gautam Menghani

Date: Thu Dec 03 2026 - 02:15:02 EST


On Wed, Dec 02, 2026 at 12:21:14PM +0530, Shrikanth Hegde wrote:
> Hi Gautam,
>
> On 12/1/26 5:19 PM, Gautam Menghani wrote:
> > The tracepoints for hcall entry/exit currently dump the numeric opcode,
> > which is hard to decipher.
> >
> > # perf record -e powerpc:hcall_entry -e powerpc:hcall_exit -a sleep 2
> > # perf script | head -n 2
> > qemu 909223 [009] 410908.006287: powerpc:hcall_entry: opcode=1136
> > qemu 909223 [009] 410908.006345: powerpc:hcall_entry: opcode=1148
> >
> > Introduce a single mapping that can be used by powerpc:hcall_{entry/exit}
> > and kvm_hv:kvm_hcall_{enter/exit} tracepoints to print hcall names.
> >
> > # perf script | head -n 2
> > swapper 0 [054] 921.499724: powerpc:hcall_entry: opcode=H_RTAS
> > swapper 0 [054] 921.499742: powerpc:hcall_exit: opcode=H_RTAS retval=0
> >
> > Signed-off-by: Gautam Menghani <gautam@xxxxxxxxxxxxx>
> > ---
> > .../powerpc/include/asm/hcall_trace_symbols.h | 205 ++++++++++++++++++
> > arch/powerpc/include/asm/trace.h | 9 +-
> > arch/powerpc/kvm/trace_hv.h | 139 +-----------
> > 3 files changed, 214 insertions(+), 139 deletions(-)
> > create mode 100644 arch/powerpc/include/asm/hcall_trace_symbols.h
> >
> > diff --git a/arch/powerpc/include/asm/hcall_trace_symbols.h b/arch/powerpc/include/asm/hcall_trace_symbols.h
>
> Since there is no short names here, is below better and less error prone?
>
> #define HCALL_SYMBOL(name) { name, #name }
>
> #define HCALL_TRACE_SYMBOLS \
> HCALL_SYMBOL(H_REMOVE), \
> HCALL_SYMBOL(H_ENTER), \
> ...

Yes right, will send a v2.

Thanks.