个人档案文件未被倾倒

我已经配置并构建了gpreftools。 然而,我似乎无法找到我的程序生成的配置文件来显示它。

我采取了以下行动:

  • -lprofiler链接器标志添加到我的.pro ,构建程序和标志将在链接阶段正确添加。 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, - 不需要的东西。

    链接地址: http://www.djcxy.com/p/87959.html

    上一篇: profile file not dumped

    下一篇: Profiling timer expired when using gperftools with sort