diff options
author | Ricardo M. Correia <rcorreia@wizy.org> | 2014-10-08 04:39:14 +0200 |
---|---|---|
committer | Aliaksey Kandratsenka <alk@tut.by> | 2014-10-11 16:37:29 -0700 |
commit | 44c61ce6c4c713b194330641f400bbf64fd2abec (patch) | |
tree | 3570dc165781c12a771d88e99b8700114281a5cb | |
parent | 2a28ef24ddf8013bff59914b10902f1fb07bf9b2 (diff) | |
download | gperftools-44c61ce6c4c713b194330641f400bbf64fd2abec.tar.gz |
Fix parsing /proc/pid/maps dump in CPU profile data file
When trying to use pprof on my machine, the symbols of my program were
not being recognized.
It turned out that pprof, when calculating the offset of the text list
of mapped objects (the last section of the CPU profile data file), was
assuming that the slot size was always 4 bytes, even on 64-bit machines.
This led to ParseLibraries() reading a lot of garbage data at the
beginning of the map, and consequently the regex was failing to match on
the first line of the real (non-garbage) map.
-rwxr-xr-x | src/pprof | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3914,7 +3914,7 @@ sub ReadCPUProfile { # Parse map my $map = ''; - seek(PROFILE, $i * 4, 0); + seek(PROFILE, $i * ($address_length / 2), 0); read(PROFILE, $map, (stat PROFILE)[7]); my $r = {}; |