blob: 1d6b910a51f9c22b97c3999758b01763211fa0c4 [file]
********************************************************************************
Entering interactive Python shell. Quick reference:
SizeInfo: metadata, native_symbols, pak_symbols, raw_symbols, section_sizes, size_path, symbols
Symbol: FlagsString, IsBss, IsDelta, IsDex, IsGeneratedByToolchain, IsGroup, IsNameUnique, IsNative, IsOther, IsOverhead, IsPak, IsStringLiteral, IterLeafSymbols, address, aliases, component, end_address, flags, full_name, generated_source, is_anonymous, 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, GroupedByFullName, GroupedByName, GroupedByPath, GroupedBySectionName, Inverted, IterUniqueSymbols, SetName, Sorted, SortedByAddress, SortedByCount, SortedByName, WhereAddressInRange, WhereComponentMatches, WhereFullNameMatches, WhereGeneratedByToolchain, WhereHasAnyAttribution, WhereHasComponent, WhereHasFlag, WhereHasPath, WhereInSection, WhereIsDex, WhereIsGroup, WhereIsNative, WhereIsPak, WhereIsTemplate, WhereMatches, WhereNameMatches, WhereObjectPathMatches, WherePathMatches, WherePssBiggerThan, WhereSizeBiggerThan, WhereSourceIsGenerated, WhereSourcePathMatches, WhereTemplateNameMatches, index, is_default_sorted
DeltaSizeInfo: after, before, native_symbols, pak_symbols, raw_symbols, section_sizes, symbols
DeltaSymbol (extends Symbol): after_symbol, before_symbol, diff_status
DeltaSymbolGroup (extends SymbolGroup): CountsByDiffStatus, WhereDiffStatusIs, diff_status
canned_queries: CategorizeByChromeComponent, CategorizeGenerated, LargeFiles, PakByPath, StaticInitializers, TemplatesByName
Functions: Csv(), Diff(), Disassemble(), ExpandRegex(), Print(), ReadStringLiterals(), 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")
# 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=string literal,object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={},num_aliases=2,component=Blink>Internal), 'Str1\x00')
1: (.rodata@266e605(size_without_padding=16,padding=0,full_name=string literal,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), 'String literal2\x00')
Metadata:
elf_arch=arm
elf_build_id=WhatAnAmazingBuildId
elf_file_name=elf
elf_mtime={redacted}
git_revision=abc123
gn_args=var1=true var2="foo"
linker_name=gold
map_file_name=../../../test.map
tool_prefix=tools/binary_size/libsupersize/testdata/mock_toolchain/
Section Sizes (Total=128.0mb (134218045 bytes)):
.ARM.exidx: 1.47mb (1536456 bytes) (1.1%)
.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%)
.other: 32.4mb (33984171 bytes) (25.3%)
.rel.dyn: 2.53mb (2655384 bytes) (2.0%)
.rodata: 5.65mb (5927652 bytes) (4.4%)
.strtab: 33.2mb (34841854 bytes) (26.0%)
.symtab: 16.4mb (17166112 bytes) (12.8%)
.text: 34.2mb (35900712 bytes) (26.7%)
Showing 51 symbols (45 unique) with total pss: 37499787 bytes
Histogram of symbols based on PSS:
[2,4): 7 [16,32): 12 [128,256): 2 [8192,16384): 1 [262144,524288): 1 [33554432,67108864): 1
[4,8): 6 [32,64): 9 [256,512): 1 [65536,131072): 1 [524288,1048576): 2
[8,16): 3 [64,128): 1 [2048,4096): 1 [131072,262144): 2 [1048576,2097152): 1
Sizes: .text=81.8kb .rodata=2.52mb .data.rel.ro=92 bytes .data=168 bytes .bss=512kb .other=32.4mb total=35.8mb
Counts: .text=21 .rodata=11 .data.rel.ro=3 .data=5 .bss=6 .other=1
Number of unique paths: 9
Section Legend: t=.text, r=.rodata, R=.data.rel.ro, d=.data, b=.bss, o=.other
Index | Running Total | Section@Address | PSS | Path
------------------------------------------------------------
0) 4 (0.0%) d@0x2de7000 4 base/page_allocator.cc
google::protobuf::internal::pLinuxKernelCmpxchg
1) 8 (0.0%) d@0x2de7004 4 third_party/container/container.c
google::protobuf::internal::pLinuxKernelMemoryBarrier
2) 160 (0.0%) d@0x2de7008 152 third_party/container/container.c
base::android::kBaseRegisteredMethods
3) 164 (0.0%) d@0x2de70a0 4 third_party/container/container.c
base::android::g_renderer_histogram_code
4) 168 (0.0%) d@0x2de70a4 4 third_party/container/container.c
base::android::g_library_version_number
5) 224 (0.0%) R@0x2cd8500 56 third_party/paint.cc
ChromeMainDelegateAndroid [vtable]
6) 248 (0.0%) R@0x2cd8538 24 base/page_allocator.cc
mojo::MessageReceiver [vtable]
7) 260 (0.0%) R@0x2cd8550 12 base/page_allocator.cc
kMethodsAnimationFrameTimeHistogram
8) 316 (0.0%) R@0x2c176f0 56 $root_gen_dir/third_party/icu/ucnv_ext.c
ChromeMainDelegate [vtable]
9) 340 (0.0%) R@0x2c17728 24 $root_gen_dir/third_party/icu/ucnv_ext.c
chrome::mojom::FieldTrialRecorder [vtable]
10) 790244 (2.1%) R@0x2c17740 789904 third_party/container/container.c
chrome::mojom::FieldTrialRecorderProxy [vtable]
11) 790276 (2.1%) R@0x2cd84e0 32 third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o
.Lswitch.table.45
12) 790284 (2.1%) R@0x2cd84f0 8 third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libport_android_jni.a_jni_utils.o
kSystemClassPrefixes
13) 34774455 (92.7%) o@0x0 33984171 {no path}
Overhead: ELF file
14) 34774457 (92.7%) r@0x266e600 2.5 (size=5) base/page_allocator.cc
string literal (num_aliases=2)
15) 34774460 (92.7%) r@0x266e600 2.5 (size=5) $root_gen_dir/third_party/icu/ucnv_ext.c
string literal (num_aliases=2)
16) 34774476 (92.7%) r@0x266e605 16 $root_gen_dir/third_party/icu/ucnv_ext.c
string literal
17) 34774519 (92.7%) r@0x266e630 43 {no path}
** merge strings
18) 36739864 (98.0%) r@0x284d600 1965345 {no path}
** merge constants
19) 36739867 (98.0%) r@0x284e364 3 {no path}
** symbol gap 0
20) 36739875 (98.0%) r@0x284e364 8 base/page_allocator.cc
21) 36739919 (98.0%) r@0x284e370 44 base/page_allocator.cc
Name
22) 36739951 (98.0%) r@0x284e398 32 third_party/container/container.c
chrome::mojom::FilePatcher::Name_
23) 37415991 (99.8%) r@0x28f3450 676040 third_party/paint.cc
kAnimationFrameTimeHistogramClassPath
24) 37415995 (99.8%) r@0x28f3480 4 third_party/paint.cc
blink::CSSValueKeywordsHash::findValueImpl::value_word_list
25) 37416011 (99.8%) t@0x28d900 16 base/page_allocator.cc
_GLOBAL__sub_I_page_allocator.cc
26) 37416067 (99.8%) t@0x28d910 56 base/page_allocator.cc
_GLOBAL__sub_I_bbr_sender.cc
27) 37416095 (99.8%) t@0x28d948 28 base/page_allocator.cc
_GLOBAL__sub_I_pacing_sender.cc
28) 37416133 (99.8%) t@0x28d964 38 base/page_allocator.cc
extFromUUseMapping
29) 37416165 (99.8%) t@0x28d98a 32 base/page_allocator.cc
extFromUUseMapping
30) 37425923 (99.8%) t@Group 9758 {no path}
** symbol gaps (count=2)
31) 37426371 (99.8%) t@0x28f000 448 $root_gen_dir/third_party/icu/ucnv_ext.c
ucnv_extMatchFromU
32) 37426399 (99.8%) t@0x28f1c8 28 $root_gen_dir/third_party/icu/ucnv_ext.c
_GLOBAL__sub_I_SkDeviceProfile.cpp
33) 37495523 (100.0%) t@0x28f1e0 69124 $root_gen_dir/third_party/icu/ucnv_ext.c
foo_bar
34) 37495547 (100.0%) t@0x2a0000 24 (size=48) $root_gen_dir/third_party/icu/ucnv_ext.c
BazAlias (num_aliases=2)
35) 37495571 (100.0%) t@0x2a0000 24 (size=48) {no path}
blink::ContiguousContainerBase::shrinkToFit (num_aliases=2)
36) 37495574 (100.0%) t@0x2a0010 3 (size=12) third_party/fft_float.cc
BarAlias (num_aliases=4)
37) 37495577 (100.0%) t@0x2a0010 3 (size=12) third_party/fft_float.cc
FooAlias (num_aliases=4)
38) 37495580 (100.0%) t@0x2a0010 3 (size=12) $root_gen_dir/third_party/icu/ucnv_ext.c
blink::ContiguousContainerBase::shrinkToFit (num_aliases=4)
39) 37495583 (100.0%) t@0x2a0010 3 (size=12) third_party/paint.cc
blink::ContiguousContainerBase::shrinkToFit (num_aliases=4)
40) 37495611 (100.0%) t@0x2a0020 28 third_party/container/container.c
blink::ContiguousContainerBase::ContiguousContainerBase
41) 37495705 (100.0%) t@0x2a1000 94 third_party/container/container.c
blink::PaintChunker::releasePaintChunks
42) 37499739 (100.0%) t@0x2a2000 4034 third_party/container/container.c
** outlined function
43) 37499763 (100.0%) t@0x2a2020 24 (size=48) {no path}
** outlined function * 2 (num_aliases=2)
44) 37499787 (100.0%) t@0x2a2020 24 (size=48) {no path}
aliasedWithOutlinedFunction (num_aliases=2)
45) 37499787 (100.0%) b@0x0 262144 third_party/fft_float.cc
ff_cos_131072
46) 37499787 (100.0%) b@0x0 131072 third_party/fft_fixed.cc
ff_cos_131072_fixed
47) 37499787 (100.0%) b@0x0 131072 third_party/fft_float.cc
ff_cos_65536
48) 37499787 (100.0%) b@0x2dffda0 28 $root_gen_dir/third_party/icu/ucnv_ext.c
g_chrome_content_browser_client
49) 37499787 (100.0%) b@0x2dffe80 200 $root_gen_dir/third_party/icu/ucnv_ext.c
SaveHistogram::atomic_histogram_pointer
50) 37499787 (100.0%) b@0x2dffe84 4 $root_gen_dir/third_party/icu/ucnv_ext.c
g_AnimationFrameTimeHistogram_clazz