|
Uni20
Asynchronous tensor and runtime library.
|
Tracks coroutine and epoch-context lifecycle events in debug builds. More...
#include <task_registry_debug.hpp>
Classes | |
| struct | CoroutineExceptionDiagnosticsOptions |
| Runtime policy for diagnostics captured when an exception escapes a coroutine. More... | |
| struct | DiagnosticsServiceOptions |
| Options for the opt-in background DAG diagnostics service. More... | |
| struct | GraphvizDumpOptions |
| File-output options for Graphviz DAG dumps. More... | |
Public Types | |
| enum class | DumpMode { None , Basic , Full } |
| Verbosity levels for registry dump output. More... | |
| enum class | EpochTaskRole { Reader , Writer } |
| Role of a coroutine relative to an epoch context. More... | |
| using | GraphDiagnostics = TaskRegistryGraphDiagnostics |
| Structured async DAG diagnostic result type. | |
| using | GraphSnapshot = TaskRegistryGraphSnapshot |
| Structured async DAG snapshot type. | |
| using | StacktraceOptions = TaskRegistryStacktraceOptions |
| Runtime controls for stacktrace formatting in debug output. | |
| enum class | TaskState { Constructed , Running , Suspended , Failed , Leaked } |
| Logical lifecycle states tracked for each coroutine handle. More... | |
Static Public Member Functions | |
| static void | bind_epoch_task (async::EpochContext const *epoch_context, std::coroutine_handle<> h, EpochTaskRole role) |
| Associates a coroutine with an epoch context as reader or writer. | |
| static CoroutineExceptionDiagnosticsOptions | coroutine_exception_diagnostics_options () |
| Returns the active automatic coroutine-exception diagnostics policy. | |
| static CoroutineExceptionDiagnosticsOptions | default_coroutine_exception_diagnostics_options () |
| Returns the environment-derived automatic coroutine-exception diagnostics policy. | |
| static DiagnosticsServiceOptions | default_diagnostics_service_options () |
| Returns default diagnostics-service options. | |
| static GraphvizDumpOptions | default_graphviz_dump_options () |
| Returns default Graphviz file-output options. | |
| static std::string | default_graphviz_dump_path () |
| Creates a default DOT output path for the current process. | |
| static std::string | default_graphviz_dump_path (GraphvizDumpOptions const &options) |
| Creates a default DOT output path for the current process. | |
| static StacktraceOptions | default_stacktrace_options () |
| Returns default stacktrace formatting options. | |
| static void | destroy_epoch_context (async::EpochContext const *epoch_context) |
| Removes an epoch context from debug tracking. | |
| static void | destroy_task (std::coroutine_handle<> h) |
| Marks a coroutine handle as destroyed. | |
| static GraphDiagnostics | diagnose_snapshot (GraphSnapshot const &snapshot) |
| Diagnoses blocked tasks, missing writers, and dependency cycles in a graph snapshot. | |
| static void | dump () |
| Prints global task-registry diagnostics. | |
| static void | dump_epoch_context (async::EpochContext const *epoch_context, char const *reason=nullptr) |
| Prints diagnostics for a specific epoch context. | |
| static void | dump_graphviz (std::FILE *stream=stderr) |
| Prints a Graphviz DOT snapshot to a C stream. | |
| static bool | dump_graphviz_file (std::string const &path) |
| Writes a Graphviz DOT snapshot to a file. | |
| static bool | dump_graphviz_file_best_effort (std::string const &path) |
| Writes a best-effort Graphviz DOT snapshot to a file. | |
| static DumpMode | dump_mode () noexcept |
| Reports the current debug dump mode. | |
| static std::vector< std::coroutine_handle<> > | epoch_reader_tasks (async::EpochContext const *epoch_context) |
| Returns coroutine handles currently bound as readers. | |
| static std::vector< std::coroutine_handle<> > | epoch_writer_tasks (async::EpochContext const *epoch_context) |
| Returns coroutine handles currently bound as writers. | |
| static std::string | graphviz_dot () |
| Returns a Graphviz DOT snapshot of the currently tracked async DAG. | |
| static std::string | graphviz_dot (GraphSnapshot const &snapshot) |
| Renders a graph snapshot as Graphviz DOT. | |
| static std::string | graphviz_dot (GraphSnapshot const &snapshot, GraphDiagnostics const &diagnostics) |
| Renders a graph snapshot and diagnostics as Graphviz DOT. | |
| static std::string | graphviz_dot_best_effort () |
| Returns a best-effort Graphviz DOT snapshot without waiting indefinitely for locks. | |
| static void | leak_task (std::coroutine_handle<> h) |
| Marks a coroutine handle as leaked. | |
| static void | mark_running (std::coroutine_handle<> h) |
| Marks a coroutine handle as currently running. | |
| static void | mark_suspended (std::coroutine_handle<> h) |
| Marks a coroutine handle as suspended. | |
| static void | name_async_value (async::NodeInfo const *node, std::string const &label) |
| Assigns an optional human-readable label to an async value node. | |
| static void | name_task (std::coroutine_handle<> h, std::string const &label) |
| Assigns an optional human-readable label to a coroutine task. | |
| static void | record_await_dependency (std::coroutine_handle<> h, async::NodeInfo const *node, EpochTaskRole role) |
| Records a buffer dependency discovered at a concrete co_await site. | |
| static void | record_task_dependencies (std::coroutine_handle<> h, std::vector< async::NodeInfo const * > const &read_dependencies, std::vector< async::NodeInfo const * > const &write_dependencies) |
| Records constructor-discovered coarse DAG dependencies for a coroutine. | |
| static void | record_task_scheduled (std::coroutine_handle<> h) |
| Records the call stack where a coroutine was submitted to a scheduler. | |
| static void | record_unhandled_exception (std::coroutine_handle<> h, std::exception_ptr exception, bool originating_failure) noexcept |
| Records an exception escaping a coroutine and optionally captures its live DAG. | |
| static void | register_epoch_context (async::EpochContext const *epoch_context) |
| Registers an epoch context for debug tracking. | |
| static void | register_task (std::coroutine_handle<> h) |
| Registers a newly-created coroutine handle. | |
| static void | request_graphviz_dump () noexcept |
| Queues one Graphviz dump request for scheduler or service processing. | |
| static void | reset_coroutine_exception_diagnostics_options () |
| Resets the automatic coroutine-exception diagnostics policy from the environment. | |
| static void | reset_stacktrace_options () |
| Resets active stacktrace formatting options from environment defaults. | |
| static bool | service_debug_requests () |
| Processes pending dump requests on the calling thread. | |
| static bool | service_debug_requests (GraphvizDumpOptions const &options) |
| Processes pending dump requests on the calling thread. | |
| static void | set_coroutine_exception_diagnostics_options (CoroutineExceptionDiagnosticsOptions const &options) |
| Replaces the process-wide automatic coroutine-exception diagnostics policy. | |
| static void | set_stacktrace_options (StacktraceOptions const &options) |
| Replaces active stacktrace formatting options. | |
| static GraphSnapshot | snapshot () |
| Captures the current task/epoch/value DAG as structured data. | |
| static GraphSnapshot | snapshot_best_effort () |
| Captures a best-effort task/epoch/value DAG snapshot without indefinite lock waits. | |
| static StacktraceOptions | stacktrace_options () |
| Returns active stacktrace formatting options. | |
| static bool | start_diagnostics_service () |
| Starts the optional background DAG diagnostics service. | |
| static bool | start_diagnostics_service (DiagnosticsServiceOptions const &options) |
| Starts the optional background DAG diagnostics service. | |
| static void | stop_diagnostics_service () noexcept |
| Stops the background DAG diagnostics service if it is running. | |
| static void | unbind_epoch_task (async::EpochContext const *epoch_context, std::coroutine_handle<> h, EpochTaskRole role) |
| Removes a coroutine-role binding from an epoch context. | |
Tracks coroutine and epoch-context lifecycle events in debug builds.
Structured async DAG diagnostic result type.
Structured async DAG snapshot type.
Runtime controls for stacktrace formatting in debug output.
|
strong |
|
strong |
|
strong |
|
static |
Associates a coroutine with an epoch context as reader or writer.
| epoch_context | Epoch context being accessed. |
| h | Coroutine handle to bind. |
| role | Reader or writer role for the binding. |
|
static |
Returns the active automatic coroutine-exception diagnostics policy.
|
static |
Returns the environment-derived automatic coroutine-exception diagnostics policy.
UNI20_DEBUG_DAG_DUMP_ON_EXCEPTION and the default Graphviz output settings.
|
static |
Returns default diagnostics-service options.
|
static |
Returns default Graphviz file-output options.
|
static |
Creates a default DOT output path for the current process.
|
static |
Creates a default DOT output path for the current process.
| options | File-output options. |
|
static |
Returns default stacktrace formatting options.
|
static |
Removes an epoch context from debug tracking.
| epoch_context | Epoch context pointer to remove. |
|
static |
Marks a coroutine handle as destroyed.
| h | Coroutine handle being destroyed. |
|
static |
Diagnoses blocked tasks, missing writers, and dependency cycles in a graph snapshot.
| snapshot | Structured graph snapshot to inspect. |
|
static |
Prints global task-registry diagnostics.
|
static |
Prints diagnostics for a specific epoch context.
| epoch_context | Epoch context to print. |
| reason | Optional label for the dump trigger. |
|
static |
Prints a Graphviz DOT snapshot to a C stream.
| stream | Destination stream. Defaults to stderr. |
|
static |
Writes a Graphviz DOT snapshot to a file.
| path | Destination path. |
|
static |
Writes a best-effort Graphviz DOT snapshot to a file.
| path | Destination path. |
|
staticnoexcept |
Reports the current debug dump mode.
|
static |
Returns coroutine handles currently bound as readers.
| epoch_context | Epoch context to inspect. |
|
static |
Returns coroutine handles currently bound as writers.
| epoch_context | Epoch context to inspect. |
|
static |
Returns a Graphviz DOT snapshot of the currently tracked async DAG.
|
static |
Renders a graph snapshot as Graphviz DOT.
| snapshot | Structured graph snapshot to render. |
|
static |
Renders a graph snapshot and diagnostics as Graphviz DOT.
| snapshot | Structured graph snapshot to render. |
| diagnostics | Diagnostic annotations for the snapshot. |
|
static |
Returns a best-effort Graphviz DOT snapshot without waiting indefinitely for locks.
|
static |
Marks a coroutine handle as leaked.
| h | Coroutine handle intentionally leaked. |
|
static |
Marks a coroutine handle as currently running.
| h | Coroutine handle that resumed execution. |
|
static |
Marks a coroutine handle as suspended.
| h | Coroutine handle that suspended execution. |
|
static |
Assigns an optional human-readable label to an async value node.
| node | Async value node to label. |
| label | Label to show in diagnostic graph output. |
|
static |
Assigns an optional human-readable label to a coroutine task.
| h | Coroutine handle to label. |
| label | Label to show in diagnostic graph output. |
|
static |
Records a buffer dependency discovered at a concrete co_await site.
| h | Coroutine handle that is awaiting the dependency. |
| node | Async value node being awaited. |
| role | Reader or writer role for the await dependency. |
|
static |
Records constructor-discovered coarse DAG dependencies for a coroutine.
| h | Coroutine handle whose promise collected the dependencies. |
| read_dependencies | Async value nodes read by the coroutine. |
| write_dependencies | Async value nodes written by the coroutine. |
|
static |
Records the call stack where a coroutine was submitted to a scheduler.
| h | Coroutine handle being scheduled. |
|
staticnoexcept |
Records an exception escaping a coroutine and optionally captures its live DAG.
| h | Failing coroutine handle. |
| exception | Exception escaping the coroutine body. |
| originating_failure | Whether this coroutine originated rather than propagated the exception. |
|
static |
Registers an epoch context for debug tracking.
| epoch_context | Epoch context pointer to register. |
|
static |
Registers a newly-created coroutine handle.
| h | Coroutine handle to register. |
|
staticnoexcept |
Queues one Graphviz dump request for scheduler or service processing.
|
static |
Resets the automatic coroutine-exception diagnostics policy from the environment.
|
static |
Resets active stacktrace formatting options from environment defaults.
|
static |
Processes pending dump requests on the calling thread.
|
static |
Processes pending dump requests on the calling thread.
| options | File-output options for generated DOT files. |
|
static |
Replaces the process-wide automatic coroutine-exception diagnostics policy.
| options | New runtime policy. |
|
static |
Replaces active stacktrace formatting options.
| options | New stacktrace formatting options. |
|
static |
Captures the current task/epoch/value DAG as structured data.
|
static |
Captures a best-effort task/epoch/value DAG snapshot without indefinite lock waits.
|
static |
Returns active stacktrace formatting options.
|
static |
Starts the optional background DAG diagnostics service.
|
static |
Starts the optional background DAG diagnostics service.
| options | Signal/control-file and output configuration. |
|
staticnoexcept |
Stops the background DAG diagnostics service if it is running.
|
static |
Removes a coroutine-role binding from an epoch context.
| epoch_context | Epoch context that owns the binding. |
| h | Coroutine handle to unbind. |
| role | Reader or writer role being removed. |