Permalink
Browse files

Fix patch to 1.6 pprof script

  • Loading branch information...
1 parent 3fc7f2d commit 91329f6c8a8d9bf084117f4b05ae2f1b8a09ee8f @tmm1 committed Nov 12, 2010
Showing with 26 additions and 9 deletions.
  1. +26 −9 patches/perftools-pprof.patch
@@ -1,5 +1,11 @@
+commit 1828f461a3ea523b7018d03ab83850621cf66ba9
+Author: Aman Gupta <aman@tmm1.net>
+Date: Fri Nov 12 16:33:15 2010 -0600
+
+ perftools-pprof
+
diff --git a/src/pprof b/src/pprof
-index e67e42e..ee9927c 100755
+index e67e42e..b04d988 100755
--- a/src/pprof
+++ b/src/pprof
@@ -560,7 +560,8 @@ sub Main() {
@@ -12,24 +18,26 @@ index e67e42e..ee9927c 100755
my $profile = $data->{profile};
my $pcs = $data->{pcs};
my $libs = $data->{libs}; # Info about main program and shared libraries
-@@ -601,6 +602,17 @@ sub Main() {
- $symbols = ExtractSymbols($libs, $pcs);
- }
+@@ -589,7 +590,18 @@ sub Main() {
+ # Collect symbols
+ my $symbols;
+- if ($main::use_symbolized_profile) {
+ if (-e "$fname.symbols") {
+ open(SYMBOLS, "<$fname.symbols");
+ while(<SYMBOLS>){
+ chop;
+ if (m/(.+?)\s*:\s*(.*)/){
+ $symbols->{$1}[0] = $2;
++ $symbols->{$1}[1] = "?";
++ $symbols->{$1}[2] = $2;
+ }
+ }
+ close(SYMBOLS);
-+ }
-+
- # Remove uniniteresting stack items
- $profile = RemoveUninterestingFrames($symbols, $profile);
-
++ } elsif ($main::use_symbolized_profile) {
+ $symbols = FetchSymbols($pcs, $symbol_map);
+ } elsif ($main::use_symbol_page) {
+ $symbols = FetchSymbols($pcs);
@@ -2425,6 +2437,10 @@ sub RemoveUninterestingFrames {
foreach my $name ('ProfileData::Add', # historical
'ProfileData::prof_handler', # historical
@@ -57,3 +65,12 @@ index e67e42e..ee9927c 100755
my $result = {};
foreach my $k (keys(%{$profile})) {
+@@ -3360,7 +3378,7 @@ sub ReadCPUProfile {
+ # file, in which case the subtract-one was done when the file
+ # was written.
+ if ($j > 0 && !$main::use_symbolized_profile) {
+- $pc--;
++ # $pc--;
+ }
+ $pc = sprintf("%0*x", $address_length, $pc);
+ $pcs->{$pc} = 1;

0 comments on commit 91329f6

Please sign in to comment.