Commit Graph

12 Commits

Author SHA1 Message Date
Alexei Frolov
9c2ed46237 pw_protobuf: Add basic size report for decoder
This change adds a simple size report for the pw::protobuf::Decoder
class with a simple decode callback.

Change-Id: I773cc31df43c5aab1db7044d77439cf8513e6b68
2020-01-14 01:18:45 +00:00
Alexei Frolov
a97e55d084 pw_bloat: Output "(all)" row if no segments differ
This change applies the fix from 0e892b5 to output a row indicating
identical binaries in the case where some segments exist but have no
delta between them.

Bug: 35
Change-Id: I4fdb6ff3de906b648ce75da6f7724d7babef6ac0
2019-12-24 05:09:21 +00:00
Alexei Frolov
3fde6b116f pw_toolchain_size_report template
This change adds a GN template which creates a size report card across
a set of different toolchains. The toolchains are defined in a build
variable, each with an optional linker script and Bloaty config. The
size report template builds a base and diff executable with each of the
toolchains and compares the size difference of each.

Example output for the host target:

             simple_bloat_toolchain
             ──────────────────────
┌───────────┬─────────┬────────┬───────┬───────┐
│   Label   │ Segment │ Before │ Delta │ After │
├═══════════┼═════════┼════════┼═══════┼═══════┤
│   gcc -Og │    CODE │    413 │   +32 │   445 │
│           │     RAM │    576 │    +8 │   584 │
├───────────┼─────────┼────────┼───────┼───────┤
│   gcc -Os │    CODE │    429 │   +16 │   445 │
│           │     RAM │    576 │    +8 │   584 │
├───────────┼─────────┼────────┼───────┼───────┤
│   gcc -O2 │    CODE │    429 │   +32 │   461 │
│           │     RAM │    576 │    +8 │   584 │
├───────────┼─────────┼────────┼───────┼───────┤
│ clang -Og │    CODE │    448 │   +32 │   480 │
│           │     RAM │    113 │   +15 │   128 │
├───────────┼─────────┼────────┼───────┼───────┤
│ clang -Os │    CODE │    432 │   +16 │   448 │
│           │     RAM │    113 │   +15 │   128 │
├───────────┼─────────┼────────┼───────┼───────┤
│ clang -O2 │    CODE │    448 │   +80 │   528 │
│           │     RAM │    113 │   +15 │   128 │
└───────────┴─────────┴────────┴───────┴───────┘

Change-Id: I2c65f4d4f61354b9779628f207297eacd04470b9
2019-12-23 20:37:42 +00:00
Alexei Frolov
6f561b99b6
pw_bloat: exit if bloaty fails
This change updates the bloat script to exit if a Bloaty invocation
fails.

Change-Id: Ica1205f8eb9ecf2a8afef56ba6f3e10140e02da2
2019-12-20 17:12:00 -08:00
Rob Mohr
4b501c6f84
Use --sysroot on Mac.
Fix: 11
Change-Id: Iff15f485294f503f00d3a3f7b9fe8d3bd2eb3544
2019-12-19 11:33:12 -08:00
Rob Mohr
21117d8c25 Run 'pw format --fix' on a few files.
Change-Id: I2300a824443ba9bca56ab1116fb451cb3003ea02
2019-12-16 19:06:00 +00:00
Rob Mohr
6d5d856a10 Misc. pylint fixes.
Change-Id: I4b790ea8801a2a4742004e2d4b111b4f4a1ab9d7
2019-12-10 10:19:30 -08:00
Wyatt Hepler
becb431e5f Apply pw format to the repository
Change-Id: I3c8e4f956dfe6c9e81d3069f72c30c5950852074
2019-12-05 09:31:11 -08:00
Wyatt Hepler
0e892b5b27 pw_bloat: Handle identical binaries
Prints "(all)" as the segment and "(same)" for before/after when bloat
binaries have identical segments. Previously, nothing was printed.

Example output:
┌────────────┬───────────┬────────┬───────┬────────┐
│    Label   │  Segment  │ Before │ Delta │  After │
├════════════┼═══════════┼════════┼═══════┼════════┤
│ Identical! │     (all) │ (same) │     0 │ (same) │
└────────────┴───────────┴────────┴───────┴────────┘

Change-Id: Ib02f0db55a6c8fbba053444b3a33408805e8e0aa
2019-11-19 12:58:31 -08:00
Wyatt Hepler
32d86bb686 python_runner.py and pw_bloat updates
- Support specifying per-binary bases instead of a global base in size
  reports.
- Resolve paths in semicolon-separated paths in python_runner.py.
- Remove --base-target option from bloat.py. Instead, the base must be
  specified for each target.
- Add '\n' to the end of size report text files.
- Apply yapf to python_runner.py and bloat.py.

Change-Id: I3f0e6f16b028e97ed6db4b3d975a9aada98c076a
2019-11-19 12:58:14 -08:00
Alexei Frolov
4c035b0487
Integrate bloat reports into docgen
This change updates the bloat script to output an RST version of its
report card table. Metadata is added to the bloat_report GN template
indicating its RST output, allowing it to be listed as a dependency of
pw_doc_group targets.

Change-Id: I3f098d352856a9dd8688bac44e3b60ddbb97a3a6
2019-11-14 16:39:09 -08:00
Alexei Frolov
e2016763a8
Add pw_bloat module
This change adds a size reporting module named pw_bloat. The module
uses Bloaty McBloatface to generate size report cards for binaries. It
provides a GN template which defines an action to perform a size diff
on a group of binary targets.

Example output:

                       simple_bloat
                       ────────────
┌────────────────┬──────────────┬────────┬───────┬───────┐
│      Label     │    Segment   │ Before │ Delta │ After │
├════════════════┼══════════════┼════════┼═══════┼═══════┤
│     Add a loop │ EXAMPLE CODE │    429 │   +32 │   461 │
│                │ EXAMPLE  RAM │    576 │    +8 │   584 │
├────────────────┼──────────────┼────────┼───────┼───────┤
│ Add a function │ EXAMPLE CODE │    429 │   +16 │   445 │
│                │ EXAMPLE  RAM │    576 │    +8 │   584 │
└────────────────┴──────────────┴────────┴───────┴───────┘

Change-Id: I14b3d383ec450bc6d017bf5d0111e266b0a3c368
2019-11-14 14:29:28 -08:00