summaryrefslogtreecommitdiffstats
path: root/rust/macros
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2024-03-18 22:51:11 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2024-03-21 10:41:29 -0300
commitf5b095924d0c1c2f0698df07c54887d92c39fd3a (patch)
tree99315edcfbc29f542326cfc5026ab226b60efa51 /rust/macros
parentad62edbfc55b23347539c8c6fff9a70de17c4b95 (diff)
downloadlinux-stable-f5b095924d0c1c2f0698df07c54887d92c39fd3a.tar.gz
linux-stable-f5b095924d0c1c2f0698df07c54887d92c39fd3a.tar.bz2
linux-stable-f5b095924d0c1c2f0698df07c54887d92c39fd3a.zip
perf annotate-data: Support general per-cpu access
This is to support per-cpu variable access often without a matching DWARF entry. For some reason, I cannot find debug info of per-cpu variables sometimes. They have more complex pattern to calculate the address of per-cpu variables like below. 2b7d: mov -0x1e0(%rbp),%rax ; rax = cpu 2b84: mov -0x7da0f7e0(,%rax,8),%rcx ; rcx = __per_cpu_offset[cpu] * 2b8c: mov 0x34870(%rcx),%rax ; *(__per_cpu_offset[cpu] + 0x34870) Let's assume the rax register has a number for a CPU at 2b7d. The next instruction is to get the per-cpu offset' for that cpu. The offset -0x7da0f7e0 is 0xffffffff825f0820 in u64 which is the address of the '__per_cpu_offset' array in my system. So it'd get the actual offset of that CPU's per-cpu region and save it to the rcx register. Then, at 2b8c, accesses using rcx can be handled same as the global variable access. To handle this case, it should check if the offset of the instruction matches to the address of '__per_cpu_offset'. 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: Linus Torvalds <torvalds@linux-foundation.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: https://lore.kernel.org/r/20240319055115.4063940-20-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'rust/macros')
0 files changed, 0 insertions, 0 deletions