DavidMorre / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

shared libraries in profiles are not resolved on OSX #196

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
--- pprof.old   2009-12-07 17:04:14.000000000 -0500
+++ pprof   2009-12-07 17:05:07.000000000 -0500
@@ -3243,7 +3243,7 @@
     my $finish;
     my $offset;
     my $lib;
-    if ($l =~ /^($h)-
($h)\s+..x.\s+($h)\s+\S+:\S+\s+\d+\s+(\S+\.(so|dll|dylib)(\.\d+)*\w*)/i) 
{
+    if ($l =~ /^($h)-
($h)\s+..x.\s+($h)\s+\S+:\S+\s+\d+\s+(\S+\.(so|dll|dylib|bundle)(\.\d+)
*\w*)/i) {
       # Full line from /proc/self/maps.  Example:
       #   40000000-40015000 r-xp 00000000 03:01 12845071   /lib/ld-
2.3.2.so
       $start = HexExtend($1);

Original issue reported on code.google.com by themaste...@gmail.com on 7 Dec 2009 at 10:06

GoogleCodeExporter commented 9 years ago
The patch got a little mangled, but .bundle files are valid shared libraries 
and are being 
ignored by the perl script.

Original comment by themaste...@gmail.com on 7 Dec 2009 at 10:07

GoogleCodeExporter commented 9 years ago
Might make sense to add .framework in there too?

Original comment by themaste...@gmail.com on 7 Dec 2009 at 10:07

GoogleCodeExporter commented 9 years ago
Dunno anything about .framework, but .bundle is used by ruby for its C 
extensions on 
OSX.

Mach makes a distinction between shared libraries (MH_DYLIB) and dynamically 
loadable 
bundles (MH_BUNDLE). For example, MH_BUNDLEs can be told to resolve symbols 
against an executable (-bundle_loader link flag), and can be unloaded 
(providing they 
don't contain Objective-C code) whereas dylibs can't.

Original comment by themaste...@gmail.com on 7 Dec 2009 at 10:14

GoogleCodeExporter commented 9 years ago
OK, I'll add .bundle, but not .framework.  Is that enough to solve the problem?

Original comment by csilv...@gmail.com on 8 Dec 2009 at 7:14

GoogleCodeExporter commented 9 years ago
Yep, that solves my specific issue with profiling Ruby C extensions. Thanks!

Original comment by themaste...@gmail.com on 8 Dec 2009 at 7:22

GoogleCodeExporter commented 9 years ago
This should be fixed in perftools 1.5, just released.

Original comment by csilv...@gmail.com on 20 Jan 2010 at 11:07