New issue
Advanced search Search tips

Issue 921426 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

SuperSize: Add Quality-Control Sanity Checks

Project Member Reported by agrieve@chromium.org, Jan 14

Issue description

We've had supersize subtly break on us in a couple ways when:
1. Transitioning to LTO (loss of source paths, string literals), and
2. When outlining was introduced (caused 10x regression in runtime).

It would be great if supersize did some sanity checks to prevent these kinds of things slipping through.

When you run supersize archive with -v, it shows a bunch of stats at the end that looks like:

I  69569 Section .text: has 100.0% of 39502426 bytes accounted for from 652483 symbols. 0 bytes are unaccounted for.
I  69602 * 651169 have source paths assigned (99.8%)
I  69773 * Padding accounts for 72360 bytes (0.2%)
I  69773 * 3 anonymous symbols account for 2 bytes (0.0%)
I  69911 * Contains 395901 aliases, mapped to 47768 unique addresses (12334636 bytes saved)
I  70014 * 2044 symbols have shared ownership (61350 bytes)
I  70114 Section .rodata: has 100.0% of 6367654 bytes accounted for from 139201 symbols. 0 bytes are unaccounted for.
I  70135 * 136531 have source paths assigned (98.1%)
I  70201 * Padding accounts for 18392 bytes (0.3%)
I  70202 * 18 anonymous symbols account for 1062 bytes (0.0%)
I  70279 * Contains 119920 string literals. Total size=2863661, padding=16067
I  70322 * Contains 42307 aliases, mapped to 15373 unique addresses (727855 bytes saved)
I  70372 * 162 symbols have shared ownership (2409 bytes)
I  70421 Section .data.rel.ro: has 100.0% of 2025272 bytes accounted for from 32648 symbols. 0 bytes are unaccounted for.
I  70424 * 30525 have source paths assigned (93.5%)
I  70432 * Padding accounts for 528 bytes (0.0%)
I  70434 * Contains 3617 aliases, mapped to 904 unique addresses (87184 bytes saved)
I  70439 * 23 symbols have shared ownership (760 bytes)
I  70471 Section .data: has 100.0% of 151956 bytes accounted for from 3019 symbols. 0 bytes are unaccounted for.
I  70471 * 3000 have source paths assigned (99.4%)
I  70472 * Padding accounts for 138 bytes (0.1%)
I  70473 * Contains 261 aliases, mapped to 44 unique addresses (2800 bytes saved)
I  70480 * 0 symbols have shared ownership
I  70515 Section .bss: has 100.0% of 1100120 bytes accounted for from 21553 symbols. 0 bytes are unaccounted for.
I  70516 * 21460 have source paths assigned (99.6%)
I  70528 * Padding accounts for 1764 bytes (0.2%)
I  70529 * Contains 3239 aliases, mapped to 634 unique addresses (12852 bytes saved)
I  70533 * 7 symbols have shared ownership (28 bytes)
I  70581 Section .dex: has 11.8% of 865392 bytes accounted for from 46473 symbols. 6486506 bytes are unaccounted for.
I  70585 * 44936 have source paths assigned (96.7%)
I  70600 * Padding accounts for 0 bytes (0.0%)
I  70603 * Contains 0 aliases
I  70612 * 0 symbols have shared ownership
I  70643 Section .pak.translations: has 92.8% of 1716454 bytes accounted for from 1780 symbols. 133343 bytes are unaccounted for.
I  70643 * 1684 have source paths assigned (94.6%)
I  70644 * Padding accounts for 1895 bytes (0.1%)
I  70644 * Contains 275 aliases, mapped to 110 unique addresses (133343 bytes saved)
I  70644 * 0 symbols have shared ownership
I  70694 Section .pak.nontranslated: has 80.6% of 1459654 bytes accounted for from 704 symbols. 350351 bytes are unaccounted for.
I  70694 * 700 have source paths assigned (99.4%)
I  70695 * Padding accounts for 59 bytes (0.0%)
I  70695 * Contains 169 aliases, mapped to 63 unique addresses (350351 bytes saved)
I  70708 * 0 symbols have shared ownership
I  70736 Section .other: has 100.0% of 15701186 bytes accounted for from 2401 symbols. 0 bytes are unaccounted for.
I  70737 * 2399 have source paths assigned (99.9%)
I  70738 * Padding accounts for 433448 bytes (2.8%)
I  70738 * Contains 0 aliases
I  70738 * 0 symbols have shared ownership
I  70738 Recorded info for 965394 symbols


Ideas for sanity checks:
 * Does not take longer than 10 minutes to run
 * Each section has >90% source paths
 * Each section has padding of < 1% (except for .other, which should use 5%)
 * Each section has Anonymous symbols account for < 1% of size.
 * .rodata has > 10% of size from string literals (when string literal extraction is enabled)


When a sanity check fails, we should exit with a error status code so that bots fail and we notice the regression.
 

Comment 1 by agrieve@chromium.org, Yesterday (38 hours ago)

Labels: binary_size_team_q1_2019

Sign in to add a comment