Commit Graph

9 Commits

Author SHA1 Message Date
Alexei Frolov
4737349f12 Update docs target to only use ARM size reports
This change removes the host gcc and clang toolchains from the docs
target's toolchain size reports and switches the default toolchain to
ARM GCC for traditional size report targets.

Fixed: 122

Change-Id: Iafe7cedb160d16eea6f3d9d4f64671814bb73b80
2020-03-04 01:13:34 +00:00
Rob Mohr
a0ba54f648 Roll GN to 239533d
This caused gn format to flag many things which were also fixed.

Change-Id: Ie1d9081a1b08047bec52c60f54d2a94366be1ba6
2020-02-28 01:33:18 +00:00
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
f8259f6717 pw_bloat: Provide empty base as a variable
This change moves the contents of the pw_bloat:bloat_base executable
into a variable provided by bloat.gni, allowing it to be used in
pw_toolchain_size_report targets.

Change-Id: Icb45aaf7e6da4cc107649811763ccd00ee258045
2020-01-09 21:28:19 +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
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
0944784e8e Minor pw_bloat updates
This change renames the bloat_report template to pw_size_report as it is
more explicit.

Additionally, the option to override the global Bloaty config file on a
per-report basis is removed. This is due to Pigweed's policy of having
one target per build invocation. The Bloaty config is inherently tied to
an executable build target and linker script, both of which are provided
by the target. Overriding the Bloaty config without changing the target
can result in meaningless report output.

Change-Id: I1fa444d065d964a3a85ade50039e06ae807050f2
2019-11-15 23:23:26 +00: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