diff options
author | dmikurube@chromium.org <dmikurube@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-28 15:49:54 +0000 |
---|---|---|
committer | dmikurube@chromium.org <dmikurube@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-28 15:49:54 +0000 |
commit | d0d1bcbae0fbf648f549b1d397eb6575d91777b9 (patch) | |
tree | e0c6dfa5e00b70ab1300712b27ae395449c46cbb /tools | |
parent | b4c6a042c3f5661a0a454acd49f48bd35afb35bb (diff) | |
download | chromium_src-d0d1bcbae0fbf648f549b1d397eb6575d91777b9.zip chromium_src-d0d1bcbae0fbf648f549b1d397eb6575d91777b9.tar.gz chromium_src-d0d1bcbae0fbf648f549b1d397eb6575d91777b9.tar.bz2 |
Breakdown "unhooked" memory regions by VMA pathnames and permissions.
BUG=244163
R=bulach@chromium.org, glider@chromium.org, peria@chromium.org
Review URL: https://codereview.chromium.org/15511005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r-- | tools/deep_memory_profiler/dmprof.py | 134 | ||||
-rw-r--r-- | tools/deep_memory_profiler/policy.android.browser.json | 90 | ||||
-rw-r--r-- | tools/deep_memory_profiler/policy.android.renderer.json | 88 | ||||
-rw-r--r-- | tools/deep_memory_profiler/policy.l0.json | 23 | ||||
-rw-r--r-- | tools/deep_memory_profiler/policy.l1.json | 23 | ||||
-rw-r--r-- | tools/deep_memory_profiler/policy.l2.json | 21 | ||||
-rw-r--r-- | tools/deep_memory_profiler/policy.sourcefile.json | 23 | ||||
-rw-r--r-- | tools/deep_memory_profiler/policy.t0.json | 23 | ||||
-rwxr-xr-x | tools/deep_memory_profiler/tests/dmprof_test.py | 6 |
9 files changed, 325 insertions, 106 deletions
diff --git a/tools/deep_memory_profiler/dmprof.py b/tools/deep_memory_profiler/dmprof.py index af32bfa..2726ae8 100644 --- a/tools/deep_memory_profiler/dmprof.py +++ b/tools/deep_memory_profiler/dmprof.py @@ -377,12 +377,14 @@ class Rule(object): def __init__(self, name, - mmap, + allocator_type, stackfunction_pattern=None, stacksourcefile_pattern=None, - typeinfo_pattern=None): + typeinfo_pattern=None, + mappedpathname_pattern=None, + mappedpermission_pattern=None): self._name = name - self._mmap = mmap + self._allocator_type = allocator_type self._stackfunction_pattern = None if stackfunction_pattern: @@ -398,13 +400,22 @@ class Rule(object): if typeinfo_pattern: self._typeinfo_pattern = re.compile(typeinfo_pattern + r'\Z') + self._mappedpathname_pattern = None + if mappedpathname_pattern: + self._mappedpathname_pattern = re.compile(mappedpathname_pattern + r'\Z') + + self._mappedpermission_pattern = None + if mappedpermission_pattern: + self._mappedpermission_pattern = re.compile( + mappedpermission_pattern + r'\Z') + @property def name(self): return self._name @property - def mmap(self): - return self._mmap + def allocator_type(self): + return self._allocator_type @property def stackfunction_pattern(self): @@ -418,6 +429,14 @@ class Rule(object): def typeinfo_pattern(self): return self._typeinfo_pattern + @property + def mappedpathname_pattern(self): + return self._mappedpathname_pattern + + @property + def mappedpermission_pattern(self): + return self._mappedpermission_pattern + class Policy(object): """Represents a policy, a content of a policy file.""" @@ -460,7 +479,7 @@ class Policy(object): typeinfo = bucket.typeinfo_name for rule in self._rules: - if (bucket.mmap == rule.mmap and + if (bucket.allocator_type == rule.allocator_type and (not rule.stackfunction_pattern or rule.stackfunction_pattern.match(stackfunction)) and (not rule.stacksourcefile_pattern or @@ -471,6 +490,22 @@ class Policy(object): assert False + def find_unhooked(self, region): + for rule in self._rules: + if (region[0] == 'unhooked' and + rule.allocator_type == 'unhooked' and + (not rule.mappedpathname_pattern or + rule.mappedpathname_pattern.match(region[1]['vma']['name'])) and + (not rule.mappedpermission_pattern or + rule.mappedpermission_pattern.match( + region[1]['vma']['readable'] + + region[1]['vma']['writable'] + + region[1]['vma']['executable'] + + region[1]['vma']['private']))): + return rule.name + + assert False + @staticmethod def load(filename, filetype): """Loads a policy file of |filename| in a |format|. @@ -525,10 +560,12 @@ class Policy(object): stacksourcefile = rule.get('stacksourcefile') rules.append(Rule( rule['name'], - rule['allocator'] == 'mmap', + rule['allocator'], # allocator_type stackfunction, stacksourcefile, - rule['typeinfo'] if 'typeinfo' in rule else None)) + rule['typeinfo'] if 'typeinfo' in rule else None, + rule.get('mappedpathname'), + rule.get('mappedpermission'))) return Policy(rules, policy['version'], policy['components']) @@ -598,9 +635,9 @@ class PolicySet(object): class Bucket(object): """Represents a bucket, which is a unit of memory block classification.""" - def __init__(self, stacktrace, mmap, typeinfo, typeinfo_name): + def __init__(self, stacktrace, allocator_type, typeinfo, typeinfo_name): self._stacktrace = stacktrace - self._mmap = mmap + self._allocator_type = allocator_type self._typeinfo = typeinfo self._typeinfo_name = typeinfo_name @@ -614,7 +651,7 @@ class Bucket(object): def __str__(self): result = [] - result.append('mmap' if self._mmap else 'malloc') + result.append(self._allocator_type) if self._symbolized_typeinfo == 'no typeinfo': result.append('tno_typeinfo') else: @@ -659,8 +696,8 @@ class Bucket(object): return self._stacktrace @property - def mmap(self): - return self._mmap + def allocator_type(self): + return self._allocator_type @property def typeinfo(self): @@ -740,7 +777,7 @@ class BucketSet(object): for frame in stacktrace: self._code_addresses.add(frame) self._buckets[int(words[0])] = Bucket( - stacktrace, words[1] == 'mmap', typeinfo, typeinfo_name) + stacktrace, words[1], typeinfo, typeinfo_name) def __iter__(self): for bucket_id, bucket_content in self._buckets.iteritems(): @@ -778,6 +815,14 @@ class Dump(object): r'^ ([ \(])([a-f0-9]+)([ \)])-([ \(])([a-f0-9]+)([ \)])\s+' r'(hooked|unhooked)\s+(.+)$', re.IGNORECASE) + _HOOKED_PATTERN = re.compile(r'(?P<TYPE>.+ )?(?P<COMMITTED>[0-9]+) / ' + '(?P<RESERVED>[0-9]+) @ (?P<BUCKETID>[0-9]+)') + _UNHOOKED_PATTERN = re.compile(r'(?P<TYPE>.+ )?(?P<COMMITTED>[0-9]+) / ' + '(?P<RESERVED>[0-9]+)') + + _OLD_HOOKED_PATTERN = re.compile(r'(?P<TYPE>.+) @ (?P<BUCKETID>[0-9]+)') + _OLD_UNHOOKED_PATTERN = re.compile(r'(?P<TYPE>.+) (?P<COMMITTED>[0-9]+)') + _TIME_PATTERN_FORMAT = re.compile( r'^Time: ([0-9]+/[0-9]+/[0-9]+ [0-9]+:[0-9]+:[0-9]+)(\.[0-9]+)?') _TIME_PATTERN_SECONDS = re.compile(r'^Time: ([0-9]+)$') @@ -960,12 +1005,15 @@ class Dump(object): ln += 1 self._map = {} + current_vma = dict() while True: entry = proc_maps.ProcMaps.parse_line(self._lines[ln]) if entry: + current_vma = dict() for _, _, attr in self._procmaps.iter_range(entry.begin, entry.end): for key, value in entry.as_dict().iteritems(): attr[key] = value + current_vma[key] = value ln += 1 continue matched = self._HOOK_PATTERN.match(self._lines[ln]) @@ -975,9 +1023,30 @@ class Dump(object): # 5: end address # 7: hooked or unhooked # 8: additional information + if matched.group(7) == 'hooked': + submatched = self._HOOKED_PATTERN.match(matched.group(8)) + if not submatched: + submatched = self._OLD_HOOKED_PATTERN.match(matched.group(8)) + elif matched.group(7) == 'unhooked': + submatched = self._UNHOOKED_PATTERN.match(matched.group(8)) + if not submatched: + submatched = self._OLD_UNHOOKED_PATTERN.match(matched.group(8)) + else: + assert matched.group(7) in ['hooked', 'unhooked'] + + submatched_dict = submatched.groupdict() + region_info = { 'vma': current_vma } + if 'TYPE' in submatched_dict: + region_info['type'] = submatched_dict['TYPE'].strip() + if 'COMMITTED' in submatched_dict: + region_info['committed'] = int(submatched_dict['COMMITTED']) + if 'RESERVED' in submatched_dict: + region_info['reserved'] = int(submatched_dict['RESERVED']) + if 'BUCKETID' in submatched_dict: + region_info['bucket_id'] = int(submatched_dict['BUCKETID']) + self._map[(int(matched.group(2), 16), - int(matched.group(5), 16))] = (matched.group(7), - matched.group(8)) + int(matched.group(5), 16))] = (matched.group(7), region_info) ln += 1 def _extract_stacktrace_lines(self, line_number): @@ -1290,6 +1359,7 @@ class PolicyCommands(Command): sizes = dict((c, 0) for c in policy.components) PolicyCommands._accumulate(dump, policy, bucket_set, sizes) + PolicyCommands._accumulate_maps(dump, policy, sizes) sizes['mmap-no-log'] = ( dump.global_stat('profiled-mmap_committed') - @@ -1304,6 +1374,10 @@ class PolicyCommands(Command): sizes['tc-unused'] = ( sizes['mmap-tcmalloc'] - dump.global_stat('profiled-malloc_committed')) + if sizes['tc-unused'] < 0: + LOGGER.warn(' Assuming tc-unused=0 as it is negative: %d (bytes)' % + sizes['tc-unused']) + sizes['tc-unused'] = 0 sizes['tc-total'] = sizes['mmap-tcmalloc'] for key, value in { @@ -1316,11 +1390,6 @@ class PolicyCommands(Command): 'stack': 'stack_committed', 'other': 'other_committed', 'unhooked-absent': 'nonprofiled-absent_committed', - 'unhooked-anonymous': 'nonprofiled-anonymous_committed', - 'unhooked-file-exec': 'nonprofiled-file-exec_committed', - 'unhooked-file-nonexec': 'nonprofiled-file-nonexec_committed', - 'unhooked-stack': 'nonprofiled-stack_committed', - 'unhooked-other': 'nonprofiled-other_committed', 'total-vm': 'total_virtual', 'filemapped-vm': 'file_virtual', 'anonymous-vm': 'anonymous_virtual', @@ -1368,6 +1437,13 @@ class PolicyCommands(Command): else: sizes['other-total-log'] += int(words[COMMITTED]) + @staticmethod + def _accumulate_maps(dump, policy, sizes): + for _, value in dump.iter_map: + if value[0] == 'unhooked': + component_match = policy.find_unhooked(value) + sizes[component_match] += int(value[1]['committed']) + class CSVCommand(PolicyCommands): def __init__(self): @@ -1514,16 +1590,18 @@ class MapCommand(Command): if not x: out.write('None\n') elif x[0] == 'hooked': - attrs = x[1].split() - assert len(attrs) == 3 - bucket_id = int(attrs[2]) + region_info = x[1] + bucket_id = region_info['bucket_id'] bucket = bucket_set.get(bucket_id) component = policy.find(bucket) - out.write('hooked %s: %s @ %d\n' % (attrs[0], component, bucket_id)) + out.write('hooked %s: %s @ %d\n' % ( + region_info['type'] if 'type' in region_info else 'None', + component, bucket_id)) else: - attrs = x[1].split() - size = int(attrs[1]) - out.write('unhooked %s: %d bytes committed\n' % (attrs[0], size)) + region_info = x[1] + size = region_info['committed'] + out.write('unhooked %s: %d bytes committed\n' % ( + region_info['type'] if 'type' in region_info else 'None', size)) class ExpandCommand(Command): diff --git a/tools/deep_memory_profiler/policy.android.browser.json b/tools/deep_memory_profiler/policy.android.browser.json index 143f3ea..e34fee7 100644 --- a/tools/deep_memory_profiler/policy.android.browser.json +++ b/tools/deep_memory_profiler/policy.android.browser.json @@ -7,8 +7,19 @@ "FROM_HERE_FOR_TOTAL", "mustbezero", "unhooked-absent", + "unhooked-ashmem-dalvik-heap", + "unhooked-ashmem-dalvik-LinearAlloc", + "unhooked-ashmem-dalvik-aux-structure", + "unhooked-ashmem-dalvik-bitmap", + "unhooked-ashmem-dalvik-other", + "unhooked-pvrsrvkm", + "unhooked-system-dex", + "unhooked-chrome-dex", + "unhooked-other-ashmem", "unhooked-anonymous", + "unhooked-file-exec-lib-chrome", "unhooked-file-exec", + "unhooked-file-nonexec-lib-chrome", "unhooked-file-nonexec", "unhooked-stack", "unhooked-other", @@ -84,29 +95,86 @@ "allocator": "optional" }, { + "name": "unhooked-ashmem-dalvik-heap", + "mappedpathname": "/dev/ashmem/dalvik-heap.*", + "allocator": "unhooked" + }, + { + "name": "unhooked-ashmem-dalvik-LinearAlloc", + "mappedpathname": "/dev/ashmem/dalvik-LinearAlloc.*", + "allocator": "unhooked" + }, + { + "name": "unhooked-ashmem-dalvik-aux-structure", + "mappedpathname": "/dev/ashmem/dalvik-aux-structure.*", + "allocator": "unhooked" + }, + { + "name": "unhooked-ashmem-dalvik-bitmap", + "mappedpathname": "/dev/ashmem/dalvik-bitmap.*", + "allocator": "unhooked" + }, + { + "name": "unhooked-ashmem-dalvik-other", + "mappedpathname": "/dev/ashmem/dalvik.*", + "allocator": "unhooked" + }, + { + "name": "unhooked-pvrsrvkm", + "mappedpathname": "/dev/pvrsrvkm.*", + "allocator": "unhooked" + }, + { + "name": "unhooked-system-dex", + "mappedpathname": "/data/dalvik-cache/system.*.dex.*", + "allocator": "unhooked" + }, + { + "name": "unhooked-chrome-dex", + "mappedpathname": "^/.*?(chrome|content).*?apk@classes.dex", + "allocator": "unhooked" + }, + { + "name": "unhooked-other-ashmem", + "mappedpathname": "/dev/ashmem/.*", + "allocator": "unhooked" + }, + { "name": "unhooked-anonymous", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^$", + "allocator": "unhooked" + }, + { + "name": "unhooked-file-exec-lib-chrome", + "mappedpathname": "^/.*?(chromeview|content).*", + "mappedpermission": "..x.", + "allocator": "unhooked" }, { "name": "unhooked-file-exec", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^/.*", + "mappedpermission": "..x.", + "allocator": "unhooked" + }, + { + "name": "unhooked-file-nonexec-lib-chrome", + "mappedpathname": "^/.*?(chromeview|content).*", + "allocator": "unhooked" }, { "name": "unhooked-file-nonexec", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^/.*", + "allocator": "unhooked" }, { "name": "unhooked-stack", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": ".stack.", + "allocator": "unhooked" }, { "name": "unhooked-other", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": ".*", + "allocator": "unhooked" }, { "name": "mmap-gpu-transferbuffer", @@ -230,4 +298,4 @@ } ], "version": "POLICY_DEEP_3" -}
\ No newline at end of file +} diff --git a/tools/deep_memory_profiler/policy.android.renderer.json b/tools/deep_memory_profiler/policy.android.renderer.json index 2a5d2b9..dc1e3b5 100644 --- a/tools/deep_memory_profiler/policy.android.renderer.json +++ b/tools/deep_memory_profiler/policy.android.renderer.json @@ -7,8 +7,19 @@ "FROM_HERE_FOR_TOTAL", "mustbezero", "unhooked-absent", + "unhooked-ashmem-dalvik-heap", + "unhooked-ashmem-dalvik-LinearAlloc", + "unhooked-ashmem-dalvik-aux-structure", + "unhooked-ashmem-dalvik-bitmap", + "unhooked-ashmem-dalvik-other", + "unhooked-pvrsrvkm", + "unhooked-system-dex", + "unhooked-chrome-dex", + "unhooked-other-ashmem", "unhooked-anonymous", + "unhooked-file-exec-lib-chrome", "unhooked-file-exec", + "unhooked-file-nonexec-lib-chrome", "unhooked-file-nonexec", "unhooked-stack", "unhooked-other", @@ -111,29 +122,86 @@ "allocator": "optional" }, { + "name": "unhooked-ashmem-dalvik-heap", + "mappedpathname": "/dev/ashmem/dalvik-heap.*", + "allocator": "unhooked" + }, + { + "name": "unhooked-ashmem-dalvik-LinearAlloc", + "mappedpathname": "/dev/ashmem/dalvik-LinearAlloc.*", + "allocator": "unhooked" + }, + { + "name": "unhooked-ashmem-dalvik-aux-structure", + "mappedpathname": "/dev/ashmem/dalvik-aux-structure.*", + "allocator": "unhooked" + }, + { + "name": "unhooked-ashmem-dalvik-bitmap", + "mappedpathname": "/dev/ashmem/dalvik-bitmap.*", + "allocator": "unhooked" + }, + { + "name": "unhooked-ashmem-dalvik-other", + "mappedpathname": "/dev/ashmem/dalvik.*", + "allocator": "unhooked" + }, + { + "name": "unhooked-pvrsrvkm", + "mappedpathname": "/dev/pvrsrvkm.*", + "allocator": "unhooked" + }, + { + "name": "unhooked-system-dex", + "mappedpathname": "/data/dalvik-cache/system.*.dex.*", + "allocator": "unhooked" + }, + { + "name": "unhooked-chrome-dex", + "mappedpathname": "^/.*?(chrome|content).*?apk@classes.dex", + "allocator": "unhooked" + }, + { + "name": "unhooked-other-ashmem", + "mappedpathname": "/dev/ashmem/.*", + "allocator": "unhooked" + }, + { "name": "unhooked-anonymous", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^$", + "allocator": "unhooked" + }, + { + "name": "unhooked-file-exec-lib-chrome", + "mappedpathname": "^/.*?(chromeview|content).*", + "mappedpermission": "..x.", + "allocator": "unhooked" }, { "name": "unhooked-file-exec", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^/.*", + "mappedpermission": "..x.", + "allocator": "unhooked" + }, + { + "name": "unhooked-file-nonexec-lib-chrome", + "mappedpathname": "^/.*?(chromeview|content).*", + "allocator": "unhooked" }, { "name": "unhooked-file-nonexec", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^/.*", + "allocator": "unhooked" }, { "name": "unhooked-stack", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": ".stack.", + "allocator": "unhooked" }, { "name": "unhooked-other", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": ".*", + "allocator": "unhooked" }, { "name": "mmap-v8-heap-newspace", diff --git a/tools/deep_memory_profiler/policy.l0.json b/tools/deep_memory_profiler/policy.l0.json index c5351d2..14eeb9f 100644 --- a/tools/deep_memory_profiler/policy.l0.json +++ b/tools/deep_memory_profiler/policy.l0.json @@ -73,28 +73,29 @@ }, { "name": "unhooked-anonymous", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^$", + "allocator": "unhooked" }, { "name": "unhooked-file-exec", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^/.*", + "mappedpermission": "..x.", + "allocator": "unhooked" }, { "name": "unhooked-file-nonexec", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^/.*", + "allocator": "unhooked" }, { "name": "unhooked-stack", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": ".stack.", + "allocator": "unhooked" }, { "name": "unhooked-other", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": ".*", + "allocator": "unhooked" }, { "name": "mmap-v8", @@ -158,4 +159,4 @@ } ], "version": "POLICY_DEEP_3" -}
\ No newline at end of file +} diff --git a/tools/deep_memory_profiler/policy.l1.json b/tools/deep_memory_profiler/policy.l1.json index 8b36bb8..599c540 100644 --- a/tools/deep_memory_profiler/policy.l1.json +++ b/tools/deep_memory_profiler/policy.l1.json @@ -80,28 +80,29 @@ }, { "name": "unhooked-anonymous", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^$", + "allocator": "unhooked" }, { "name": "unhooked-file-exec", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^/.*", + "mappedpermission": "..x.", + "allocator": "unhooked" }, { "name": "unhooked-file-nonexec", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^/.*", + "allocator": "unhooked" }, { "name": "unhooked-stack", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": ".stack.", + "allocator": "unhooked" }, { "name": "unhooked-other", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": ".*", + "allocator": "unhooked" }, { "name": "mmap-v8-heap-newspace", @@ -200,4 +201,4 @@ } ], "version": "POLICY_DEEP_3" -}
\ No newline at end of file +} diff --git a/tools/deep_memory_profiler/policy.l2.json b/tools/deep_memory_profiler/policy.l2.json index d5e7f7a..5f8e473 100644 --- a/tools/deep_memory_profiler/policy.l2.json +++ b/tools/deep_memory_profiler/policy.l2.json @@ -107,28 +107,29 @@ }, { "name": "unhooked-anonymous", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^$", + "allocator": "unhooked" }, { "name": "unhooked-file-exec", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^/.*", + "mappedpermission": "..x.", + "allocator": "unhooked" }, { "name": "unhooked-file-nonexec", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^/.*", + "allocator": "unhooked" }, { "name": "unhooked-stack", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": ".stack.", + "allocator": "unhooked" }, { "name": "unhooked-other", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": ".*", + "allocator": "unhooked" }, { "name": "mmap-v8-heap-newspace", diff --git a/tools/deep_memory_profiler/policy.sourcefile.json b/tools/deep_memory_profiler/policy.sourcefile.json index 9d46978..7a037e5 100644 --- a/tools/deep_memory_profiler/policy.sourcefile.json +++ b/tools/deep_memory_profiler/policy.sourcefile.json @@ -77,28 +77,29 @@ }, { "name": "unhooked-anonymous", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^$", + "allocator": "unhooked" }, { "name": "unhooked-file-exec", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^/.*", + "mappedpermission": "..x.", + "allocator": "unhooked" }, { "name": "unhooked-file-nonexec", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^/.*", + "allocator": "unhooked" }, { "name": "unhooked-stack", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": ".stack.", + "allocator": "unhooked" }, { "name": "unhooked-other", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": ".*", + "allocator": "unhooked" }, { "name": "mmap-v8", @@ -182,4 +183,4 @@ } ], "version": "POLICY_DEEP_3" -}
\ No newline at end of file +} diff --git a/tools/deep_memory_profiler/policy.t0.json b/tools/deep_memory_profiler/policy.t0.json index aab8715..fd716ba 100644 --- a/tools/deep_memory_profiler/policy.t0.json +++ b/tools/deep_memory_profiler/policy.t0.json @@ -79,28 +79,29 @@ }, { "name": "unhooked-anonymous", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^$", + "allocator": "unhooked" }, { "name": "unhooked-file-exec", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^/.*", + "mappedpermission": "..x.", + "allocator": "unhooked" }, { "name": "unhooked-file-nonexec", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": "^/.*", + "allocator": "unhooked" }, { "name": "unhooked-stack", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": ".stack.", + "allocator": "unhooked" }, { "name": "unhooked-other", - "stacktrace": "optional", - "allocator": "optional" + "mappedpathname": ".*", + "allocator": "unhooked" }, { "name": "mmap-v8", @@ -201,4 +202,4 @@ } ], "version": "POLICY_DEEP_4" -}
\ No newline at end of file +} diff --git a/tools/deep_memory_profiler/tests/dmprof_test.py b/tools/deep_memory_profiler/tests/dmprof_test.py index 794927fe..c146b0a 100755 --- a/tools/deep_memory_profiler/tests/dmprof_test.py +++ b/tools/deep_memory_profiler/tests/dmprof_test.py @@ -176,11 +176,11 @@ class PolicyTest(unittest.TestCase): symbol_mapping_cache.add(FUNCTION_SYMBOLS, 0x1212, 'v8::create') symbol_mapping_cache.add(FUNCTION_SYMBOLS, 0x1381, 'WebKit::create') - bucket1 = dmprof.Bucket([0x1212, 0x013], False, 0x29492, '_Z') + bucket1 = dmprof.Bucket([0x1212, 0x013], 'malloc', 0x29492, '_Z') bucket1.symbolize(symbol_mapping_cache) - bucket2 = dmprof.Bucket([0x18242, 0x1381], False, 0x9492, '_Z') + bucket2 = dmprof.Bucket([0x18242, 0x1381], 'malloc', 0x9492, '_Z') bucket2.symbolize(symbol_mapping_cache) - bucket3 = dmprof.Bucket([0x18242, 0x181], False, 0x949, '_Z') + bucket3 = dmprof.Bucket([0x18242, 0x181], 'malloc', 0x949, '_Z') bucket3.symbolize(symbol_mapping_cache) self.assertEqual('malloc-v8', policy.find(bucket1)) |