From: Dmitriy Vyukov Date: Mon, 23 Sep 2013 21:15:20 +0000 (-0700) Subject: misc/pprof: support block profile X-Git-Tag: go1.2rc2~132 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=39361170d40a8d846d5065a614bd5a722a6aceb4;p=gostls13.git misc/pprof: support block profile Fixes #6347. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/13845044 --- diff --git a/misc/pprof b/misc/pprof index ed399dae40..1fc8d36219 100755 --- a/misc/pprof +++ b/misc/pprof @@ -110,6 +110,7 @@ my $PS2PDF = "ps2pdf"; my $HEAP_PAGE = "/pprof/heap"; my $THREAD_PAGE = "/pprof/thread"; my $PROFILE_PAGE = "/pprof/profile"; # must support cgi-param "?seconds=#" +my $BLOCK_PAGE = "/pprof/block"; my $PMUPROFILE_PAGE = "/pprof/pmuprofile(?:\\?.*)?"; # must support cgi-param # ?seconds=#&event=x&period=n my $GROWTH_PAGE = "/pprof/growth"; @@ -162,7 +163,7 @@ pprof [options] The / can be $HEAP_PAGE, $PROFILE_PAGE, /pprof/pmuprofile, $GROWTH_PAGE, $CONTENTION_PAGE, /pprof/wall, - $THREAD_PAGE, or /pprof/filteredprofile. + $THREAD_PAGE, $BLOCK_PAGE or /pprof/filteredprofile. For instance: pprof http://myserver.com:80$HEAP_PAGE If / is omitted, the service defaults to $PROFILE_PAGE (cpu profiling). @@ -3002,7 +3003,7 @@ sub IsProfileURL { sub ParseProfileURL { my $profile_name = shift; if (defined($profile_name) && - $profile_name =~ m,^(?:(https?)://|)([^/:]+):(\d+)(|\@\d+)(|/|(.*?)($PROFILE_PAGE|$PMUPROFILE_PAGE|$HEAP_PAGE|$GROWTH_PAGE|$THREAD_PAGE|$CONTENTION_PAGE|$WALL_PAGE|$FILTEREDPROFILE_PAGE))$,o) { + $profile_name =~ m,^(?:(https?)://|)([^/:]+):(\d+)(|\@\d+)(|/|(.*?)($PROFILE_PAGE|$PMUPROFILE_PAGE|$HEAP_PAGE|$GROWTH_PAGE|$THREAD_PAGE|$BLOCK_PAGE|$CONTENTION_PAGE|$WALL_PAGE|$FILTEREDPROFILE_PAGE))$,o) { # $7 is $PROFILE_PAGE/$HEAP_PAGE/etc. $5 is *everything* after # the hostname, as long as that everything is the empty string, # a slash, or something ending in $PROFILE_PAGE/$HEAP_PAGE/etc.