jit.p (LuaJIT Profiler) Reference
Module defined in `lua/common/jit/p.lua`. LuaJIT's built-in low-overhead profiler CLI interface. Collects stack samples and outputs top-N lists, annotated source, or raw data for flame graphs.
Module defined in lua/common/jit/p.lua. LuaJIT's built-in low-overhead profiler CLI interface. Collects stack samples and outputs top-N lists, annotated source, or raw data for flame graphs.
Exports
This module has no M table exports. It is used via luajit -jp or require("jit.p").start(mode, outfile).
Entry Points
start(mode, outfile)
Start the profiler with the given mode string and optional output file.
- Parameters:
mode- string - Profiler mode flags (see below)outfile- string|nil - Output file path (-for stdout, nil for stderr)
Mode Flags
f- Stack dump: function name (default)F- Stack dump: always prepend modulel- Stack dump: module:line<number>- Stack dump depth (callee < caller)s- Split stack after first level (implies depth >= 2)p- Show full path for module namesv- Show VM statesz- Show zonesr- Show raw sample counts (default: percentages)a/A- Annotate excerpts/complete source filesG- Raw output for graphical tools (flame graphs)m<number>- Minimum sample percentage (default: 3)i<number>- Sampling interval in ms (default: 10)
Internal Notes
- Uses
jit.profilelow-level API for sampling - Callbacks accumulate samples in a counting table
prof_topsorts and displays top-N callersprof_annotateoverlays sample counts on source linesprof_finishstops profiling and dumps results- Requires
jit.vmdeffor VM state names
jit/ - LuaJIT Compiler & Profiler Modules
Standard LuaJIT modules for JIT compiler introspection and profiling.
jit.v (Verbose JIT Compiler Output) Reference
Module defined in `lua/common/jit/v.lua`. Verbose mode for the LuaJIT compiler - prints one line per generated trace showing compilation progress, trace linking, and abort reasons.