IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

tracing

Provides tracing utilities.

comptime values

log

comptime log = Logger(stderr, prefix=String("[OP] "), source_location=False)

Logger instance for operation tracing with INFO level and [OP] prefix.

Structs

  • Trace: An object representing a specific trace.
  • TraceCategory: An enum-like struct specifying the type of tracing to perform.
  • TraceLevel: An enum-like struct specifying the level of tracing to perform.

Functions

  • get_current_trace_id: Returns the id of last created trace entry on the current thread.
  • get_safe_task_id: Safely extract task_id from DeviceContextPtr, returning None if null/invalid.
  • is_profiling_disabled: Returns False if the profiling is enabled for that specific type and level and True otherwise.
  • is_profiling_enabled: Returns True if the profiling is enabled for that specific type and level and False otherwise.
  • trace_arg: Helper to stringify the type and shape of a kernel argument for tracing.