summaryrefslogtreecommitdiffstats
path: root/bin/pprof
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2014-03-31 16:33:19 (GMT)
committerJason Evans <jasone@canonware.com>2014-03-31 16:33:19 (GMT)
commit46c0af68bd248b04df75e4f92d5fb804c3d75340 (patch)
tree28a1ac21474d5f3d55812986c4c75a8bb734257b /bin/pprof
parent7709a64c59daf0b1f938be49472fcc499e1bd136 (diff)
parent8a26eaca7f4c95771ecbf096caeeba14fbe1122f (diff)
downloadjemalloc-3.6.0.zip
jemalloc-3.6.0.tar.gz
jemalloc-3.6.0.tar.bz2
Merge branch 'dev'3.6.0
Diffstat (limited to 'bin/pprof')
-rwxr-xr-xbin/pprof30
1 files changed, 27 insertions, 3 deletions
diff --git a/bin/pprof b/bin/pprof
index 727eb43..a309943 100755
--- a/bin/pprof
+++ b/bin/pprof
@@ -4197,8 +4197,12 @@ sub FindLibrary {
# For libc libraries, the copy in /usr/lib/debug contains debugging symbols
sub DebuggingLibrary {
my $file = shift;
- if ($file =~ m|^/| && -f "/usr/lib/debug$file") {
- return "/usr/lib/debug$file";
+ if ($file =~ m|^/|) {
+ if (-f "/usr/lib/debug$file") {
+ return "/usr/lib/debug$file";
+ } elsif (-f "/usr/lib/debug$file.debug") {
+ return "/usr/lib/debug$file.debug";
+ }
}
return undef;
}
@@ -4360,6 +4364,19 @@ sub ParseLibraries {
$finish = HexExtend($2);
$offset = $zero_offset;
$lib = $3;
+ }
+ # FreeBSD 10.0 virtual memory map /proc/curproc/map as defined in
+ # function procfs_doprocmap (sys/fs/procfs/procfs_map.c)
+ #
+ # Example:
+ # 0x800600000 0x80061a000 26 0 0xfffff800035a0000 r-x 75 33 0x1004 COW NC vnode /libexec/ld-elf.s
+ # o.1 NCH -1
+ elsif ($l =~ /^(0x$h)\s(0x$h)\s\d+\s\d+\s0x$h\sr-x\s\d+\s\d+\s0x\d+\s(COW|NCO)\s(NC|NNC)\svnode\s(\S+\.so(\.\d+)*)/) {
+ $start = HexExtend($1);
+ $finish = HexExtend($2);
+ $offset = $zero_offset;
+ $lib = FindLibrary($5);
+
} else {
next;
}
@@ -4382,6 +4399,7 @@ sub ParseLibraries {
}
}
+ if($main::opt_debug) { printf STDERR "$start:$finish ($offset) $lib\n"; }
push(@{$result}, [$lib, $start, $finish, $offset]);
}
@@ -4589,6 +4607,12 @@ sub ExtractSymbols {
my $finish = $lib->[2];
my $offset = $lib->[3];
+ # Use debug library if it exists
+ my $debug_libname = DebuggingLibrary($libname);
+ if ($debug_libname) {
+ $libname = $debug_libname;
+ }
+
# Get list of pcs that belong in this library.
my $contained = [];
my ($start_pc_index, $finish_pc_index);
@@ -5019,7 +5043,7 @@ sub GetProcedureBoundariesViaNm {
# Tag this routine with the starting address in case the image
# has multiple occurrences of this routine. We use a syntax
- # that resembles template paramters that are automatically
+ # that resembles template parameters that are automatically
# stripped out by ShortFunctionName()
$this_routine .= "<$start_val>";