profile file not dumped

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

I took the following actions:

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

  • Running with: $ CPUPROFILE=/tmp/prof.out /path/to/executable

  • Executing: $ pprof --gv /path/to/MyExe /tmp/prof.out

  • Then I get the following:

    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.

    Anyone has a resolve on this?


    Check that your program actually links to libprofiler.so. Some OSes (eg AFAIK some versions of ubuntu) do not actually add .so if none of it's symbols are actually used. Eg 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.

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

    上一篇: 提高嵌套的foreach性能C#

    下一篇: 个人档案文件未被倾倒