0

我已经用gcc选项在不同的服务器上编译了我的 apache2,

-pg -DGPROF -g -DNO_USE_SIGACTION

我将此 apache2 二进制文件复制到不同的服务器并执行一次并得到gmon.out.

但是在使用命令创建分析文件时,

gprof /usr/sbin/apache2 /gmon.out > /tmp/apa.txt

我得到以下错误行,

BFD: Dwarf Error: found dwarf version '4', this reader only handles version 2 and 3 information.
BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2 and 3 information.
BFD: Dwarf Error: found dwarf version '715', this reader only handles version 2 and 3 information.
BFD: Dwarf Error: found dwarf version '59393', this reader only handles version 2 and 3 information.

大约 100 行类似的错误。如何摆脱这个来生成gprof分析文件?

编译操作系统:

cat /etc/debian_version
6.0.7

gcc version 4.8.1 (crosstool-NG 1.19.0)

执行操作系统:

cat /etc/debian_version
6.0.8
4

1 回答 1

0

您拥有较新版本的 GCC,但听起来您拥有较旧版本的 gprof。

一种解决方法是构建和安装您自己的 gprof。这不是太难。

另一个修复方法是使用“-gdwarf-3”进行重建,这将告诉 GCC 使用 DWARF 3。

于 2014-01-08T04:00:27.230 回答