Open mox692 opened 7 months ago
cc @jswrenn
It's not hard to provide an API here, but it might be hard to provide the right API. The current Tree
type is an implementation detail used to aid printing task dumps. It's not currently designed to function well as a public API for traversing the tracing tree. Rust doesn't have a standard interface for tree traversal, so we'll need to decide for ourselves what interface to expose. We'll also need to ensure that this API doesn't lock us into sub-optimal representation decisions.
Thanks for clarifying the context! Yeah, deciding on the right api seems difficult, but I believe we should eventually reach.
Is your feature request related to a problem? Please describe. Currently, the only supported output for taskdump is logging, as shown in the examples here. However, I would like to add a public API that can extract this backtrace information. By adding such an API, it will become possible to handle taskdump data programmatically, making it useful for various purposes.
Describe the solution you'd like I would like to add a public API something like this:
We already have an internal struct named Tree, so I believe it's not too hard to provide such an API.
Additional context related issue: https://github.com/tokio-rs/tokio/issues/5638