perf 不在注释中显示源代码,尽管包含了符号

问题描述 投票:0回答:1

在注释中,

perf
仅向我显示汇编代码。但是,它确实正确列出了所有符号,并且二进制文件是用
-g
编译的。此外,
file
将二进制文件列为
with debug_info, not stripped

我用

编译
 clang -std=c89 -pedantic -g \
        -Wno-attributes \
        -foptimize-sibling-calls \
        -fno-strict-aliasing \
        -DNDEBUG \
        *.c

然后用

perf record -g --call-graph dwarf ./a.out [file arg to a.out]
进行录制。但是,当运行
perf annotate
或从
perf report -g
进入注释模式时,仅显示汇编代码。我尝试过通过
--source
-l
,但似乎都没有改变任何东西。

我在 Artix 上,使用

perf version 6.1.g830b3c68c1fb
(存储库中的
perf-6.1-1
)。

linux profiling perf
1个回答
0
投票

尝试使用

-gdwarf-4
进行编译; DWARF-5 似乎存在一些问题。

© www.soinside.com 2019 - 2024. All rights reserved.