如何配置perf report使其输出Intel语法汇编代码
Absolutely, you can make perf report output Intel syntax instead of the default AT&T—this is a common adjustment for developers who find Intel's syntax more intuitive. Here are three reliable ways to set this up:
1. Temporary override with an environment variable
Perf uses objdump under the hood for disassembly, so you can pass Intel syntax options directly to it via the OBJDUMPFLAGS environment variable. Run this command to launch perf report with Intel syntax for that session:
OBJDUMPFLAGS="--disassembler-options=intel" perf report
2. Permanent configuration (persists across sessions)
To make Intel syntax the default for all future perf report runs, add a section to your ~/.perfconfig file (create it if it doesn't exist):
[disassembler] intel = true
Save the file, and the next time you run perf report, it will automatically use Intel-style assembly.
3. Switch within the perf report interactive interface
If you're already in a running perf report session, you can toggle the syntax on the fly:
- Press the
ekey to open the "Disassembler Options" menu - Type
inteland press Enter - The assembly view will immediately refresh to use Intel syntax
Example of the change
Your original AT&T snippet:
0,18 │a9: vmovsd -0x8(%rdi,%rsi,8),%xmm0 0,82 │ vmulsd %xmm1,%xmm1,%xmm1
Will become this in Intel syntax:
0,18 │a9: vmovsd xmm0, QWORD PTR [rdi+rsi*8-0x8] 0,82 │ vmulsd xmm1, xmm1, xmm1
内容的提问来源于stack exchange,提问作者Alex Zhukovskiy

