OLD | NEW |
| 1 ******************************************************************************** |
| 2 Entering interactive Python shell. Quick reference: |
| 3 |
| 4 SizeInfo: Cluster, metadata, section_sizes, symbols |
| 5 Symbol: FlagsString, IsBss, IsGeneratedByToolchain, IsGroup, address, aliases, e
nd_address, flags, full_name, generated_source, is_anonymous, name, num_aliases,
object_path, padding, pss, pss_without_padding, section, section_name, size, si
ze_without_padding, source_path |
| 6 |
| 7 SymbolGroup (extends Symbol): Cluster, CountUniqueSymbols, Filter, GroupBy, Grou
pByNamespace, GroupByPath, GroupBySectionName, Inverted, IterUniqueSymbols, Sort
ed, SortedByAddress, SortedByCount, SortedByName, WhereAddressInRange, WhereBigg
erThan, WhereFullNameMatches, WhereGeneratedByToolchain, WhereHasAnyAttribution,
WhereHasPath, WhereInSection, WhereMatches, WhereNameMatches, WhereObjectPathMa
tches, WherePathMatches, WhereSourceIsGenerated, WhereSourcePathMatches, is_sort
ed |
| 8 |
| 9 SymbolDiff (extends SymbolGroup): IsAdded, IsRemoved, IsSimilar, WhereNotUnchang
ed, added_count, changed_count, removed_count, unchanged_count |
| 10 |
| 11 Functions: CategorizeByChromeComponent(), CategorizeGenerated(), Diff(), Disasse
mble(), ExpandRegex(), Print(), ShowExamples() |
| 12 Variables: size_info |
| 13 ******************************************************************************** |
1 # Show pydoc for main types: | 14 # Show pydoc for main types: |
2 import models | 15 import models |
3 help(models) | 16 help(models) |
4 | 17 |
5 # Show all attributes of all symbols & per-section totals: | 18 # Show all attributes of all symbols & per-section totals: |
6 Print(size_info, verbose=True) | 19 Print(size_info, verbose=True) |
7 | 20 |
8 # Show two levels of .text, grouped by first two subdirectories | 21 # Show two levels of .text, grouped by first two subdirectories |
9 text_syms = size_info.symbols.WhereInSection("t") | 22 text_syms = size_info.symbols.WhereInSection("t") |
10 by_path = text_syms.GroupBySourcePath(depth=2) | 23 by_path = text_syms.GroupByPath(depth=2) |
11 Print(by_path.WhereBiggerThan(1024)) | 24 Print(by_path.WhereBiggerThan(1024)) |
12 | 25 |
13 # Show all non-vtable generated symbols | 26 # Show all non-vtable generated symbols |
14 generated_syms = size_info.symbols.WhereIsGenerated() | 27 generated_syms = size_info.symbols.WhereGeneratedByToolchain() |
15 Print(generated_syms.WhereNameMatches(r"vtable").Inverted()) | 28 Print(generated_syms.WhereNameMatches(r"vtable").Inverted().Sorted()) |
16 | 29 |
17 # Show all symbols that have "print" in their name or path, except | 30 # Show all symbols that have "print" in their name or path, except |
18 # those within components/. | 31 # those within components/. |
19 # Note: Could have also used Inverted(), as above. | 32 # Note: Could have also used Inverted(), as above. |
20 # Note: Use "help(ExpandRegex)" for more about what {{_print_}} does. | 33 # Note: Use "help(ExpandRegex)" for more about what {{_print_}} does. |
21 print_syms = size_info.symbols.WhereMatches(r"{{_print_}}") | 34 print_syms = size_info.symbols.WhereMatches(r"{{_print_}}") |
22 Print(print_syms - print_syms.WherePathMatches(r"^components/")) | 35 Print(print_syms - print_syms.WherePathMatches(r"^components/")) |
23 | 36 |
24 # Diff two .size files and save result to a file: | 37 # Diff two .size files and save result to a file: |
25 Print(Diff(size_info1, size_info2), to_file="output.txt") | 38 Print(Diff(size_info1, size_info2), to_file="output.txt") |
26 | 39 |
| 40 # View per-component breakdowns, then inspect the "other" subgroup. |
| 41 c = GroupByChromeComponent() |
| 42 Print(c) |
| 43 Print(c[-1].GroupByPath(depth=2)) |
27 Metadata: | 44 Metadata: |
28 elf_arch=ARM | 45 elf_arch=ARM |
29 elf_build_id=WhatAnAmazingBuildId | 46 elf_build_id=WhatAnAmazingBuildId |
30 elf_file_name=elf | 47 elf_file_name=elf |
31 elf_mtime={redacted} | 48 elf_mtime={redacted} |
32 git_revision=abc123 | 49 git_revision=abc123 |
33 gn_args=var1=true var2="foo" | 50 gn_args=var1=true var2="foo" |
34 map_file_name=../test.map | 51 map_file_name=../test.map |
35 | 52 |
36 Section Sizes (Total=43,785,380 bytes): | 53 Section Sizes (Total=43,785,380 bytes): |
37 .bss: 1,300,456 bytes (not included in totals) | 54 .bss: 1,300,456 bytes (not included in totals) |
38 .data: 101,768 bytes (0.2%) | 55 .data: 101,768 bytes (0.2%) |
39 .data.rel.ro: 1,065,224 bytes (2.4%) | 56 .data.rel.ro: 1,065,224 bytes (2.4%) |
40 .data.rel.ro.local: 790,024 bytes (1.8%) | 57 .data.rel.ro.local: 790,024 bytes (1.8%) |
41 .rodata: 5,927,652 bytes (13.5%) | 58 .rodata: 5,927,652 bytes (13.5%) |
42 .text: 35,900,712 bytes (82.0%) | 59 .text: 35,900,712 bytes (82.0%) |
43 | 60 |
44 Showing 48 symbols (45 unique) with total pss: 44309900 bytes | 61 Showing 48 symbols (45 unique) with total pss: 44309900 bytes |
45 .text=34.2mb .rodata=5.65mb other=2.37mb total=42.3mb | 62 .text=34.2mb .rodata=5.65mb other=2.37mb total=42.3mb |
46 Number of object files: 10 | 63 Number of object files: 10 |
47 | 64 |
48 First columns are: running total, address, pss | 65 Index, Running Total, Section@Address, PSS |
49 35821002 t@0x24ca628 35821002 {no path} | 66 ------------------------------------------------------------ |
| 67 0) 0 (0.0%) b@0x0 262144 third_party/fft_float.cc |
| 68 ff_cos_131072 |
| 69 1) 0 (0.0%) b@0x0 131072 third_party/fft_fixed.cc |
| 70 ff_cos_131072_fixed |
| 71 2) 0 (0.0%) b@0x0 131072 third_party/fft_float.cc |
| 72 ff_cos_65536 |
| 73 3) 0 (0.0%) b@0x2dffda0 28 third_party/icu/ucnv_ext.c |
| 74 g_chrome_content_browser_client |
| 75 4) 0 (0.0%) b@0x2dffe80 200 third_party/icu/ucnv_ext.c |
| 76 SaveHistogram::atomic_histogram_pointer |
| 77 5) 0 (0.0%) b@0x2dffe84 4 third_party/icu/ucnv_ext.c |
| 78 g_AnimationFrameTimeHistogram_clazz |
| 79 6) 4 (0.0%) d@0x2de7000 4 base/page_allocator.cc |
| 80 google::protobuf::internal::pLinuxKernelCmpxchg |
| 81 7) 8 (0.0%) d@0x2de7004 4 third_party/container.c |
| 82 google::protobuf::internal::pLinuxKernelMemoryBarrier |
| 83 8) 160 (0.0%) d@0x2de7008 152 third_party/container.c |
| 84 base::android::kBaseRegisteredMethods |
| 85 9) 164 (0.0%) d@0x2de70a0 4 third_party/container.c |
| 86 base::android::g_renderer_histogram_code |
| 87 10) 168 (0.0%) d@0x2de70a4 4 third_party/container.c |
| 88 base::android::g_library_version_number |
| 89 11) 101768 (0.2%) d@0x2dffd88 101600 {no path} |
| 90 ** symbol gap 3 (end of section) |
| 91 12) 101824 (0.2%) d@0x2cd8500 56 third_party/paint.cc |
| 92 ChromeMainDelegateAndroid [vtable] |
| 93 13) 101848 (0.2%) d@0x2cd8538 24 base/page_allocator.cc |
| 94 mojo::MessageReceiver [vtable] |
| 95 14) 101860 (0.2%) d@0x2cd8550 12 base/page_allocator.cc |
| 96 kMethodsAnimationFrameTimeHistogram |
| 97 15) 1166992 (2.6%) d@0x2ddc608 1065132 {no path} |
| 98 ** symbol gap 3 (end of section) |
| 99 16) 1167048 (2.6%) d@0x2c176f0 56 third_party/icu/ucnv_ext.c |
| 100 ChromeMainDelegate [vtable] |
| 101 17) 1167072 (2.6%) d@0x2c17728 24 third_party/icu/ucnv_ext.c |
| 102 chrome::mojom::FieldTrialRecorder [vtable] |
| 103 18) 1956976 (4.4%) d@0x2c17740 789904 third_party/container.c |
| 104 chrome::mojom::FieldTrialRecorderProxy [vtable] |
| 105 19) 1957008 (4.4%) d@0x2cd84e0 32 third_party/gvr-android-sdk/libgvr_sh
im_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o |
| 106 .Lswitch.table.45 |
| 107 20) 1957016 (4.4%) d@0x2cd84f0 8 third_party/gvr-android-sdk/libgvr_sh
im_static_arm.a/libport_android_jni.a_jni_utils.o |
| 108 kSystemClassPrefixes |
| 109 21) 3922425 (8.9%) r@0x266e600 1965409 {no path} |
| 110 ** merge strings |
| 111 22) 3922428 (8.9%) r@0x284e364 3 {no path} |
| 112 ** symbol gap 2 |
| 113 23) 3922436 (8.9%) r@0x284e364 8 base/page_allocator.cc |
| 114 24) 3922480 (8.9%) r@0x284e370 44 base/page_allocator.cc |
| 115 Name |
| 116 25) 3922512 (8.9%) r@0x284e398 32 third_party/container.c |
| 117 chrome::mojom::FilePatcher::Name_ |
| 118 26) 4598497 (10.4%) r@0x284e518 675985 {no path} |
| 119 ** merge strings |
| 120 27) 4598552 (10.4%) r@0x28f3450 55 third_party/paint.cc |
| 121 kAnimationFrameTimeHistogramClassPath |
| 122 28) 4598556 (10.4%) r@0x28f3480 4 third_party/paint.cc |
| 123 blink::CSSValueKeywordsHash::findValueImpl::value_word_list |
| 124 29) 7884668 (17.8%) r@0x2c158e4 3286112 {no path} |
| 125 ** symbol gap 3 (end of section) |
| 126 30) 7884684 (17.8%) t@0x28d900 16 base/page_allocator.cc |
| 127 _GLOBAL__sub_I_page_allocator.cc |
| 128 31) 7884740 (17.8%) t@0x28d910 56 base/page_allocator.cc |
| 129 _GLOBAL__sub_I_bbr_sender.cc |
| 130 32) 7884768 (17.8%) t@0x28d948 28 base/page_allocator.cc |
| 131 _GLOBAL__sub_I_pacing_sender.cc |
| 132 33) 7884806 (17.8%) t@0x28d964 38 base/page_allocator.cc |
| 133 extFromUUseMapping |
| 134 34) 7884838 (17.8%) t@0x28d98a 32 base/page_allocator.cc |
| 135 extFromUUseMapping |
| 136 35) 7890556 (17.8%) t@0x28f000 5718 {no path} |
| 137 ** symbol gap 0 |
| 138 36) 7891004 (17.8%) t@0x28f000 448 third_party/icu/ucnv_ext.c |
| 139 ucnv_extMatchFromU |
| 140 37) 7891032 (17.8%) t@0x28f1c8 28 third_party/icu/ucnv_ext.c |
| 141 _GLOBAL__sub_I_SkDeviceProfile.cpp |
| 142 38) 7960156 (18.0%) t@0x28f1e0 69124 third_party/icu/ucnv_ext.c |
| 143 foo_bar |
| 144 39) 7960180 (18.0%) t@0x2a0000 24 {no path} |
| 145 blink::ContiguousContainerBase::shrinkToFit |
| 146 40) 7960204 (18.0%) t@0x2a0000 24 third_party/icu/ucnv_ext.c |
| 147 BazAlias |
| 148 41) 7960208 (18.0%) t@0x2a0010 4 third_party/{shared}/2 |
| 149 blink::ContiguousContainerBase::shrinkToFit [clone .part.1234] [clo
ne .isra.2] |
| 150 42) 7960212 (18.0%) t@0x2a0010 4 third_party/fft_float.cc |
| 151 FooAlias |
| 152 43) 7960216 (18.0%) t@0x2a0010 4 third_party/fft_float.cc |
| 153 BarAlias |
| 154 44) 7960244 (18.0%) t@0x2a0020 28 third_party/container.c |
| 155 blink::ContiguousContainerBase::ContiguousContainerBase |
| 156 45) 7964284 (18.0%) t@0x2a1000 4040 {no path} |
| 157 ** symbol gap 1 |
| 158 46) 7964378 (18.0%) t@0x2a1000 94 third_party/container.c |
| 159 blink::PaintChunker::releasePaintChunks [clone .part.1] |
| 160 47) 43785380 (98.8%) t@0x24ca628 35821002 {no path} |
50 ** symbol gap 2 (end of section) | 161 ** symbol gap 2 (end of section) |
51 39107114 r@0x2c158e4 3286112 {no path} | |
52 ** symbol gap 3 (end of section) | |
53 41072523 r@0x266e600 1965409 {no path} | |
54 ** merge strings | |
55 42137655 d@0x2ddc608 1065132 {no path} | |
56 ** symbol gap 3 (end of section) | |
57 42927559 d@0x2c17740 789904 third_party/container.c | |
58 chrome::mojom::FieldTrialRecorderProxy [vtable] | |
59 43603544 r@0x284e518 675985 {no path} | |
60 ** merge strings | |
61 43705144 d@0x2dffd88 101600 {no path} | |
62 ** symbol gap 3 (end of section) | |
63 43774268 t@0x28f1e0 69124 third_party/icu/ucnv_ext.c | |
64 foo_bar | |
65 43779986 t@0x28f000 5718 {no path} | |
66 ** symbol gap 0 | |
67 43784026 t@0x2a1000 4040 {no path} | |
68 ** symbol gap 1 | |
69 43784474 t@0x28f000 448 third_party/icu/ucnv_ext.c | |
70 ucnv_extMatchFromU | |
71 43784626 d@0x2de7008 152 third_party/container.c | |
72 base::android::kBaseRegisteredMethods | |
73 43784720 t@0x2a1000 94 third_party/container.c | |
74 blink::PaintChunker::releasePaintChunks [clone .part.1] | |
75 43784776 d@0x2c176f0 56 third_party/icu/ucnv_ext.c | |
76 ChromeMainDelegate [vtable] | |
77 43784832 d@0x2cd8500 56 third_party/paint.cc | |
78 ChromeMainDelegateAndroid [vtable] | |
79 43784888 t@0x28d910 56 base/page_allocator.cc | |
80 _GLOBAL__sub_I_bbr_sender.cc | |
81 43784943 r@0x28f3450 55 third_party/paint.cc | |
82 kAnimationFrameTimeHistogramClassPath | |
83 43784967 t@0x2a0000 24 third_party/icu/ucnv_ext.c | |
84 BazAlias | |
85 43784991 t@0x2a0000 24 {no path} | |
86 blink::ContiguousContainerBase::shrinkToFit | |
87 43785035 r@0x284e370 44 base/page_allocator.cc | |
88 Name | |
89 43785073 t@0x28d964 38 base/page_allocator.cc | |
90 extFromUUseMapping | |
91 43785105 d@0x2cd84e0 32 third_party/gvr-android-sdk/libgvr_shim_static_arm
.a/libcontroller_api_impl.a_controller_api_impl.o | |
92 .Lswitch.table.45 | |
93 43785137 r@0x284e398 32 third_party/container.c | |
94 chrome::mojom::FilePatcher::Name_ | |
95 43785169 t@0x28d98a 32 base/page_allocator.cc | |
96 extFromUUseMapping | |
97 43785197 t@0x28f1c8 28 third_party/icu/ucnv_ext.c | |
98 _GLOBAL__sub_I_SkDeviceProfile.cpp | |
99 43785225 t@0x28d948 28 base/page_allocator.cc | |
100 _GLOBAL__sub_I_pacing_sender.cc | |
101 43785253 t@0x2a0020 28 third_party/container.c | |
102 blink::ContiguousContainerBase::ContiguousContainerBase | |
103 43785277 d@0x2c17728 24 third_party/icu/ucnv_ext.c | |
104 chrome::mojom::FieldTrialRecorder [vtable] | |
105 43785301 d@0x2cd8538 24 base/page_allocator.cc | |
106 mojo::MessageReceiver [vtable] | |
107 43785317 t@0x28d900 16 base/page_allocator.cc | |
108 _GLOBAL__sub_I_page_allocator.cc | |
109 43785321 t@0x2a0010 4 third_party/fft_float.cc | |
110 BarAlias | |
111 43785325 t@0x2a0010 4 third_party/fft_float.cc | |
112 FooAlias | |
113 43785329 t@0x2a0010 4 third_party/{shared}/2 | |
114 blink::ContiguousContainerBase::shrinkToFit [clone .part.1234] [clo
ne .isra.2] | |
115 43785341 d@0x2cd8550 12 base/page_allocator.cc | |
116 kMethodsAnimationFrameTimeHistogram | |
117 43785349 r@0x284e364 8 base/page_allocator.cc | |
118 43785357 d@0x2cd84f0 8 third_party/gvr-android-sdk/libgvr_shim_static_arm
.a/libport_android_jni.a_jni_utils.o | |
119 kSystemClassPrefixes | |
120 43785361 d@0x2de70a4 4 third_party/container.c | |
121 base::android::g_library_version_number | |
122 43785365 d@0x2de70a0 4 third_party/container.c | |
123 base::android::g_renderer_histogram_code | |
124 43785369 r@0x28f3480 4 third_party/paint.cc | |
125 blink::CSSValueKeywordsHash::findValueImpl::value_word_list | |
126 43785373 d@0x2de7000 4 base/page_allocator.cc | |
127 google::protobuf::internal::pLinuxKernelCmpxchg | |
128 43785377 d@0x2de7004 4 third_party/container.c | |
129 google::protobuf::internal::pLinuxKernelMemoryBarrier | |
130 43785380 r@0x284e364 3 {no path} | |
131 ** symbol gap 2 | |
132 43785380 b@0x0 262144 third_party/fft_float.cc | |
133 ff_cos_131072 | |
134 43785380 b@0x0 131072 third_party/fft_fixed.cc | |
135 ff_cos_131072_fixed | |
136 43785380 b@0x0 131072 third_party/fft_float.cc | |
137 ff_cos_65536 | |
138 43785380 b@0x2dffe80 200 third_party/icu/ucnv_ext.c | |
139 SaveHistogram::atomic_histogram_pointer | |
140 43785380 b@0x2dffda0 28 third_party/icu/ucnv_ext.c | |
141 g_chrome_content_browser_client | |
142 43785380 b@0x2dffe84 4 third_party/icu/ucnv_ext.c | |
143 g_AnimationFrameTimeHistogram_clazz | |
OLD | NEW |