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
diff --git a/pw_bloat/docs.rst b/pw_bloat/docs.rst
index 73003a1..5767234 100644
--- a/pw_bloat/docs.rst
+++ b/pw_bloat/docs.rst
@@ -1,15 +1,20 @@
-.. _chapter-bloat:
-
.. default-domain:: cpp
.. highlight:: sh
+.. _chapter-bloat:
+
--------
pw_bloat
--------
The bloat module provides tools to generate size report cards for output
binaries.
+.. _bloat-howto:
+
+Defining size reports
+=====================
+
.. TODO(frolv): Explain how bloat works and how to set it up.
Documentation integration
@@ -19,13 +24,25 @@
can be imported directly into a documentation file using the ``include``
directive.
-For example, the ``simple_bloat`` bloat report under ``//pw_bloat/examples``
-is imported into this file as follows:
+For example, the ``simple_bloat_loop`` and ``simple_bloat_function`` size
+reports under ``//pw_bloat/examples`` are imported into this file as follows:
.. code:: rst
- .. include:: examples/simple_bloat.rst
+ Simple bloat loop example
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
+ .. include:: examples/simple_bloat_loop.rst
+
+ Simple bloat function example
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ .. include:: examples/simple_bloat_function.rst
Resulting in this output:
-.. include:: examples/simple_bloat.rst
+Simple bloat loop example
+^^^^^^^^^^^^^^^^^^^^^^^^^
+.. include:: examples/simple_bloat_loop.rst
+
+Simple bloat function example
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. include:: examples/simple_bloat_function.rst