SuperSize: Attribute inline symbols to .h files |
|
Issue description
SuperSize is currently only able to use .cc files as source_paths.
To deal with symbols defined in .h files, it creates a symbol alias for each .cc file that includes the symbol.
>>> s = size_info.symbols.WhereIsNative().Filter(lambda s:s.num_aliases > 2 and s.full_name == s.aliases[0].full_name and s.full_name == s.aliases[-1].full_name)
>>> s.size
606352
>>> len(s)
88146
>>> Print(s.Sorted(key=lambda s:-s.size)[:4])
...
0) 637 (25.0%) t@0x19438fc 637 (size=5102) $root_gen_dir/chrome/common/page_load_metrics/page_load_metrics.mojom.cc
blink::mojom::internal::WebFeature_Data::IsKnownValue (num_aliases=8)
1) 1275 (50.0%) t@0x19438fc 637 (size=5102) $root_gen_dir/chrome/common/page_load_metrics/page_load_metrics.mojom-shared.cc
blink::mojom::internal::WebFeature_Data::IsKnownValue (num_aliases=8)
2) 1913 (75.0%) t@0x19438fc 637 (size=5102) $root_gen_dir/content/common/service_worker/service_worker_container.mojom.cc
blink::mojom::internal::WebFeature_Data::IsKnownValue (num_aliases=8)
3) 2551 (100.0%) t@0x19438fc 637 (size=5102) $root_gen_dir/content/common/shared_worker/shared_worker_client.mojom.cc
blink::mojom::internal::WebFeature_Data::IsKnownValue (num_aliases=8)
Rather than store these symbols as aliases, we should consider trying to set the source_path to the .h file for symbols with > ## aliases (maybe > 3?).
To do this, we could run addr2line (or llvm-symbolizer?) for each alias group to retrieve the .h file from the debug information. e.g.:
../../third_party/android_ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-addr2line -e lib.unstripped/libmonochrome.so 19438fc
./gen/third_party/blink/public/platform/web_feature.mojom-shared-internal.h:28
Given that these symbols make up only 600kb of size, this task is probably low priority, but wanted to get the idea down.
,
Dec 5
Oops the CL in #1 should refer to 892648. |
|
►
Sign in to add a comment |
|
Comment 1 by bugdroid1@chromium.org
, Dec 4