Commit Graph

12 Commits

Author SHA1 Message Date
Wyatt Hepler
338c6a1002 pw_metric: Add comment and fix typo in proto
Change-Id: Ic1f5fa8174e73306cd6ab3130e42ca12becbd0f1
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/20180
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-10-08 20:49:15 +00:00
Wyatt Hepler
f9fb90f299 docs: Make labels consistent; remove boilerplate
- Update labels so they use consistent naming. Instead of the
  copy-and-pasted `chapter` prefix, name labels with a prefix consistent
  with what they point to:
  - "module-" for module
  - "target-" for targets
  - "docs-" for general documentation
- Remove the unnecessary highlight and default-domain directives.
  Neither is necessary since the Pigweed docs always specify the
  language in code snippets and other directives.

Change-Id: I55c34e9ec919f6f4670e5d3d008e0edf5fecf05b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19328
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-10-01 21:47:35 +00:00
Wyatt Hepler
d78f7c6b75 pw_status: Update Status::CODE to Status::Code()
- Update Status::CODE style to Status::Code() using
  pw_status/update_style.py.
- Make minor adjustments to the pw_assert tests to get them passing.

Change-Id: Ie54c3c605178fd1e42c7cedbcff324115f3ed279
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19165
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
2020-09-30 18:09:44 +00:00
Alexei Frolov
e467579086 misc: Size report binary fixes
This fixes compiler errors that occur within various size reports.

Change-Id: Icdfd439ace38e5183c46a92fc73c39b24ea8638e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/17628
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
2020-09-08 23:12:30 +00:00
Wyatt Hepler
eb3304c276 pw_preprocessor: Rename macro_arg_count.h
- Rename macro_arg_count.h to arguments.h
- Have macro_arg_count.h #include the renamed header for compatibility.

Change-Id: I781a457af88c6dd63ab8f8394bfe45cff9bc71e9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/17500
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-09-08 17:45:35 +00:00
Paul Mathieu
990fab91e6 pw_metric: allow global groups everywhere
Testing done:
- added a compilation test

Change-Id: I32403965d3a565540d141a4fd01bf13a97184cec
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/17220
Commit-Queue: Paul Mathieu <paulmathieu@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-08-31 18:33:59 +00:00
Paul Mathieu
2182c6688c pw_metric: add _STATIC variants
This adds PW_METRIC_STATIC and PW_METRIC_GROUP_STATIC, which do the same
as their non-_STATIC siblings, except that the object that they create
gets a `static` storage.

This can be useful, e.g. to have metrics inside of functions, when the
function itself is to be instrumented.

This CL also removes an extraneous stringification in the metric and
group names, which resulted in double double quotes.

Ah, and I also implemented PW_METRIC_GROUP with 3 parameters, which was
referenced in the documentation but not formally implemented.

Change-Id: Ife06f3759c49cb5cc15a571334e65b8f48051a6c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/16980
Commit-Queue: Paul Mathieu <paulmathieu@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-08-31 18:26:09 +00:00
Wyatt Hepler
7a5e4d66bd pw_tokenizer: Update C naming style
- Update C symbols to the module_name_SymbolName style.
- Rename and move the token alias.
- Update pw_metric/metric.h to refer to pw::tokenizer::Token instead of
  uint32_t.

Change-Id: I75c5df8a690b9c29472a8e64c6d82aa4fefca6aa
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/17160
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-08-31 16:51:46 +00:00
Keir Mierle
612880968d pw_metric: Update PW_METRIC() API usage in docs
A previous API change to add an explicit name parameter to the PW_METRIC
and PW_METRIC_GROUP macros didn't update all uses in the docs.

Change-Id: I2a4193b3b670c3e4896ae03784078700546e5e28
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/16342
Commit-Queue: Keir Mierle <keir@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
2020-08-20 22:57:27 +00:00
Keir Mierle
9b51cdf629 pw_metric: Add size report
This adds a size report for pw_metric, not including the RPC service.
The report shows the impact of having a few metrics, of dumping, and of
adding more metrics.

At this time, the flash usage on Cortex-M4 is unexpectedly large due to
the creation of large static constructors. This will require followup
CLs to address.

This CL also moves a few inlined methods from the .h file into the .cc
to reduce code size.

Change-Id: Ie0cb041a6e1e5e77c921e9078adea2eaabccdd43
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/16300
Commit-Queue: Keir Mierle <keir@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
2020-08-20 22:46:37 +00:00
Keir Mierle
f4dfd87bb5 pw_metric: Metric RPC service
This adds a metric RPC service, which exposes a metric tree. The user
selects which metrics to expose. The metric tree is sent via streaming
RPC to enable streaming potentially large sets of metrics.

Change-Id: Ib308995b8f7f91ce439ca42fe298f802d4bdf7e3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/16003
Commit-Queue: Keir Mierle <keir@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
2020-08-20 21:48:27 +00:00
Keir Mierle
45fa7859d8 pw_metric: Create new module
This starts the metrics module, which will eventually offer facilities
to track metrics about a system, like average memory use, or other
performance counters.

Change-Id: I2b9dd089cbc2a15af295661fda6f8a6c30353d45
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/15441
Commit-Queue: Keir Mierle <keir@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Fateh Singh <fsingh@google.com>
Reviewed-by: Zoltan Szatmary-Ban <szatmz@google.com>
2020-08-14 02:38:03 +00:00