summaryrefslogtreecommitdiff
path: root/include/config.h
diff options
context:
space:
mode:
authorPeter Marheine <pmarheine@chromium.org>2022-12-05 16:29:23 +1100
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-12-09 03:54:17 +0000
commit53c21ecb2ba9869430d9f1cb38bd1d84a4ab7707 (patch)
tree3dc089250da0ba6d4a96c92b522fd8dee72d92d1 /include/config.h
parentc4a6d69d4aff004cab93ec7413e3721580ed9c70 (diff)
downloadchrome-ec-53c21ecb2ba9869430d9f1cb38bd1d84a4ab7707.tar.gz
usb_prl: support logging to a ring buffer
This allows PRL state logging to be displayed asynchronously, with minimal effect on performance during operation and making it more tractable to debug timing-sensitive behavior. Events are logged unconditionally if logging is enabled, and displayed with the `prllog` console command. Output looks like this: 5489349 C0 PRL_TX_DISCARD_MESSAGE PRL_TX Set 0x4 : PRL_FLAGS_WAIT_SINK_OK | 5489440 C0 PRL_TX_PHY_LAYER_RESET PRL_TX Set 0x4 : PRL_FLAGS_WAIT_SINK_OK | 5489532 C0 PRL_TX_WAIT_FOR_MESSAGE_REQUEST PRL_TX Set 0x4 : PRL_FLAGS_WAIT_SINK_OK | Fields are the event timestamp (in microseconds), followed by the port and state name with the state machine flags on the rest of the line. BUG=b:229692652 TEST=prllog on nereid console prints correct-looking states when CONFIG_PLATFORM_EC_USB_PD_PRL_EVENT_LOG=y BRANCH=none Change-Id: I5ba9f0ee65613e5889b606484a62fe60ebe0b2b8 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4078586 Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Andrew McRae <amcrae@google.com>
Diffstat (limited to 'include/config.h')
-rw-r--r--include/config.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h
index 9519e35e5c..f353ef0d73 100644
--- a/include/config.h
+++ b/include/config.h
@@ -4719,6 +4719,17 @@
/* Record main PD events in a circular buffer */
#undef CONFIG_USB_PD_LOGGING
+/*
+ * Record PRL state transitions in a ring buffer, readable via the `prllog`
+ * console command.
+ */
+#undef CONFIG_USB_PD_PRL_EVENT_LOG
+/*
+ * Number of events that can be stored in the PRL log (after this many, the
+ * oldest entries will be replaced with new ones).
+ */
+#define CONFIG_USB_PD_PRL_EVENT_LOG_CAPACITY 128
+
/* The size in bytes of the FIFO used for event logging */
#define CONFIG_EVENT_LOG_SIZE 512