chromium/tools/binary_size/libsupersize/testdata/Console.golden

********************************************************************************
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, 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, 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, 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%)
    .rel.dyn: 2.53mb (2655384 bytes) (2.0%) (counted in .other)
    .rodata: 5.65mb (5927652 bytes) (4.4%)
    .strtab: 33.2mb (34841854 bytes) (26.0%) (counted in .other)
    .symtab: 16.4mb (17166112 bytes) (12.8%) (counted in .other)
    .text: 34.3mb (35982248 bytes) (26.8%)

Showing 78 symbols (71 unique) with total pss: 134218029 bytes
Histogram of symbols based on PSS:
      [2,4): 7      [32,64): 10     [512,1024): 1     [32768,65536): 1      [524288,1048576): 2   [33554432,67108864): 3
      [4,8): 6     [64,128): 2     [2048,4096): 4    [65536,131072): 2     [1048576,2097152): 3
     [8,16): 5    [128,256): 2     [4096,8192): 2   [131072,262144): 3     [2097152,4194304): 2
    [16,32): 17   [256,512): 3    [8192,16384): 1   [262144,524288): 1   [16777216,33554432): 1
Sizes: .text=34.3mb     .rodata=5.65mb     .data.rel.ro=1.02mb     .data=99.4kb     .bss=512kb      .other=86.2mb     total=128.0mb
Counts: .text=23 .rodata=12 .data.rel.ro=4 .data=6 .bss=6 .other=23
Number of unique paths: 10

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)  37947712 (28.3%) r@0x284e370  44             base/page_allocator.cc
             Name
30)  37947744 (28.3%) r@0x284e398  32             third_party/container/container.c
             chrome::mojom::FilePatcher::Name_
31)  38623784 (28.8%) r@0x28f3450  676040         third_party/paint.cc
             kAnimationFrameTimeHistogramClassPath
32)  38623788 (28.8%) r@0x28f3480  4              third_party/paint.cc
             blink::CSSValueKeywordsHash::findValueImpl::value_word_list
33)  41909884 (31.2%) r@0x28f3484  3286096        {no path}
             ** .rodata (unattributed)
34)  41909940 (31.2%) R@0x2c176f0  56             $root_gen_dir/third_party/icu/ucnv_ext.c
             ChromeMainDelegate [vtable]
35)  41909964 (31.2%) R@0x2c17728  24             $root_gen_dir/third_party/icu/ucnv_ext.c
             chrome::mojom::FieldTrialRecorder [vtable]
36)  42699868 (31.8%) R@0x2c17740  789904         third_party/container/container.c
             chrome::mojom::FieldTrialRecorderProxy [vtable]
37)  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
38)  42699908 (31.8%) R@0x2cd84f0  8              third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libport_android_jni.a_jni_utils.o
             kSystemClassPrefixes
39)  42699964 (31.8%) R@0x2cd8500  56             third_party/paint.cc
             ChromeMainDelegateAndroid [vtable]
40)  42699988 (31.8%) R@0x2cd8538  24             base/page_allocator.cc
             mojo::MessageReceiver [vtable]
41)  42700000 (31.8%) R@0x2cd8550  12             base/page_allocator.cc
             kMethodsAnimationFrameTimeHistogram
42)  43765132 (32.6%) R@0x2cd855c  1065132        {no path}
             ** .data.rel.ro (unattributed)
43)  43765136 (32.6%) d@0x2de7000  4              base/page_allocator.cc
             google::protobuf::internal::pLinuxKernelCmpxchg
44)  43765140 (32.6%) d@0x2de7004  4              third_party/container/container.c
             google::protobuf::internal::pLinuxKernelMemoryBarrier
45)  43765292 (32.6%) d@0x2de7008  152            third_party/container/container.c
             base::android::kBaseRegisteredMethods
46)  43765296 (32.6%) d@0x2de70a0  4              third_party/container/container.c
             base::android::g_renderer_histogram_code
47)  43765300 (32.6%) d@0x2de70a4  4              third_party/container/container.c
             base::android::g_library_version_number
48)  43866900 (32.7%) d@0x2de70a8  101600         {no path}
             ** .data (unattributed)
49)  43866900 (32.7%) b@0x0        262144         third_party/fft_float.cc
             ff_cos_131072
50)  43866900 (32.7%) b@0x0        131072         third_party/fft_fixed.cc
             ff_cos_131072_fixed
51)  43866900 (32.7%) b@0x0        131072         third_party/fft_float.cc
             ff_cos_65536
52)  43866900 (32.7%) b@0x2dffda0  28             $root_gen_dir/third_party/icu/ucnv_ext.c
             g_chrome_content_browser_client
53)  43866900 (32.7%) b@0x2dffe80  200            $root_gen_dir/third_party/icu/ucnv_ext.c
             SaveHistogram::atomic_histogram_pointer
54)  43866900 (32.7%) b@0x2dffe84  4              $root_gen_dir/third_party/icu/ucnv_ext.c
             g_AnimationFrameTimeHistogram_clazz
55)  43866960 (32.7%) o@0x0        60             {no path}
             ** ELF Section: .ARM.attributes
56)  45403416 (33.8%) o@0x0        1536456        {no path}
             ** ELF Section: .ARM.exidx
57)  45587048 (34.0%) o@0x0        183632         {no path}
             ** ELF Section: .ARM.extab
58)  45587352 (34.0%) o@0x0        304            {no path}
             ** ELF Section: .dynamic
59)  45591377 (34.0%) o@0x0        4025           {no path}
             ** ELF Section: .dynstr
60)  45597873 (34.0%) o@0x0        6496           {no path}
             ** ELF Section: .dynsym
61)  45597881 (34.0%) o@0x0        8              {no path}
             ** ELF Section: .fini_array
62)  45598693 (34.0%) o@0x0        812            {no path}
             ** ELF Section: .gnu.version
63)  45598721 (34.0%) o@0x0        28             {no path}
             ** ELF Section: .gnu.version_d
64)  45598817 (34.0%) o@0x0        96             {no path}
             ** ELF Section: .gnu.version_r
65)  45641773 (34.0%) o@0x0        42956          {no path}
             ** ELF Section: .got
66)  45644457 (34.0%) o@0x0        2684           {no path}
             ** ELF Section: .hash
67)  45644465 (34.0%) o@0x0        8              {no path}
             ** ELF Section: .init_array
68)  45644484 (34.0%) o@0x0        19             {no path}
             ** ELF Section: .interp
69)  45644520 (34.0%) o@0x0        36             {no path}
             ** ELF Section: .note.gnu.build-id
70)  45644548 (34.0%) o@0x0        28             {no path}
             ** ELF Section: .note.gnu.gold-version
71)  45648792 (34.0%) o@0x0        4244           {no path}
             ** ELF Section: .plt
72)  48304176 (36.0%) o@0x0        2655384        {no path}
             ** ELF Section: .rel.dyn
73)  48306992 (36.0%) o@0x0        2816           {no path}
             ** ELF Section: .rel.plt
74)  48307428 (36.0%) o@0x0        436            {no path}
             ** ELF Section: .shstrtab
75)  83149282 (62.0%) o@0x0        34841854       {no path}
             ** ELF Section: .strtab
76)  100315394 (74.7%) o@0x0        17166112       {no path}
             ** ELF Section: .symtab
77)  134218029 (100.0%) o@0x0        33902635       {no path}
             Overhead: ELF file