Bug 1519224 - Fix stack frame printing in block_analyzer.py. r=erahm
authorAndrew McCreight <continuation@gmail.com>
Mon, 14 Jan 2019 18:41:35 +0000
changeset 453768 da7597af4dd14b004ca141dc0a42f6683b8f5943
parent 453767 d352b4fe9d6808091c236afc68e6c6d242f9f17c
child 453769 50b3268954b1300941453d11934d032478425a55
push id35372
push usercbrindusan@mozilla.com
push dateMon, 14 Jan 2019 21:49:33 +0000
treeherdermozilla-central@50b3268954b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerserahm
bugs1519224
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1519224 - Fix stack frame printing in block_analyzer.py. r=erahm Also, add a new allocator function. Differential Revision: https://phabricator.services.mozilla.com/D16241
memory/replace/dmd/block_analyzer.py
--- a/memory/replace/dmd/block_analyzer.py
+++ b/memory/replace/dmd/block_analyzer.py
@@ -46,16 +46,17 @@ allocatorFns = [
     'vpx_memalign',
     'js_malloc',
     'js_calloc',
     'js_realloc',
     'pod_malloc',
     'pod_calloc',
     'pod_realloc',
     'nsTArrayInfallibleAllocator::Malloc',
+    'Allocator<ReplaceMallocBase>::malloc(',
     # This one necessary to fully filter some sequences of allocation functions
     # that happen in practice. Note that ??? entries that follow non-allocation
     # functions won't be stripped, as explained above.
     '???',
 ]
 
 ####
 
@@ -118,17 +119,17 @@ class BlockData:
         self.alloc_stack = json_block['alloc']
 
 
 def print_trace_segment(args, stacks, block):
     (traceTable, frameTable) = stacks
 
     for l in traceTable[block.alloc_stack]:
         # The 5: is to remove the bogus leading "#00: " from the stack frame.
-        print(' ', frameTable[l][5:args.max_stack_frame_length])
+        print('  ' + frameTable[l][5:args.max_stack_frame_length])
 
 
 def show_referrers(args, blocks, stacks, block):
     visited = set([])
 
     anyFound = False
 
     while True:
@@ -243,17 +244,17 @@ def loadGraph(options):
 def analyzeLogs():
     options = parser.parse_args()
 
     (blocks, stacks) = loadGraph(options)
 
     block = int(options.block, 16)
 
     if block not in blocks:
-        print('Object', block, 'not found in traces.')
+        print('Object ' + block + ' not found in traces.')
         print('It could still be the target of some nodes.')
         return
 
     if options.info:
         show_block_info(options, blocks, stacks, block)
         return
 
     show_referrers(options, blocks, stacks, block)