Re: [PATCH] perf annotate: Use jump__delete when freeing LoongArch jumps
From: Huacai Chen
Date: Mon Apr 13 2026 - 05:42:13 EST
On Mon, Apr 13, 2026 at 4:49 PM Rong Bao <rong.bao@xxxxxxxxxxxx> wrote:
>
> Hi Huacai,
>
> On 2026-04-13 16:33, Huacai Chen wrote:
> > Hi, Rong,
> >
> > On Sun, Apr 12, 2026 at 2:28 PM Rong Bao <rong.bao@xxxxxxxxxxxx> wrote:
> >> [...]
> >> This patch adds the missing free() specialization in loongarch_jump_ops,
> >> which prevents disasm_line__free() from invoking the default cleanup
> >> function.
> >>
> >> Fixes: 4ca0d340ce206 ("perf annotate: Fix instruction association and parsing for LoongArch")
> > The original code works well, you are really fixing fb7fd2a14a503b9a
> > ("perf annotate: Move raw_comment and raw_func_start fields out of
> > 'struct ins_operands'").
>
> Thanks, I'll fix the reference in v2.
>
> > And LTS branches (6.12, 6.18) need different fixes because the code
> > has been restructed.
>
> I locally have a version based on the linux-6.19.y branch. Would you
> mind providing me some pointers to the standard approach to submitting
> this rebased version? I'm new to the process.
Just send V2 for upstream is OK.
If you want to fix 6.12/6.18/6.19, you can send dedicated patches as
follows after the upstream version is merged.
https://lore.kernel.org/loongarch/20260413023627.1363488-1-chenhuacai@xxxxxxxxxxx/T/#u
Huacai
> >> [...]
> >> diff --git a/tools/perf/util/disasm.h b/tools/perf/util/disasm.h
> >> index a6e478caf61a9..6b7fef3bbc42f 100644
> >> --- a/tools/perf/util/disasm.h
> >> +++ b/tools/perf/util/disasm.h
> >> @@ -158,6 +158,7 @@ int call__scnprintf(const struct ins *ins, char *bf, size_t size,
> >> struct ins_operands *ops, int max_ins_name);
> >> int jump__scnprintf(const struct ins *ins, char *bf, size_t size,
> >> struct ins_operands *ops, int max_ins_name);
> >> +void jump__delete(struct ins_operands *ops);
> > Don't put it among ***_scnprintf(), put it before ins__raw_scnprintf()
> > or after mov__scnprintf(), and add a blank line.
>
> Sure. This will be fixed in v2.
>
> >
> > Huacai
> >
> >> [...]
>
> --
> Regards,
> Rong Bao
>