| ******************************************************************************** | |
| Entering interactive Python shell. Quick reference: | |
| SizeInfo: ContainerForName, MakeSparse, build_config, containers, is_sparse, metadata_legacy, native_symbols, pak_symbols, raw_symbols, section_sizes, size_path, symbols | |
| Symbol: FlagsString, IsArsc, IsBss, IsDelta, IsDex, IsGeneratedByToolchain, IsGroup, IsNameUnique, IsNative, IsOther, IsOverhead, IsPak, IsStringLiteral, IterLeafSymbols, SetName, address, aliases, component, container, container_name, container_short_name, disassembly, end_address, flags, full_name, generated_source, is_anonymous, is_feature, name, num_aliases, object_path, padding, padding_pss, pss, pss_without_padding, section, section_name, size, size_without_padding, source_path, template_name | |
| SymbolGroup (extends Symbol): CountUniqueSymbols, Filter, GroupedBy, GroupedByAliases, GroupedByComponent, GroupedByContainer, GroupedByContainerAndSectionName, GroupedByFullName, GroupedByName, GroupedByPath, GroupedBySectionName, Inverted, IterUniqueSymbols, Sorted, SortedByAddress, SortedByCount, SortedByName, WhereAddressInRange, WhereComponentMatches, WhereFullNameMatches, WhereGeneratedByToolchain, WhereHasAnyAttribution, WhereHasComponent, WhereHasFlag, WhereHasPath, WhereInContainer, WhereInSection, WhereIsDex, WhereIsFeature, WhereIsGroup, WhereIsNative, WhereIsOnDemand, WhereIsPak, WhereIsPlaceholder, WhereIsTemplate, WhereMatches, WhereNameMatches, WhereObjectPathMatches, WherePathMatches, WherePssBiggerThan, WhereSizeBiggerThan, WhereSourceIsGenerated, WhereSourcePathMatches, WhereTemplateNameMatches, index, is_default_sorted | |
| DeltaSizeInfo: ContainerForName, MakeSparse, MergeDeltaSizeInfo, added_sources, after, before, containers, is_sparse, native_symbols, pak_symbols, raw_symbols, removed_sources, section_sizes, symbols | |
| DeltaSymbol (extends Symbol): after_symbol, before_symbol, diff_status | |
| DeltaSymbolGroup (extends SymbolGroup): CountsByDiffStatus, GetEntireAddOrRemoveSources, GroupedByDiffStatus, WhereDiffStatusIs, diff_status | |
| canned_queries: CategorizeByChromeComponent, CategorizeGenerated, LargeFiles, PakByPath, StaticInitializers, TemplatesByName | |
| Functions: CheckDataQuality(), Csv(), Diff(), Disassemble(), ExpandRegex(), Print(), ReadStringLiterals(), ReplaceWithRelocations(), SaveDeltaSizeInfo(), SaveSizeInfo(), ShowExamples(), SizeStats() | |
| Variables: | |
| printed: List of objects passed to Print(). | |
| size_info: Loaded from {redacted} | |
| ******************************************************************************** | |
| # Show pydoc for main types: | |
| import models | |
| help(models) | |
| # Show all attributes of all symbols & per-section totals: | |
| Print(size_info, verbose=True) | |
| # Dump section info and all symbols in CSV format: | |
| Csv(size_info) | |
| # Print sorted list of all string literals: | |
| Print(sorted(x[1] for x in ReadStringLiterals())) | |
| # Show two levels of .text, grouped by first two subdirectories | |
| text_syms = size_info.symbols.WhereInSection("t") | |
| by_path = text_syms.GroupedByPath(depth=2) | |
| Print(by_path.WherePssBiggerThan(1024)) | |
| # Show all generated symbols, then show only non-vtable ones | |
| Print(size_info.symbols.WhereGeneratedByToolchain()) | |
| Print(printed[-1].WhereNameMatches(r"vtable").Inverted().Sorted()) | |
| # Show all symbols that have "print" in their name or path, except | |
| # those within components/. | |
| # Note: Could have also used Inverted(), as above. | |
| # Note: Use "help(ExpandRegex)" for more about what {{_print_}} does. | |
| print_syms = size_info.symbols.WhereMatches(r"{{_print_}}") | |
| Print(print_syms - print_syms.WherePathMatches(r"^components/")) | |
| # Diff two .size files and save result to a file: | |
| Print(Diff(size_info1, size_info2), to_file="output.txt") | |
| # Save a .size containing only the filtered symbols | |
| filtered_symbols = size_info.raw_symbols.Filter(lambda l: l.IsPak()) | |
| size_info.MakeSparse(filtered_symbols) | |
| SaveSizeInfo(size_info, to_file="oneoff_paks.size") | |
| # View per-component breakdowns, then drill into the last entry. | |
| c = canned_queries.CategorizeByChromeComponent() | |
| Print(c) | |
| Print(c[-1].GroupedByPath(depth=2).Sorted()) | |
| # For even more inspiration, look at canned_queries.py | |
| # (and feel free to add your own!). | |
| 0: (.rodata@266e600(size_without_padding=5,padding=0,full_name="Str1",object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={},num_aliases=2,component=Blink>Internal), b'Str1\x00') | |
| 1: (.rodata@266e605(size_without_padding=16,padding=0,full_name="String literal2",object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen},num_aliases=1,component=Internal>Android), b'String literal2\x00') | |
| Metadata: | |
| elf_algorithm=linker_map | |
| elf_arch=arm | |
| elf_build_id=WhatAnAmazingBuildId | |
| elf_file_name=elf | |
| elf_mtime={redacted} | |
| git_revision=abc123 | |
| gn_args=var1=true var2="foo" | |
| map_file_name=../../../test.map | |
| out_directory=out/Release | |
| Section Sizes (Total=128.0mb (134218045 bytes)): | |
| .bss: 1.24mb (1300456 bytes) (not included in totals) | |
| .data: 99.4kb (101768 bytes) (0.1%) | |
| .data.rel.ro: 1.02mb (1065224 bytes) (0.8%) | |
| .data.rel.ro.local: 771kb (790024 bytes) (0.6%) | |
| .other: 86.2mb (90351129 bytes) (67.3%) | |
| .part.end: 16 bytes (16 bytes) (not included in totals) | |
| .rel.dyn: 2.53mb (2655384 bytes) (2.0%) (counted in .other) | |
| .rodata: 5.65mb (5927652 bytes) (4.4%) | |
| .text: 34.3mb (35982248 bytes) (26.8%) | |
| Showing 81 symbols (73 unique) with total pss: 134218029 bytes | |
| Histogram of symbols based on PSS: | |
| [2,4): 7 [32,64): 9 [512,1024): 1 [32768,65536): 1 [1048576,2097152): 3 | |
| [4,8): 11 [64,128): 2 [2048,4096): 4 [65536,131072): 2 [2097152,4194304): 2 | |
| [8,16): 6 [128,256): 2 [4096,8192): 2 [131072,262144): 1 [33554432,67108864): 1 | |
| [16,32): 20 [256,512): 3 [8192,16384): 1 [524288,1048576): 2 [67108864,134217728): 1 | |
| Sizes: .text=34.3mb .rodata=5.65mb .data.rel.ro=1.02mb .data=99.4kb .bss=255 bytes .other=86.2mb total=128.0mb | |
| Counts: .text=23 .rodata=14 .data.rel.ro=4 .data=9 .bss=6 .other=20 | |
| Number of unique paths: 13 | |
| Section Legend: t=.text, r=.rodata, R=.data.rel.ro, d=.data, b=.bss, o=.other | |
| Index | Running Total | Section@Address | PSS | Path | |
| ------------------------------------------------------------ | |
| 0) 16 (0.0%) t@0x28d900 16 base/page_allocator.cc | |
| _GLOBAL__sub_I_page_allocator.cc | |
| 1) 44 (0.0%) t@0x28d910 28 (size=56) $SYSTEM/path.a/foo.o | |
| _GLOBAL__sub_I_bbr_sender.cc (num_aliases=2) | |
| 2) 72 (0.0%) t@0x28d910 28 (size=56) base/page_allocator.cc | |
| _GLOBAL__sub_I_bbr_sender.cc (num_aliases=2) | |
| 3) 100 (0.0%) t@0x28d948 28 base/page_allocator.cc | |
| _GLOBAL__sub_I_pacing_sender.cc | |
| 4) 138 (0.0%) t@0x28d964 38 base/page_allocator.cc | |
| extFromUUseMapping | |
| 5) 170 (0.0%) t@0x28d98a 32 base/page_allocator.cc | |
| extFromUUseMapping | |
| 6) 9928 (0.0%) t@Group 9758 {no path} | |
| ** symbol gaps (count=2) | |
| 7) 10376 (0.0%) t@0x28f000 448 $root_gen_dir/third_party/icu/ucnv_ext.c | |
| ucnv_extMatchFromU | |
| 8) 10404 (0.0%) t@0x28f1c8 28 $root_gen_dir/third_party/icu/ucnv_ext.c | |
| _GLOBAL__sub_I_SkDeviceProfile.cpp | |
| 9) 79528 (0.1%) t@0x28f1e0 69124 $root_gen_dir/third_party/icu/ucnv_ext.c | |
| foo_bar | |
| 10) 79552 (0.1%) t@0x2a0000 24 (size=48) $root_gen_dir/third_party/icu/ucnv_ext.c | |
| BazAlias (num_aliases=2) | |
| 11) 79576 (0.1%) t@0x2a0000 24 (size=48) {no path} | |
| blink::ContiguousContainerBase::shrinkToFit (num_aliases=2) | |
| 12) 79579 (0.1%) t@0x2a0010 3 (size=12) third_party/fft_float.cc | |
| BarAlias (num_aliases=4) | |
| 13) 79582 (0.1%) t@0x2a0010 3 (size=12) third_party/fft_float.cc | |
| FooAlias (num_aliases=4) | |
| 14) 79585 (0.1%) t@0x2a0010 3 (size=12) $root_gen_dir/third_party/icu/ucnv_ext.c | |
| blink::ContiguousContainerBase::shrinkToFit (num_aliases=4) | |
| 15) 79588 (0.1%) t@0x2a0010 3 (size=12) third_party/paint.cc | |
| blink::ContiguousContainerBase::shrinkToFit (num_aliases=4) | |
| 16) 79616 (0.1%) t@0x2a0020 28 third_party/container/container.c | |
| blink::ContiguousContainerBase::ContiguousContainerBase | |
| 17) 79710 (0.1%) t@0x2a1000 94 third_party/container/container.c | |
| blink::PaintChunker::releasePaintChunks | |
| 18) 83744 (0.1%) t@0x2a2000 4034 third_party/container/container.c | |
| ** outlined function | |
| 19) 83768 (0.1%) t@0x2a2020 24 (size=48) {no path} | |
| aliasedWithOutlinedFunction (num_aliases=2) | |
| 20) 83792 (0.1%) t@0x2a2020 24 (size=48) {no path} | |
| ** outlined function * 2 (num_aliases=2) | |
| 21) 35982248 (26.8%) t@0x2a2050 35898456 {no path} | |
| ** .text (unattributed) | |
| 22) 35982250 (26.8%) r@0x266e600 2.5 (size=5) base/page_allocator.cc | |
| "Str1" (num_aliases=2) | |
| 23) 35982253 (26.8%) r@0x266e600 2.5 (size=5) $root_gen_dir/third_party/icu/ucnv_ext.c | |
| "Str1" (num_aliases=2) | |
| 24) 35982269 (26.8%) r@0x266e605 16 $root_gen_dir/third_party/icu/ucnv_ext.c | |
| "String literal2" | |
| 25) 35982312 (26.8%) r@0x266e630 43 {no path} | |
| ** merge strings | |
| 26) 37947657 (28.3%) r@0x284d600 1965345 {no path} | |
| ** merge constants | |
| 27) 37947660 (28.3%) r@0x284e364 3 {no path} | |
| ** symbol gap 0 | |
| 28) 37947668 (28.3%) r@0x284e364 8 base/page_allocator.cc | |
| 29) 37947690 (28.3%) r@0x284e370 22 (size=44) base/page_allocator.cc | |
| Name (num_aliases=2) | |
| 30) 37947712 (28.3%) r@0x284e370 22 (size=44) base/page_allocator.cc | |
| NameAlias (num_aliases=2) | |
| 31) 37947744 (28.3%) r@0x284e398 32 third_party/container/container.c | |
| chrome::mojom::FilePatcher::Name_ | |
| 32) 37947760 (28.3%) r@0x284e3b8 16 base/page_allocator.cc | |
| core::num::imp::flt2dec::strategy::dragon::POW10 | |
| 33) 38623784 (28.8%) r@0x28f3450 676024 third_party/paint.cc | |
| kAnimationFrameTimeHistogramClassPath | |
| 34) 38623788 (28.8%) r@0x28f3480 4 third_party/paint.cc | |
| blink::CSSValueKeywordsHash::findValueImpl::value_word_list | |
| 35) 41909884 (31.2%) r@0x28f3484 3286096 {no path} | |
| ** .rodata (unattributed) | |
| 36) 41909940 (31.2%) R@0x2c176f0 56 $root_gen_dir/third_party/icu/ucnv_ext.c | |
| ChromeMainDelegate [vtable] | |
| 37) 41909964 (31.2%) R@0x2c17728 24 $root_gen_dir/third_party/icu/ucnv_ext.c | |
| chrome::mojom::FieldTrialRecorder [vtable] | |
| 38) 42699868 (31.8%) R@0x2c17740 789904 third_party/container/container.c | |
| chrome::mojom::FieldTrialRecorderProxy [vtable] | |
| 39) 42699900 (31.8%) R@0x2cd84e0 32 third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o | |
| .Lswitch.table.45 | |
| 40) 42699908 (31.8%) R@0x2cd84f0 8 third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libport_android_jni.a_jni_utils.o | |
| kSystemClassPrefixes | |
| 41) 42699964 (31.8%) R@0x2cd8500 56 third_party/paint.cc | |
| ChromeMainDelegateAndroid [vtable] | |
| 42) 42699988 (31.8%) R@0x2cd8538 24 base/page_allocator.cc | |
| mojo::MessageReceiver [vtable] | |
| 43) 42700000 (31.8%) R@0x2cd8550 12 base/page_allocator.cc | |
| kMethodsAnimationFrameTimeHistogram | |
| 44) 43765132 (32.6%) R@0x2cd855c 1065132 {no path} | |
| ** .data.rel.ro (unattributed) | |
| 45) 43765136 (32.6%) d@0x2de7000 4 base/page_allocator.cc | |
| google::protobuf::internal::pLinuxKernelCmpxchg | |
| 46) 43765140 (32.6%) d@0x2de7004 4 third_party/container/container.c | |
| google::protobuf::internal::pLinuxKernelMemoryBarrier | |
| 47) 43765292 (32.6%) d@0x2de7008 152 third_party/container/container.c | |
| base::android::kBaseRegisteredMethods | |
| 48) 43765296 (32.6%) d@0x2de70a0 4 third_party/container/container.c | |
| base::android::g_renderer_histogram_code | |
| 49) 43765300 (32.6%) d@0x2de70a4 4 third_party/container/container.c | |
| base::android::g_library_version_number | |
| 50) 43765304 (32.6%) d@0x2de70a8 4 base/thinlto.cc | |
| thinlto_dummy | |
| 51) 43765308 (32.6%) d@0x2de70ac 4 base/thinlto1.cc | |
| thinlto1_dummy | |
| 52) 43765312 (32.6%) d@0x2de70b0 4 base/thinlto2.cc | |
| thinlto2_dummy | |
| 53) 43866900 (32.7%) d@0x2de70b4 101588 {no path} | |
| ** .data (unattributed) | |
| 54) 43866900 (32.7%) b@0x0 16 {no path} | |
| ** ELF Section: .part.end | |
| 55) 43866900 (32.7%) b@0x2dffda0 28 $root_gen_dir/third_party/icu/ucnv_ext.c | |
| g_chrome_content_browser_client | |
| 56) 43866900 (32.7%) b@0x2dffe80 200 $root_gen_dir/third_party/icu/ucnv_ext.c | |
| SaveHistogram::atomic_histogram_pointer | |
| 57) 43866900 (32.7%) b@0x2dffe84 4 $root_gen_dir/third_party/icu/ucnv_ext.c | |
| g_AnimationFrameTimeHistogram_clazz | |
| 58) 43866900 (32.7%) b@0x2dffe88 4 third_party/fft_float.cc | |
| ff_cos_131072 | |
| 59) 43866900 (32.7%) b@0x2dffe8c 4 third_party/fft_fixed.cc | |
| ff_cos_131072_fixed | |
| 60) 43866900 (32.7%) b@0x2dffe9b 15 third_party/fft_float.cc | |
| ff_cos_65536 | |
| 61) 43866960 (32.7%) o@0x0 60 {no path} | |
| ** ELF Section: .ARM.attributes | |
| 62) 45403416 (33.8%) o@0x0 1536456 {no path} | |
| ** ELF Section: .ARM.exidx | |
| 63) 45587048 (34.0%) o@0x0 183632 {no path} | |
| ** ELF Section: .ARM.extab | |
| 64) 45587352 (34.0%) o@0x0 304 {no path} | |
| ** ELF Section: .dynamic | |
| 65) 45591377 (34.0%) o@0x0 4025 {no path} | |
| ** ELF Section: .dynstr | |
| 66) 45597873 (34.0%) o@0x0 6496 {no path} | |
| ** ELF Section: .dynsym | |
| 67) 45597881 (34.0%) o@0x0 8 {no path} | |
| ** ELF Section: .fini_array | |
| 68) 45598693 (34.0%) o@0x0 812 {no path} | |
| ** ELF Section: .gnu.version | |
| 69) 45598721 (34.0%) o@0x0 28 {no path} | |
| ** ELF Section: .gnu.version_d | |
| 70) 45598817 (34.0%) o@0x0 96 {no path} | |
| ** ELF Section: .gnu.version_r | |
| 71) 45641773 (34.0%) o@0x0 42956 {no path} | |
| ** ELF Section: .got | |
| 72) 45644457 (34.0%) o@0x0 2684 {no path} | |
| ** ELF Section: .hash | |
| 73) 45644465 (34.0%) o@0x0 8 {no path} | |
| ** ELF Section: .init_array | |
| 74) 45644484 (34.0%) o@0x0 19 {no path} | |
| ** ELF Section: .interp | |
| 75) 45644520 (34.0%) o@0x0 36 {no path} | |
| ** ELF Section: .note.gnu.build-id | |
| 76) 45648764 (34.0%) o@0x0 4244 {no path} | |
| ** ELF Section: .plt | |
| 77) 48304148 (36.0%) o@0x0 2655384 {no path} | |
| ** ELF Section: .rel.dyn | |
| 78) 48306964 (36.0%) o@0x0 2816 {no path} | |
| ** ELF Section: .rel.plt | |
| 79) 48307400 (36.0%) o@0x0 436 {no path} | |
| ** ELF Section: .shstrtab | |
| 80) 134218029 (100.0%) o@0x0 85910629 {no path} | |
| Overhead: ELF file |