summaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/export-to-sqlite.py
diff options
context:
space:
mode:
authorZecheng Li <zecheng@google.com>2025-10-13 18:16:00 +0000
committerNamhyung Kim <namhyung@kernel.org>2025-10-21 06:02:49 -0700
commit1f4cc4ae3f8ae661bae3722e973a0f5be650fcbf (patch)
treef9b831524882a12f403593844f98e637c5b724df /tools/perf/scripts/python/export-to-sqlite.py
parent24a30ce9b14ce84b00105b970c4d16eabe09a62a (diff)
downloadlinux-1f4cc4ae3f8ae661bae3722e973a0f5be650fcbf.tar.gz
linux-1f4cc4ae3f8ae661bae3722e973a0f5be650fcbf.zip
perf annotate: Track arithmetic instructions on pointers
Track the arithmetic operations on registers with pointer types. We handle only add, sub and lea instructions. The original pointer information needs to be preserved for getting outermost struct types. For example, reg0 points to a struct cfs_rq, when we add 0x10 to reg0, it should preserve the information of struct cfs_rq + 0x10 in the register instead of a pointer type to the child field at 0x10. Details: 1. struct type_state_reg now includes an offset, indicating if the register points to the start or an internal part of its associated type. This offset is used in mem to reg and reg to stack mem transfers, and also applied to the final type offset. 2. lea offset(%sp/%fp), reg is now treated as taking the address of a stack variable. It worked fine in most cases, but an issue with this approach is the pointer type may not exist. 3. lea offset(%base), reg is handled by moving the type from %base and adding an offset, similar to an add operation followed by a mov reg to reg. 4. Non-stack variables from DWARF with non-zero offsets in their location expressions are now accepted with register offset tracking. Multi-register addressing modes in LEA are not supported. Signed-off-by: Zecheng Li <zecheng@google.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions