| 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, IterLeafSymbols, IterUn
iqueSymbols, Sorted, SortedByAddress, SortedByCount, SortedByName, WhereAddressI
nRange, WhereBiggerThan, WhereFullNameMatches, WhereGeneratedByToolchain, WhereH
asAnyAttribution, WhereHasPath, WhereInSection, WhereMatches, WhereNameMatches,
WhereObjectPathMatches, WherePathMatches, WhereSourceIsGenerated, WhereSourcePat
hMatches, is_sorted |
| 8 |
| 9 SymbolDiff (extends SymbolGroup): IsAdded, IsRemoved, IsSimilar, WhereNotUnchang
ed, added_count, changed_count, removed_count, unchanged_count |
| 10 |
| 11 canned_queries: CategorizeByChromeComponent, CategorizeGenerated |
| 12 |
| 13 Functions: Diff(), Disassemble(), ExpandRegex(), Print(), ShowExamples() |
| 14 Variables: canned_queries, size_info |
| 15 ******************************************************************************** |
| 1 # Show pydoc for main types: | 16 # Show pydoc for main types: |
| 2 import models | 17 import models |
| 3 help(models) | 18 help(models) |
| 4 | 19 |
| 5 # Show all attributes of all symbols & per-section totals: | 20 # Show all attributes of all symbols & per-section totals: |
| 6 Print(size_info, verbose=True) | 21 Print(size_info, verbose=True) |
| 7 | 22 |
| 8 # Show two levels of .text, grouped by first two subdirectories | 23 # Show two levels of .text, grouped by first two subdirectories |
| 9 text_syms = size_info.symbols.WhereInSection("t") | 24 text_syms = size_info.symbols.WhereInSection("t") |
| 10 by_path = text_syms.GroupBySourcePath(depth=2) | 25 by_path = text_syms.GroupByPath(depth=2) |
| 11 Print(by_path.WhereBiggerThan(1024)) | 26 Print(by_path.WhereBiggerThan(1024)) |
| 12 | 27 |
| 13 # Show all non-vtable generated symbols | 28 # Show all non-vtable generated symbols |
| 14 generated_syms = size_info.symbols.WhereGeneratedByToolchain() | 29 generated_syms = size_info.symbols.WhereGeneratedByToolchain() |
| 15 Print(generated_syms.WhereNameMatches(r"vtable").Inverted().Sorted()) | 30 Print(generated_syms.WhereNameMatches(r"vtable").Inverted().Sorted()) |
| 16 | 31 |
| 17 # Show all symbols that have "print" in their name or path, except | 32 # Show all symbols that have "print" in their name or path, except |
| 18 # those within components/. | 33 # those within components/. |
| 19 # Note: Could have also used Inverted(), as above. | 34 # Note: Could have also used Inverted(), as above. |
| 20 # Note: Use "help(ExpandRegex)" for more about what {{_print_}} does. | 35 # Note: Use "help(ExpandRegex)" for more about what {{_print_}} does. |
| 21 print_syms = size_info.symbols.WhereMatches(r"{{_print_}}") | 36 print_syms = size_info.symbols.WhereMatches(r"{{_print_}}") |
| 22 Print(print_syms - print_syms.WherePathMatches(r"^components/")) | 37 Print(print_syms - print_syms.WherePathMatches(r"^components/")) |
| 23 | 38 |
| 24 # Diff two .size files and save result to a file: | 39 # Diff two .size files and save result to a file: |
| 25 Print(Diff(size_info1, size_info2), to_file="output.txt") | 40 Print(Diff(size_info1, size_info2), to_file="output.txt") |
| 26 | 41 |
| 42 # View per-component breakdowns, then drill into the last entry. |
| 43 c = canned_queries.CategorizeByChromeComponent() |
| 44 Print(c) |
| 45 Print(c[-1].GroupByPath(depth=2).Sorted()) |
| 46 |
| 47 # For even more inspiration, look at canned_queries.py |
| 48 # (and feel free to add your own!). |
| 27 Metadata: | 49 Metadata: |
| 28 elf_arch=ARM | 50 elf_arch=ARM |
| 29 elf_build_id=WhatAnAmazingBuildId | 51 elf_build_id=WhatAnAmazingBuildId |
| 30 elf_file_name=elf | 52 elf_file_name=elf |
| 31 elf_mtime={redacted} | 53 elf_mtime={redacted} |
| 32 git_revision=abc123 | 54 git_revision=abc123 |
| 33 gn_args=var1=true var2="foo" | 55 gn_args=var1=true var2="foo" |
| 34 map_file_name=../test.map | 56 map_file_name=../test.map |
| 35 | 57 |
| 36 Section Sizes (Total=43,785,380 bytes): | 58 Section Sizes (Total=43,785,380 bytes): |
| 37 .bss: 1,300,456 bytes (not included in totals) | 59 .bss: 1,300,456 bytes (not included in totals) |
| 38 .data: 101,768 bytes (0.2%) | 60 .data: 101,768 bytes (0.2%) |
| 39 .data.rel.ro: 1,065,224 bytes (2.4%) | 61 .data.rel.ro: 1,065,224 bytes (2.4%) |
| 40 .data.rel.ro.local: 790,024 bytes (1.8%) | 62 .data.rel.ro.local: 790,024 bytes (1.8%) |
| 41 .rodata: 5,927,652 bytes (13.5%) | 63 .rodata: 5,927,652 bytes (13.5%) |
| 42 .text: 35,900,712 bytes (82.0%) | 64 .text: 35,900,712 bytes (82.0%) |
| 43 | 65 |
| 44 Showing 48 symbols (45 unique) with total pss: 44309900 bytes | 66 Showing 48 symbols (45 unique) with total pss: 44309900 bytes |
| 45 .text=34.2mb .rodata=5.65mb other=2.37mb total=42.3mb | 67 .text=34.2mb .rodata=5.65mb other=2.37mb total=42.3mb |
| 46 Number of object files: 10 | 68 Number of object files: 10 |
| 47 | 69 |
| 48 First columns are: running total, address, pss | 70 Index, Running Total, Section@Address, PSS |
| 49 35821002 t@0x24ca628 35821002 {no path} | 71 ------------------------------------------------------------ |
| 72 0) 16 (0.0%) t@0x28d900 16 base/page_allocator.cc |
| 73 _GLOBAL__sub_I_page_allocator.cc |
| 74 1) 72 (0.0%) t@0x28d910 56 base/page_allocator.cc |
| 75 _GLOBAL__sub_I_bbr_sender.cc |
| 76 2) 100 (0.0%) t@0x28d948 28 base/page_allocator.cc |
| 77 _GLOBAL__sub_I_pacing_sender.cc |
| 78 3) 138 (0.0%) t@0x28d964 38 base/page_allocator.cc |
| 79 extFromUUseMapping |
| 80 4) 170 (0.0%) t@0x28d98a 32 base/page_allocator.cc |
| 81 extFromUUseMapping |
| 82 5) 5888 (0.0%) t@0x28f000 5718 {no path} |
| 83 ** symbol gap 0 |
| 84 6) 6336 (0.0%) t@0x28f000 448 third_party/icu/ucnv_ext.c |
| 85 ucnv_extMatchFromU |
| 86 7) 6364 (0.0%) t@0x28f1c8 28 third_party/icu/ucnv_ext.c |
| 87 _GLOBAL__sub_I_SkDeviceProfile.cpp |
| 88 8) 75488 (0.2%) t@0x28f1e0 69124 third_party/icu/ucnv_ext.c |
| 89 foo_bar |
| 90 9) 75512 (0.2%) t@0x2a0000 24 {no path} |
| 91 blink::ContiguousContainerBase::shrinkToFit |
| 92 10) 75536 (0.2%) t@0x2a0000 24 third_party/icu/ucnv_ext.c |
| 93 BazAlias |
| 94 11) 75540 (0.2%) t@0x2a0010 4 third_party/{shared}/2 |
| 95 blink::ContiguousContainerBase::shrinkToFit [clone .part.1234] [clo
ne .isra.2] |
| 96 12) 75544 (0.2%) t@0x2a0010 4 third_party/fft_float.cc |
| 97 FooAlias |
| 98 13) 75548 (0.2%) t@0x2a0010 4 third_party/fft_float.cc |
| 99 BarAlias |
| 100 14) 75576 (0.2%) t@0x2a0020 28 third_party/container.c |
| 101 blink::ContiguousContainerBase::ContiguousContainerBase |
| 102 15) 79616 (0.2%) t@0x2a1000 4040 {no path} |
| 103 ** symbol gap 1 |
| 104 16) 79710 (0.2%) t@0x2a1000 94 third_party/container.c |
| 105 blink::PaintChunker::releasePaintChunks [clone .part.1] |
| 106 17) 35900712 (81.0%) t@0x24ca628 35821002 {no path} |
| 50 ** symbol gap 2 (end of section) | 107 ** symbol gap 2 (end of section) |
| 51 39107114 r@0x2c158e4 3286112 {no path} | 108 18) 37866121 (85.5%) r@0x266e600 1965409 {no path} |
| 109 ** merge strings |
| 110 19) 37866124 (85.5%) r@0x284e364 3 {no path} |
| 111 ** symbol gap 2 |
| 112 20) 37866132 (85.5%) r@0x284e364 8 base/page_allocator.cc |
| 113 21) 37866176 (85.5%) r@0x284e370 44 base/page_allocator.cc |
| 114 Name |
| 115 22) 37866208 (85.5%) r@0x284e398 32 third_party/container.c |
| 116 chrome::mojom::FilePatcher::Name_ |
| 117 23) 38542193 (87.0%) r@0x284e518 675985 {no path} |
| 118 ** merge strings |
| 119 24) 38542248 (87.0%) r@0x28f3450 55 third_party/paint.cc |
| 120 kAnimationFrameTimeHistogramClassPath |
| 121 25) 38542252 (87.0%) r@0x28f3480 4 third_party/paint.cc |
| 122 blink::CSSValueKeywordsHash::findValueImpl::value_word_list |
| 123 26) 41828364 (94.4%) r@0x2c158e4 3286112 {no path} |
| 52 ** symbol gap 3 (end of section) | 124 ** symbol gap 3 (end of section) |
| 53 41072523 r@0x266e600 1965409 {no path} | 125 27) 41828420 (94.4%) d@0x2c176f0 56 third_party/icu/ucnv_ext.c |
| 54 ** merge strings | 126 ChromeMainDelegate [vtable] |
| 55 42137655 d@0x2ddc608 1065132 {no path} | 127 28) 41828444 (94.4%) d@0x2c17728 24 third_party/icu/ucnv_ext.c |
| 128 chrome::mojom::FieldTrialRecorder [vtable] |
| 129 29) 42618348 (96.2%) d@0x2c17740 789904 third_party/container.c |
| 130 chrome::mojom::FieldTrialRecorderProxy [vtable] |
| 131 30) 42618380 (96.2%) d@0x2cd84e0 32 third_party/gvr-android-sdk/libgvr_sh
im_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o |
| 132 .Lswitch.table.45 |
| 133 31) 42618388 (96.2%) d@0x2cd84f0 8 third_party/gvr-android-sdk/libgvr_sh
im_static_arm.a/libport_android_jni.a_jni_utils.o |
| 134 kSystemClassPrefixes |
| 135 32) 42618444 (96.2%) d@0x2cd8500 56 third_party/paint.cc |
| 136 ChromeMainDelegateAndroid [vtable] |
| 137 33) 42618468 (96.2%) d@0x2cd8538 24 base/page_allocator.cc |
| 138 mojo::MessageReceiver [vtable] |
| 139 34) 42618480 (96.2%) d@0x2cd8550 12 base/page_allocator.cc |
| 140 kMethodsAnimationFrameTimeHistogram |
| 141 35) 43683612 (98.6%) d@0x2ddc608 1065132 {no path} |
| 56 ** symbol gap 3 (end of section) | 142 ** symbol gap 3 (end of section) |
| 57 42927559 d@0x2c17740 789904 third_party/container.c | 143 36) 43683616 (98.6%) d@0x2de7000 4 base/page_allocator.cc |
| 58 chrome::mojom::FieldTrialRecorderProxy [vtable] | 144 google::protobuf::internal::pLinuxKernelCmpxchg |
| 59 43603544 r@0x284e518 675985 {no path} | 145 37) 43683620 (98.6%) d@0x2de7004 4 third_party/container.c |
| 60 ** merge strings | 146 google::protobuf::internal::pLinuxKernelMemoryBarrier |
| 61 43705144 d@0x2dffd88 101600 {no path} | 147 38) 43683772 (98.6%) d@0x2de7008 152 third_party/container.c |
| 148 base::android::kBaseRegisteredMethods |
| 149 39) 43683776 (98.6%) d@0x2de70a0 4 third_party/container.c |
| 150 base::android::g_renderer_histogram_code |
| 151 40) 43683780 (98.6%) d@0x2de70a4 4 third_party/container.c |
| 152 base::android::g_library_version_number |
| 153 41) 43785380 (98.8%) d@0x2dffd88 101600 {no path} |
| 62 ** symbol gap 3 (end of section) | 154 ** symbol gap 3 (end of section) |
| 63 43774268 t@0x28f1e0 69124 third_party/icu/ucnv_ext.c | 155 42) 43785380 (98.8%) b@0x0 262144 third_party/fft_float.cc |
| 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 | 156 ff_cos_131072 |
| 134 43785380 b@0x0 131072 third_party/fft_fixed.cc | 157 43) 43785380 (98.8%) b@0x0 131072 third_party/fft_fixed.cc |
| 135 ff_cos_131072_fixed | 158 ff_cos_131072_fixed |
| 136 43785380 b@0x0 131072 third_party/fft_float.cc | 159 44) 43785380 (98.8%) b@0x0 131072 third_party/fft_float.cc |
| 137 ff_cos_65536 | 160 ff_cos_65536 |
| 138 43785380 b@0x2dffe80 200 third_party/icu/ucnv_ext.c | 161 45) 43785380 (98.8%) b@0x2dffda0 28 third_party/icu/ucnv_ext.c |
| 162 g_chrome_content_browser_client |
| 163 46) 43785380 (98.8%) b@0x2dffe80 200 third_party/icu/ucnv_ext.c |
| 139 SaveHistogram::atomic_histogram_pointer | 164 SaveHistogram::atomic_histogram_pointer |
| 140 43785380 b@0x2dffda0 28 third_party/icu/ucnv_ext.c | 165 47) 43785380 (98.8%) b@0x2dffe84 4 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 | 166 g_AnimationFrameTimeHistogram_clazz |
| OLD | NEW |