Using pprof with gperftools resulting in curl error

So, I did the following:

$ pprof /bin/ls ls.prof
Using local file /bin/ls.
Gathering CPU profile from http://ls.prof/pprof/profile?seconds=30 for 30 seconds to
  /home/user/csteifel/pprof/ls.1414597606.ls.prof
Be patient...

curl: (7) couldn't connect to host
Failed to get profile: curl 'http://ls.prof/pprof/profile?seconds=30' > /home/user/csteifel/pprof/.tmp.ls.1414597606.ls.prof: No such file or directory

I'm not sure what is happening here because it is one of the examples they show here: http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html

Now I understand that in lsfact there will be no information, but I also know that this should not give me an error about curl, in this case it should be something else. What am I doing wrong here?

I also tried to do this with an example program that I created (for example: pprof --callgrind/home/user/csteifel/testing2/X86_64_DEBUG/el6/wtf ~/testing2/prof.out > callgrind.outand I get a similar error:

Using local file /home/user/csteifel/testing2/X86_64_DEBUG/el6/wtf.
Use of uninitialized value $host in substitution (s///) at /home/user/csteifel/usr/local/lib/bin/pprof line 3195.
Use of uninitialized value $hostport in concatenation (.) or string at /home/user/csteifel/usr/local/lib/bin/pprof line 3197.
Use of uninitialized value $prefix in concatenation (.) or string at /home/user/csteifel/usr/local/lib/bin/pprof line 3197.
Use of uninitialized value $host in substitution (s///) at /home/user/csteifel/usr/local/lib/bin/pprof line 3195.
Use of uninitialized value $hostport in concatenation (.) or string at /home/user/csteifel/usr/local/lib/bin/pprof line 3197.
Use of uninitialized value $prefix in concatenation (.) or string at /home/user/csteifel/usr/local/lib/bin/pprof line 3197.
Use of uninitialized value $host in sprintf at /home/user/csteifel/usr/local/lib/bin/pprof line 3364.
Gathering CPU profile from http:///pprof/profile?seconds=30 for 30 seconds to
  /home/user/csteifel/pprof/wtf.1414597016.
Be patient...

curl: (6) Couldn't resolve host 'http:'
Failed to get profile: curl 'http:///pprof/profile?seconds=30' > /home/user/csteifel/pprof/.tmp.wtf.1414597016.: No such file or directory
+6
source share
1 answer

( ): 1 , gcc , . -Wl,--no-as-needed :

-Wl,--no-as-needed -lprofiler -Wl,--as-needed

.


:

pprof ls.prof, /bin/ls ( -g, ),

, ? ! /bin/ls -lprofiler. , , :

  1. CPUPROFILE , . , /usr/local/bin/my_binary_compiled_with_libprofiler_so

    % env CPUPROFILE=/tmp/mybin.prof /usr/local/bin/my_binary_compiled_with_libprofiler_so
    
  2. , ProfilerStart() ProfilerStop(). ( .) ProfilerStart() .

- , ls , -

% ls -la ~
% <output>
% PROFILE: interrupts/evictions/bytes = 204/0/256

, ,

% pprof binary_compiled_with_lprofiler profile_file
+7
source

All Articles