OLD | NEW |
1 ******************************************************************************** | 1 ******************************************************************************** |
2 Entering interactive Python shell. Quick reference: | 2 Entering interactive Python shell. Quick reference: |
3 | 3 |
4 SizeInfo: Cluster, metadata, section_sizes, symbols | 4 SizeInfo: Clustered, metadata, raw_symbols, 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 | 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, template_name |
6 | 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 | 7 SymbolGroup (extends Symbol): Clustered, CountUniqueSymbols, Filter, GroupedBy,
GroupedByName, GroupedByPath, GroupedBySectionName, Inverted, IterLeafSymbols, I
terUniqueSymbols, Sorted, SortedByAddress, SortedByCount, SortedByName, WhereAdd
ressInRange, WhereBiggerThan, WhereFullNameMatches, WhereGeneratedByToolchain, W
hereHasAnyAttribution, WhereHasPath, WhereInSection, WhereIsTemplate, WhereMatch
es, WhereNameMatches, WhereObjectPathMatches, WherePathMatches, WhereSourceIsGen
erated, WhereSourcePathMatches, WhereTemplateNameMatches, is_sorted |
8 | 8 |
9 SymbolDiff (extends SymbolGroup): IsAdded, IsRemoved, IsSimilar, WhereNotUnchang
ed, added_count, changed_count, removed_count, unchanged_count | 9 SymbolDiff (extends SymbolGroup): IsAdded, IsRemoved, IsSimilar, WhereNotUnchang
ed, added_count, changed_count, removed_count, unchanged_count |
10 | 10 |
11 canned_queries: CategorizeByChromeComponent, CategorizeGenerated | 11 canned_queries: CategorizeByChromeComponent, CategorizeGenerated, TemplatesByNam
e |
12 | 12 |
13 Functions: Diff(), Disassemble(), ExpandRegex(), Print(), ShowExamples() | 13 Functions: Diff(), Disassemble(), ExpandRegex(), Print(), ShowExamples() |
14 Variables: canned_queries, size_info | 14 Variables: canned_queries, size_info |
15 ******************************************************************************** | 15 ******************************************************************************** |
16 # Show pydoc for main types: | 16 # Show pydoc for main types: |
17 import models | 17 import models |
18 help(models) | 18 help(models) |
19 | 19 |
20 # Show all attributes of all symbols & per-section totals: | 20 # Show all attributes of all symbols & per-section totals: |
21 Print(size_info, verbose=True) | 21 Print(size_info, verbose=True) |
22 | 22 |
23 # Show two levels of .text, grouped by first two subdirectories | 23 # Show two levels of .text, grouped by first two subdirectories |
24 text_syms = size_info.symbols.WhereInSection("t") | 24 text_syms = size_info.symbols.WhereInSection("t") |
25 by_path = text_syms.GroupByPath(depth=2) | 25 by_path = text_syms.GroupedByPath(depth=2) |
26 Print(by_path.WhereBiggerThan(1024)) | 26 Print(by_path.WhereBiggerThan(1024)) |
27 | 27 |
28 # Show all non-vtable generated symbols | 28 # Show all non-vtable generated symbols |
29 generated_syms = size_info.symbols.WhereGeneratedByToolchain() | 29 generated_syms = size_info.symbols.WhereGeneratedByToolchain() |
30 Print(generated_syms.WhereNameMatches(r"vtable").Inverted().Sorted()) | 30 Print(generated_syms.WhereNameMatches(r"vtable").Inverted().Sorted()) |
31 | 31 |
32 # 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 |
33 # those within components/. | 33 # those within components/. |
34 # Note: Could have also used Inverted(), as above. | 34 # Note: Could have also used Inverted(), as above. |
35 # Note: Use "help(ExpandRegex)" for more about what {{_print_}} does. | 35 # Note: Use "help(ExpandRegex)" for more about what {{_print_}} does. |
36 print_syms = size_info.symbols.WhereMatches(r"{{_print_}}") | 36 print_syms = size_info.symbols.WhereMatches(r"{{_print_}}") |
37 Print(print_syms - print_syms.WherePathMatches(r"^components/")) | 37 Print(print_syms - print_syms.WherePathMatches(r"^components/")) |
38 | 38 |
39 # Diff two .size files and save result to a file: | 39 # Diff two .size files and save result to a file: |
40 Print(Diff(size_info1, size_info2), to_file="output.txt") | 40 Print(Diff(size_info1, size_info2), to_file="output.txt") |
41 | 41 |
42 # View per-component breakdowns, then drill into the last entry. | 42 # View per-component breakdowns, then drill into the last entry. |
43 c = canned_queries.CategorizeByChromeComponent() | 43 c = canned_queries.CategorizeByChromeComponent() |
44 Print(c) | 44 Print(c) |
45 Print(c[-1].GroupByPath(depth=2).Sorted()) | 45 Print(c[-1].GroupedByPath(depth=2).Clustered().Sorted()) |
46 | 46 |
47 # For even more inspiration, look at canned_queries.py | 47 # For even more inspiration, look at canned_queries.py |
48 # (and feel free to add your own!). | 48 # (and feel free to add your own!). |
49 Metadata: | 49 Metadata: |
50 elf_arch=arm | 50 elf_arch=arm |
51 elf_build_id=WhatAnAmazingBuildId | 51 elf_build_id=WhatAnAmazingBuildId |
52 elf_file_name=elf | 52 elf_file_name=elf |
53 elf_mtime={redacted} | 53 elf_mtime={redacted} |
54 git_revision=abc123 | 54 git_revision=abc123 |
55 gn_args=var1=true var2="foo" | 55 gn_args=var1=true var2="foo" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 43) 43785380 (98.8%) b@0x0 131072 third_party/fft_fixed.cc | 157 43) 43785380 (98.8%) b@0x0 131072 third_party/fft_fixed.cc |
158 ff_cos_131072_fixed | 158 ff_cos_131072_fixed |
159 44) 43785380 (98.8%) b@0x0 131072 third_party/fft_float.cc | 159 44) 43785380 (98.8%) b@0x0 131072 third_party/fft_float.cc |
160 ff_cos_65536 | 160 ff_cos_65536 |
161 45) 43785380 (98.8%) b@0x2dffda0 28 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 | 162 g_chrome_content_browser_client |
163 46) 43785380 (98.8%) b@0x2dffe80 200 third_party/icu/ucnv_ext.c | 163 46) 43785380 (98.8%) b@0x2dffe80 200 third_party/icu/ucnv_ext.c |
164 SaveHistogram::atomic_histogram_pointer | 164 SaveHistogram::atomic_histogram_pointer |
165 47) 43785380 (98.8%) b@0x2dffe84 4 third_party/icu/ucnv_ext.c | 165 47) 43785380 (98.8%) b@0x2dffe84 4 third_party/icu/ucnv_ext.c |
166 g_AnimationFrameTimeHistogram_clazz | 166 g_AnimationFrameTimeHistogram_clazz |
OLD | NEW |