profile

package
v0.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package profile turns what a vm.Profiler collected into reports (TODO.md Q78): a text report of the functions and lines that took the time, for kukel profile and the Go API.

Index

Constants

View Source
const (
	MaxFunctions = 40
	MaxLines     = 20
)

MaxFunctions and MaxLines bound the rows of the report's tables.

Variables

This section is empty.

Functions

func Pprof

func Pprof(w io.Writer, p *vm.Profiler) error

Pprof writes what p collected in Go's pprof format (gzipped protocol buffers), for go tool pprof: a function per Kukel function (with its file and first line, so that pprof can show the source), a location per line of it, and per sample the number of samples and the time (wall or cpu, in nanoseconds). Each sample has the label "interpreter" ("main", "worker 1: f"); with workers, each stack starts with a frame named after its interpreter, so that a flame graph shows them apart.

func Report

func Report(w io.Writer, p *vm.Profiler, src debugger.Sources) error

Report writes the text report of what p collected: the functions by their own time (and their total time, with the functions they call, and their calls), the slowest lines with their source, and the calls of built-ins and Go functions. src has the source lines of the program (files not in it are read; nil: all are read).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL