summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2014-04-22 18:41:15 -0700
committerJason Evans <jasone@canonware.com>2014-04-22 20:55:09 -0700
commit6f001059aa33d77a3cb7799002044faf8dd08fc0 (patch)
treefa31e27c6fd36a656d79176084d2fdb68adc8da8 /bin
parent05125b83778a5695c29777acdc662d999d016d32 (diff)
downloadjemalloc-6f001059aa33d77a3cb7799002044faf8dd08fc0.tar.gz
Simplify backtracing.
Simplify backtracing to not ignore any frames, and compensate for this in pprof in order to increase flexibility with respect to function-based refactoring even in the presence of non-deterministic inlining. Modify pprof to blacklist all jemalloc allocation entry points including non-standard ones like mallocx(), and ignore all allocator-internal frames. Prior to this change, pprof excluded the specifically blacklisted functions from backtraces, but it left allocator-internal frames intact.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pprof9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/pprof b/bin/pprof
index a309943c..328138cd 100755
--- a/bin/pprof
+++ b/bin/pprof
@@ -2811,9 +2811,14 @@ sub RemoveUninterestingFrames {
'free',
'memalign',
'posix_memalign',
+ 'aligned_alloc',
'pvalloc',
'valloc',
'realloc',
+ 'mallocx', # jemalloc
+ 'rallocx', # jemalloc
+ 'xallocx', # jemalloc
+ 'dallocx', # jemalloc
'tc_calloc',
'tc_cfree',
'tc_malloc',
@@ -2923,6 +2928,10 @@ sub RemoveUninterestingFrames {
if (exists($symbols->{$a})) {
my $func = $symbols->{$a}->[0];
if ($skip{$func} || ($func =~ m/$skip_regexp/)) {
+ # Throw away the portion of the backtrace seen so far, under the
+ # assumption that previous frames were for functions internal to the
+ # allocator.
+ @path = ();
next;
}
}