Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 91329f6c8a
Fetching contributors…

Cannot retrieve contributors at this time

77 lines (70 sloc) 2.484 kB
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;
Jump to Line
Something went wrong with that request. Please try again.