gperftools-未转储配置文件 [英] gperftools - profile file not dumped

查看:466
本文介绍了gperftools-未转储配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经配置并构建了 gpreftools .但是,我似乎找不到程序生成的配置文件来显示它.

I've configured and built gpreftools. however, I can't seem to find the generated profile file of my program to display it.

我采取了以下措施:

  1. -lprofiler链接器标志添加到我的.pro中,构建程序,并且在链接阶段正确添加了该标志. QMAKE_LFLAGS += -lprofiler

  1. Adding the -lprofiler linker flag to my .pro, building the program and the flag is added correctly at the linking stage. QMAKE_LFLAGS += -lprofiler

运行时: $ CPUPROFILE=/tmp/prof.out /path/to/executable

执行中: $ pprof --gv /path/to/MyExe /tmp/prof.out

然后我得到以下信息:

Failed to get profile: curl -s --max-time 90 'http:///pprof/profile?seconds=30' > /home/eslam/pprof/.tmp.MyExe.1509005857.: No such file or directory.

有人对此有决心吗?

推荐答案

检查您的程序是否实际链接到libprofiler.so.某些操作系统(例如AFAIK的某些版本的ubuntu)实际上并未添加.so,如果实际上未使用任何符号.例如. ldd ./yourprogram应该列出libprofiler.so.如果这种情况没有发生,那么您应该在链接器标志之前添加-Wl之类的东西.

Check that your program actually links to libprofiler.so. Some OSes (e.g. AFAIK some versions of ubuntu) do not actually add .so if none of it's symbols are actually used. E.g. ldd ./yourprogram should list libprofiler.so. If this does not happen, then you should prepend something like -Wl,--no-as-needed to your linker flags.

这篇关于gperftools-未转储配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆