Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 77 lines (70 sloc) 2.484 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
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..b04d988 100755
--- a/src/pprof
+++ b/src/pprof
@@ -560,7 +560,8 @@ sub Main() {
   my $symbol_map = {};
 
   # Read one profile, pick the last item on the list
- my $data = ReadProfile($main::prog, pop(@main::profile_files));
+ my $fname = pop(@main::profile_files);
+ my $data = ReadProfile($main::prog, $fname);
   my $profile = $data->{profile};
   my $pcs = $data->{pcs};
   my $libs = $data->{libs}; # Info about main program and shared libraries
@@ -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);
+ } 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
                       'CpuProfiler::prof_handler',
+ 'PerfTools::CpuProfiler.start',
+ 'Array#each',
+ 'Proc#call',
+ 'Class#new',
                       '__FRAME_END__',
                       '__pthread_sighandler',
                       '__restore') {
@@ -2434,6 +2450,7 @@ sub RemoveUninterestingFrames {
     # Nothing skipped for unknown types
   }
 
+=pod
   if ($main::profile_type eq 'cpu') {
     # If all the second-youngest program counters are the same,
     # this STRONGLY suggests that it is an artifact of measurement,
@@ -2458,6 +2475,7 @@ sub RemoveUninterestingFrames {
       $profile = $result;
     }
   }
+=cut
 
   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;
Something went wrong with that request. Please try again.