summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2026-03-30 10:59:20 +0200
committerIngo Molnar <mingo@kernel.org>2026-03-31 09:50:10 +0200
commit47d2f007615ace34c5ec9026cd5f286833c62c1b (patch)
tree8c2c0114249fa7970d035071cde3fb0f3671055a /tools/perf/scripts/python/stackcollapse.py
parentec631bc3fb342ad7a2ec09433821e7201b7b15f9 (diff)
x86/elf: Use savesegment() for segment register reads in ELF core dump
ELF_CORE_COPY_REGS() currently reads %ds, %es, %fs, and %gs using inline assembly and manual zero-extension. This results in redundant instructions like `mov %eax,%eax`. Replace the inline assembly with the `savesegment()` helper, which automatically zero-extends the value to the full register width, eliminating unnecessary instructions. For example, the %ds load sequence changes from: d03: 8c d8 mov %ds,%eax d05: 89 c0 mov %eax,%eax d07: 48 89 84 24 38 01 00 mov %rax,0x138(%rsp) d0e: 00 to: ce8: 8c d8 mov %ds,%eax cea: 48 89 84 24 38 01 00 mov %rax,0x138(%rsp) cf1: 00 thus eliminating the unnecessary zero-extending `mov %eax,%eax`. No functional change intended. Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: https://patch.msgid.link/20260330085938.67985-1-ubizjak@gmail.com
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions