From: Namhyung Kim Date: Wed, 21 Aug 2024 06:54:06 +0000 (-0700) Subject: perf annotate-data: Fix missing constant copy X-Git-Tag: v6.12-rc1~109^2~136 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=922ec313f061cf75157d8e93fe16bc6397f6ea25;p=thirdparty%2Fkernel%2Flinux.git perf annotate-data: Fix missing constant copy I found it missed to copy the immediate constant when it moves the register value. This could result in a wrong type inference since the address for the per-cpu variable would be 0 always. Fixes: eb9190afaed6afd5 ("perf annotate-data: Handle ADD instructions") Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Athira Rajeev Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20240821065408.285548-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/arch/x86/annotate/instructions.c b/tools/perf/arch/x86/annotate/instructions.c index 7b7d462c6c6be..88b5bcf2116fc 100644 --- a/tools/perf/arch/x86/annotate/instructions.c +++ b/tools/perf/arch/x86/annotate/instructions.c @@ -382,6 +382,7 @@ static void update_insn_state_x86(struct type_state *state, tsr->type = state->regs[src->reg1].type; tsr->kind = state->regs[src->reg1].kind; + tsr->imm_value = state->regs[src->reg1].imm_value; tsr->ok = true; pr_debug_dtp("mov [%x] reg%d -> reg%d",