| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 import re | 7 import re |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 from sets import Set | 10 from sets import Set |
| 11 | 11 |
| 12 | 12 |
| 13 _ENTRIES = [ | 13 _ENTRIES = [ |
| 14 ('Total', '.* r... .*'), | 14 ('Total', '.* r... .*'), |
| 15 ('Read-only', '.* r--. .*'), | 15 ('Read-only', '.* r--. .*'), |
| 16 ('Read-write', '.* rw-. .*'), | 16 ('Read-write', '.* rw-. .*'), |
| 17 ('Executable', '.* ..x. .*'), | 17 ('Executable', '.* ..x. .*'), |
| 18 ('File read-write', '.* rw.. .* /.*'), | 18 ('File read-write', '.* rw.. .* /.*'), |
| 19 ('Anonymous read-write', '.* rw.. .* .*other=[0-9]+ ($|.*chromium:.*)'), | 19 ('Anonymous read-write', '.* rw.. .* .*other=[0-9]+ ($|.*chromium:.*)'), |
| 20 ('File executable', '.* ..x. .* /.*'), | 20 ('File executable', '.* ..x. .* /.*'), |
| 21 ('Anonymous executable (JIT\'ed code)', '.* ..x. .* shared_other=[0-9]+ $'), | 21 ('Anonymous executable (JIT\'ed code)', '.* ..x. .* shared_other=[0-9]+ $'), |
| 22 ('chromium mmap', '.* r... .*chromium:.*'), | 22 ('chromium mmap', '.* r... .*chromium:.*'), |
| 23 ('chromium TransferBuffer', '.* r... .*chromium:.*CreateTransferBuffer.*'), | 23 ('chromium TransferBuffer', '.* r... .*chromium:.*CreateTransferBuffer.*'), |
| 24 ('Galaxy Nexus GL driver', '.* r... .*pvrsrvkm.*'), | 24 ('Galaxy Nexus GL driver', '.* r... .*pvrsrvkm.*'), |
| 25 ('Dalvik', '.* rw.. .* /.*dalvik.*'), | 25 ('Dalvik', '.* rw.. .* /.*dalvik.*'), |
| 26 ('Dalvik heap', '.* rw.. .* /.*dalvik-heap.*'), | 26 ('Dalvik heap', '.* rw.. .* /.*dalvik-heap.*'), |
| 27 ('Native heap (jemalloc)', '.* r... .* /.*jemalloc.*'), | 27 ('Native heap (jemalloc)', '.* r... .* /.*jemalloc.*'), |
| 28 ('Native heap (dlmalloc)', '.* r... .* /.*dlmalloc.*'), |
| 28 ('System heap', '.* r... .* \\[heap\\]'), | 29 ('System heap', '.* r... .* \\[heap\\]'), |
| 29 ('Ashmem', '.* rw.. .* /dev/ashmem .*'), | 30 ('Ashmem', '.* rw.. .* /dev/ashmem .*'), |
| 30 ('libchromeview.so total', '.* r... .* /.*libchromeview.so'), | 31 ('libchromeview.so total', '.* r... .* /.*libchromeview.so'), |
| 31 ('libchromeview.so read-only', '.* r--. .* /.*libchromeview.so'), | 32 ('libchromeview.so read-only', '.* r--. .* /.*libchromeview.so'), |
| 32 ('libchromeview.so read-write', '.* rw-. .* /.*libchromeview.so'), | 33 ('libchromeview.so read-write', '.* rw-. .* /.*libchromeview.so'), |
| 33 ('libchromeview.so executable', '.* r.x. .* /.*libchromeview.so'), | 34 ('libchromeview.so executable', '.* r.x. .* /.*libchromeview.so'), |
| 34 ] | 35 ] |
| 35 | 36 |
| 36 | 37 |
| 37 def _CollectMemoryStats(memdump, region_filters): | 38 def _CollectMemoryStats(memdump, region_filters): |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 print ',' + k + ',' + _ConvertMemoryField(total_map[v]) + ',' | 100 print ',' + k + ',' + _ConvertMemoryField(total_map[v]) + ',' |
| 100 print '' | 101 print '' |
| 101 | 102 |
| 102 | 103 |
| 103 def main(argv): | 104 def main(argv): |
| 104 _DumpCSV(_CollectMemoryStats(sys.stdin, [value for (key, value) in _ENTRIES])) | 105 _DumpCSV(_CollectMemoryStats(sys.stdin, [value for (key, value) in _ENTRIES])) |
| 105 | 106 |
| 106 | 107 |
| 107 if __name__ == '__main__': | 108 if __name__ == '__main__': |
| 108 main(sys.argv) | 109 main(sys.argv) |
| OLD | NEW |