summaryrefslogtreecommitdiff
path: root/src/cmd/prof/gopprof
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/prof/gopprof')
-rwxr-xr-xsrc/cmd/prof/gopprof41
1 files changed, 26 insertions, 15 deletions
diff --git a/src/cmd/prof/gopprof b/src/cmd/prof/gopprof
index dffeeffa1..4bcfa5800 100755
--- a/src/cmd/prof/gopprof
+++ b/src/cmd/prof/gopprof
@@ -2736,6 +2736,7 @@ sub IsSymbolizedProfileFile {
sub CheckSymbolPage {
my $url = SymbolPageURL();
+print STDERR "Read $url\n";
open(SYMBOL, "$CURL -s '$url' |");
my $line = <SYMBOL>;
$line =~ s/\r//g; # turn windows-looking lines into unix-looking lines
@@ -2816,7 +2817,7 @@ sub ResolveRedirectionForCurl {
# $main::prog to have the correct program name.
sub ReadSymbols {
my $in = shift;
- my $map = {};
+ my $map = shift;
while (<$in>) {
s/\r//g; # turn windows-looking lines into unix-looking lines
# Removes all the leading zeroes from the symbols, see comment below.
@@ -2858,20 +2859,30 @@ sub FetchSymbols {
my @pcs = grep { !$seen{$_}++ } keys(%$pcset); # uniq
if (!defined($symbol_map)) {
- my $post_data = join("+", sort((map {"0x" . "$_"} @pcs)));
-
- open(POSTFILE, ">$main::tmpfile_sym");
- print POSTFILE $post_data;
- close(POSTFILE);
-
- my $url = SymbolPageURL();
- $url = ResolveRedirectionForCurl($url);
- my $command_line = "$CURL -sd '\@$main::tmpfile_sym' '$url'";
- # We use c++filt in case $SYMBOL_PAGE gives us mangled symbols.
- my $cppfilt = $obj_tool_map{"c++filt"};
- open(SYMBOL, "$command_line | $cppfilt |") or error($command_line);
- $symbol_map = ReadSymbols(*SYMBOL{IO});
- close(SYMBOL);
+ $symbol_map = {};
+ my @toask = @pcs;
+ while (@toask > 0) {
+ my $n = @toask;
+ if ($n > 49) { $n = 49; }
+ my @thisround = @toask[0..$n];
+my $t = @toask;
+print STDERR "$n $t\n";
+ @toask = @toask[($n+1)..(@toask-1)];
+ my $post_data = join("+", sort((map {"0x" . "$_"} @thisround)));
+ open(POSTFILE, ">$main::tmpfile_sym");
+ print POSTFILE $post_data;
+ close(POSTFILE);
+
+print STDERR "SYMBL!\n";
+ my $url = SymbolPageURL();
+ $url = ResolveRedirectionForCurl($url);
+ my $command_line = "$CURL -sd '\@$main::tmpfile_sym' '$url'";
+ # We use c++filt in case $SYMBOL_PAGE gives us mangled symbols.
+ my $cppfilt = $obj_tool_map{"c++filt"};
+ open(SYMBOL, "$command_line | $cppfilt |") or error($command_line);
+ ReadSymbols(*SYMBOL{IO}, $symbol_map);
+ close(SYMBOL);
+ }
}
my $symbols = {};