Skip to content

Commit 6d0de0a

Browse files
committed
docs: document runtime_tracing limitations
1 parent c4be15a commit 6d0de0a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/py-design-001.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,21 @@ Each bullet below represents a low-level operation translating a single `sys.mon
6565
- Unregister callbacks and free the tool ID with `sys.monitoring.free_tool_id`.
6666
- Close the writer and ensure all buffered events are flushed to disk.
6767

68+
## Current Limitations
69+
- **No structured support for threads or async tasks** – the trace format lacks explicit identifiers for concurrent execution.
70+
Distinguishing events emitted by different Python threads or `asyncio` tasks requires ad hoc `Event` entries, complicating
71+
analysis and preventing downstream tools from reasoning about scheduling.
72+
- **Generic `Event` log** – several `sys.monitoring` notifications like resume, unwind, and branch outcomes have no dedicated
73+
`runtime_tracing` variant. They must be encoded as free‑form `Event` logs, which reduces machine readability and hinders
74+
automation.
75+
- **Heavy value snapshots** – arguments and returns expect full `ValueRecord` structures. Serializing arbitrary Python objects is
76+
expensive and often degrades to lossy string dumps, limiting the visibility of rich runtime state.
77+
- **Append‑only path and function tables**`runtime_tracing` assumes files and functions are discovered once and never change.
78+
Dynamically generated code (`eval`, REPL snippets) forces extra bookkeeping and cannot update earlier entries, making
79+
dynamic features awkward to trace.
80+
- **No built‑in compression or streaming** – traces are written as monolithic JSON or binary files. Long sessions quickly grow in
81+
size and cannot be streamed to remote consumers without additional tooling.
82+
6883
## Future Extensions
6984
- Add filtering to enable subsets of events for performance-sensitive scenarios.
7085
- Support streaming traces over a socket for live debugging.

0 commit comments

Comments
 (0)