pw_trace_tokenized: Fix incorrect timestamp Issue reproduce: 1. start tracing 2. stop tracing 3. fetch trace data 4. start tracing again 5. stop tracing 6. fetch trace data 7. timestamp for trace entry is not correct Root cause: In current design, timestamp of the first trace event represents real time, timestamps of subsequent trace events represent time difference between current trace event and the previous trace event. The issue in existing code is that real time is only used for the first trace event of the first round of tracing. Subsequent rounds of tracing doesn't use real time for the first trace event. Bug: 433273214 Change-Id: I7c48422db4d3562bc8815311b66ea7e53508053e Signed-off-by: Chris Guo <chrisguo@google.com> Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/306952 Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com> Reviewed-by: Dave Roth <davidroth@google.com> Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> Docs-Not-Needed: Dave Roth <davidroth@google.com> Commit-Queue: Dave Roth <davidroth@google.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.