pw_thread_threadx: Add basic thread snapshotting

Adds an optional library for capturing ThreadX thread state in
proto snapshots.

Change-Id: I47dbc5a57faf3d4411255ea83f04f17bf0a4dc46
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/51405
Commit-Queue: Rob Mohr <mohrr@google.com>
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
diff --git a/pw_thread/docs.rst b/pw_thread/docs.rst
index 9b03369..c2f6647 100644
--- a/pw_thread/docs.rst
+++ b/pw_thread/docs.rst
@@ -220,3 +220,24 @@
   Because the thread may start after the pw::Thread creation, an object which
   implements the ThreadCore MUST meet or exceed the lifetime of its thread of
   execution!
+
+-----------------------
+pw_snapshot integration
+-----------------------
+``pw_thread`` provides some light, optional integration with pw_snapshot through
+helper functions for populating a ``pw::thread::Thread`` proto. Some of these
+are directly integrated into the RTOS thread backends to simplify the thread
+state capturing for snapshots.
+
+SnapshotStack()
+===============
+The ``SnapshotStack()`` helper captures stack metadata (stack pointer and
+bounds) into a ``pw::thread::Thread`` proto. After the stack bounds are
+captured, execution is passed off to the thread stack collection callback to
+capture a backtrace or stack dump. Note that this function does NOT capture the
+thread name: that metadata is only required in cases where a stack overflow or
+underflow is detected.
+
+.. Warning::
+  Snapshot integration is a work-in-progress and may see significant API
+  changes.