summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/bin/stackcollapse-record
diff options
context:
space:
mode:
authorZecheng Li <zli94@ncsu.edu>2026-03-09 13:55:23 -0400
committerNamhyung Kim <namhyung@kernel.org>2026-03-19 14:42:29 -0700
commit4fb7eefe6c539840fa8854d67d00af35331b8843 (patch)
tree2ae4b65548a23a8aec9cd941b95e37efb2eba889 /tools/perf/scripts/python/bin/stackcollapse-record
parentd35b0d5877109ecca106cc3835d4d23ac2cdc33c (diff)
perf annotate-data: Use DWARF location ranges to preserve reg state
When a function call occurs, caller-saved registers are typically invalidated since the callee may clobber them. However, DWARF debug info provides location ranges that indicate exactly where a variable is valid in a register. Track the DWARF location range end address in type_state_reg and use it to determine if a caller-saved register should be preserved across a call. If the current call address is within the DWARF-specified lifetime of the variable, keep the register state valid instead of invalidating it. This improves type annotation for code where the compiler knows a register value survives across calls (e.g., when the callee is known not to clobber certain registers or when the value is reloaded after the call at the same logical location). Changes: - Add `end` and `has_range` fields to die_var_type to capture DWARF location range information - Add `lifetime_active` and `lifetime_end` fields to type_state_reg - Check location lifetime before invalidating caller-saved registers Signed-off-by: Zecheng Li <zli94@ncsu.edu> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-record')
0 files changed, 0 insertions, 0 deletions