Re: [PATCH] perf annotate: Use jump__delete when freeing LoongArch jumps

From: Rong Bao

Date: Mon Apr 13 2026 - 04:49:53 EST


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.
[...]
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