std.profile

Standard-library module std.profile.

Importuse std.profile

Types

struct SymbolSpan#

Byte range attached to one emitted moon function in a .moonsyms map.

start: int
end: int
struct Symbol#

One native symbol emitted for a moon bytecode prototype.

symbol: string
module: string
name: string
span: SymbolSpan
kind: string
struct SymbolMap#

Versioned contents of an executable's .moonsyms sidecar.

version: int
symbols: [Symbol]
struct ProfileRow#

One self-sample row in a machine-readable profile report.

frame: string
samples: int
struct ProfileReport#

Machine-readable sampling summary.

samples: int
frames: [ProfileRow]

Functions

fn aggregate_folded(text: string) -> {string: int}#

Aggregate flamegraph folded-stack text into stack occurrence counts.

fn folded(perf_script: string, symbol_map_json: string) -> string#

Render perf script samples as flamegraph-ready folded stacks.

fn report(perf_script: string, symbol_map_json: string, format: string) -> string#

Render folded, top, or json output for a perf transcript.

fn report_json(perf_script: string, symbol_map_json: string) -> string#

Render a machine-readable self-sample report.

fn top(perf_script: string, symbol_map_json: string) -> string#

Render a self-sample table. The samples column sums to the sample count.