niuys / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

pprof doesn't use correct URI in http request while profiling #194

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Have pprof fetch profile data from a URL such as
http://host:port/foo/bar/pprof/profile
2. Examine the URI that actually got sent in the request - it is
/pprof/profile and not /foo/bar/pprof/profile.

What is the expected output? What do you see instead?

The expectation is that pprof would send the full URI -
/foo/bar/pprof/profile. Instead, it only sends /pprof/profile. 

What version of the product are you using? On what operating system?

1.4. Ubuntu Linux 9.10.

Please provide any additional information below.

Original issue reported on code.google.com by mohit.a...@gmail.com on 24 Nov 2009 at 7:22

GoogleCodeExporter commented 9 years ago
It looks like this broke in a recent change to support PMUPROFILE.  Can you 
confirm
that if you send to a heap-profile url instead of a cpu-profile url, things 
still
work properly?

Original comment by csilv...@gmail.com on 24 Nov 2009 at 8:54

GoogleCodeExporter commented 9 years ago
Does this patch fix things for you?
---
@@ -2450,7 +2450,7 @@
     my $wget_timeout;
     if (($path =~ m/$PROFILE_PAGE/) || ($path =~ m/$PMUPROFILE_PAGE/)) {
       if ($path =~ m/$PROFILE_PAGE/) {
-        $url = sprintf("http://$host:$port$PROFILE_PAGE?seconds=%d",           
+        $url = sprintf("http://$host:$port$path?seconds=%d",                   
             $main::opt_seconds);
       } else {
         if ($profile_name =~ m/[?]/) {

Original comment by csilv...@gmail.com on 24 Nov 2009 at 8:58

GoogleCodeExporter commented 9 years ago

The problem is not just with CPU profiles - even heap profiles are broken. That 
is, 
using a URL http://host:port/foo/bar/pprof/heap results in /pprof/heap to be 
sent to 
the server rather than /foo/bar/pprof/heap.

As for the patch, I don't think this patch is applicable to 1.4 code. I 
searched for 
the term PMUPROFILE - can't find it anywhere in the code.

Original comment by mohit.a...@gmail.com on 25 Nov 2009 at 5:00

GoogleCodeExporter commented 9 years ago
Right, you'll have to try it against svn trunk.

Or else, search for the equivalent place in the code -- it should be near line 
2450,
and mention $PROFILE_PAGE.

Original comment by csilv...@gmail.com on 25 Nov 2009 at 5:46

GoogleCodeExporter commented 9 years ago
This should be fixed in perftools 1.5, just released.

Original comment by csilv...@gmail.com on 20 Jan 2010 at 11:08