Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: tools/deep_memory_profiler/subcommands/expand.py

Issue 587193002: dmprof expand command supports to analyze unhooked components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging 5 import logging
6 import sys 6 import sys
7 7
8 from lib.policy import PolicySet 8 from lib.policy import PolicySet
9 from lib.subcommand import SubCommand 9 from lib.subcommand import SubCommand
10 10
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 precedence += '(type.name=%s) ' % bucket.typeinfo_name 108 precedence += '(type.name=%s) ' % bucket.typeinfo_name
109 ExpandCommand._add_size(precedence, bucket, depth, committed, sizes) 109 ExpandCommand._add_size(precedence, bucket, depth, committed, sizes)
110 elif rule.allocator_type == 'mmap': 110 elif rule.allocator_type == 'mmap':
111 for _, region in dump.iter_map: 111 for _, region in dump.iter_map:
112 if region[0] != 'hooked': 112 if region[0] != 'hooked':
113 continue 113 continue
114 component_match, bucket = policy.find_mmap(region, bucket_set) 114 component_match, bucket = policy.find_mmap(region, bucket_set)
115 if component_match == component_name: 115 if component_match == component_name:
116 ExpandCommand._add_size('', bucket, depth, 116 ExpandCommand._add_size('', bucket, depth,
117 region[1]['committed'], sizes) 117 region[1]['committed'], sizes)
118 elif rule.allocator_type == 'unhooked':
119 for addr, region in dump.iter_map:
120 if region[0] != 'unhooked':
121 continue
122 component_match = policy.find_unhooked(region)
123 if component_match == component_name:
124 precedence = ''
125 precedence += '%s-' % hex(addr[0])[2:]
126 precedence += '%s' % hex(addr[1])[2:]
127 precedence += ' %s' % region[1]['vma']['readable']
128 precedence += '%s' % region[1]['vma']['writable']
129 precedence += '%s' % region[1]['vma']['executable']
130 precedence += '%s' % region[1]['vma']['private']
131 precedence += ' %s' % region[1]['vma']['offset']
132 precedence += ' %s:' % region[1]['vma']['major']
133 precedence += '%s' % region[1]['vma']['minor']
134 precedence += ' %s' % region[1]['vma']['inode']
135 precedence += ' %s' % region[1]['vma']['name']
136 if not precedence in sizes:
137 sizes[precedence] = 0
138 sizes[precedence] += region[1]['committed']
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698