pw_bloat: Fix broken size report on pw_bloat docs
Change-Id: Ifa70af64c84208c198881306ba06d2a1d99bc05d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/108870
Commit-Queue: Brandon Vu <brandonvu@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
diff --git a/pw_bloat/docs.rst b/pw_bloat/docs.rst
index 9150c97..083e38d 100644
--- a/pw_bloat/docs.rst
+++ b/pw_bloat/docs.rst
@@ -5,7 +5,7 @@
--------
The bloat module provides tools and helpers around using
`Bloaty McBloatface <https://github.com/google/bloaty>`_ including generating
-generate size report cards for output binaries through Pigweed's GN build
+size report cards for output binaries through Pigweed's GN build
system.
Bloat report cards allow tracking the memory usage of a system over time as code
@@ -68,7 +68,7 @@
}
A sample ``pw_size_diff`` ReST size report table can be found within module
-docs. For example, see the :ref:`pw_checksum-size-report` section of
+docs. For example, see the :ref:`pw_checksum-size-report` section of the
``pw_checksum`` module for more detail.
diff --git a/pw_bloat/examples/BUILD.gn b/pw_bloat/examples/BUILD.gn
index a2afbce..cca1698 100644
--- a/pw_bloat/examples/BUILD.gn
+++ b/pw_bloat/examples/BUILD.gn
@@ -16,20 +16,39 @@
import("../bloat.gni")
-pw_toolchain_size_diff("simple_bloat_loop") {
- base_executable = {
- sources = [ "simple_base.cc" ]
- }
- diff_executable = {
- sources = [ "simple_loop.cc" ]
- }
+import("$dir_pw_build/target_types.gni")
+
+pw_executable("simple_base") {
+ sources = [ "simple_base.cc" ]
+ deps = [ "$dir_pw_bloat:bloat_this_binary" ]
}
-pw_toolchain_size_diff("simple_bloat_function") {
- base_executable = {
- sources = [ "simple_base.cc" ]
- }
- diff_executable = {
- sources = [ "simple_function.cc" ]
- }
+pw_executable("simple_loop") {
+ sources = [ "simple_loop.cc" ]
+ deps = [ "$dir_pw_bloat:bloat_this_binary" ]
+}
+
+pw_executable("simple_function") {
+ sources = [ "simple_function.cc" ]
+ deps = [ "$dir_pw_bloat:bloat_this_binary" ]
+}
+
+pw_size_diff("simple_bloat_loop") {
+ binaries = [
+ {
+ target = ":simple_loop"
+ base = ":simple_base"
+ label = "Simple bloat loop"
+ },
+ ]
+}
+
+pw_size_diff("simple_bloat_function") {
+ binaries = [
+ {
+ target = ":simple_function"
+ base = ":simple_base"
+ label = "Simple bloat function"
+ },
+ ]
}