gprof 和可执行文件的参数
使用 gprof 时:
$ gprof options [executable-file [profile-data-files...]] [> outfile]
如果您有选项传递给可执行文件,例如:
gprof a.out --varfred=32
那么 gprof 假定我向其传递无效选项,而不是传递给正在分析的程序 (a.out
)。
有办法解决这个问题吗?
when using gprof:
$ gprof options [executable-file [profile-data-files...]] [> outfile]
if you have options to pass to the executable like:
gprof a.out --varfred=32
then gprof assumes that I am passing an invalid option to it, instead of to the program being profiled (a.out
).
Any way to get around this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不使用 gprof 运行可执行文件,因此您只需指定它以便 gprof 可以加载符号。 您首先像平常一样单独运行可执行文件,然后它会发出分析数据。
稍后,gprof 会加载该数据以及可执行文件。
当然,这一切都在 gprof 手册中进行了解释。
You don't run your executable with gprof, so you only specify it so gprof can load symbols. You run the executable first, on its own just as normal, and it then emits profiling data.
This data is loaded, along with the executable, by gprof later.
This is all explained in the gprof manual, of course.