Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf annotate: Treat 'call' instruction as stack operation

I found some portion of mem-store events sampled on CALL instruction
which has no memory access. But it actually saves a return address
into stack. It should be considered as a stack operation like RET
instruction.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240909214251.3033827-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
c8b93587 332f60ac

+1
+1
tools/perf/util/annotate.c
··· 2474 2474 if (arch__is(arch, "x86")) { 2475 2475 if (!strncmp(dl->ins.name, "push", 4) || 2476 2476 !strncmp(dl->ins.name, "pop", 3) || 2477 + !strncmp(dl->ins.name, "call", 4) || 2477 2478 !strncmp(dl->ins.name, "ret", 3)) 2478 2479 return true; 2479 2480 }