RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Debug DrawingGPU Mesh StructsImGui FFIMath Structs (FFI)FFI C DefinitionsPID ControllersCSV LibraryDelay LineDequeDevelopment UtilitiesEvent ReferenceExtension SystemSignal FiltersGraph PathfindingUI BridgeInput Filter Constants2D Bilinear InterpolationIntrospectionJBeam Pretty PrinterJSON AST ParserSJSON ParserJSON Debug ParserJSON Pretty PrinterK-D Tree (2D Boxes)K-D Tree (3D)K-D Tree (3D)Lua SerializerC++/Lua BindingLua CoreLua ProfilerMath LibraryParticlesQuadtreeSettingsTCP ServerTimer SchedulerUtility Library
jit/ - LuaJIT Compiler & Profiler ModulesLuaJIT ProfilerVerbose JIT CompilerLuaJIT VM DefinitionsProfiler Zones

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API Referencecommonjit

LuaJIT Profiler

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 module
  • l - Stack dump: module
  • <number> - Stack dump depth (callee < caller)
  • s - Split stack after first level (implies depth >= 2)
  • p - Show full path for module names
  • v - Show VM states
  • z - Show zones
  • r - Show raw sample counts (default: percentages)
  • a / A - Annotate excerpts/complete source files
  • G - 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.profile low-level API for sampling
  • Callbacks accumulate samples in a counting table
  • prof_top sorts and displays top-N callers
  • prof_annotate overlays sample counts on source lines
  • prof_finish stops profiling and dumps results
  • Requires jit.vmdef for VM state names

See Also

  • jit/ - LuaJIT Compiler & Profiler Modules - Directory overview
  • jit.v (Verbose JIT Compiler Output) Reference - Related reference
  • jit.vmdef (VM Definitions) Reference - Related reference
  • jit.zone (Profiler Zones) Reference - Related reference
  • Common Libraries Overview - Guide

jit/ - LuaJIT Compiler & Profiler Modules

Standard LuaJIT modules for JIT compiler introspection and profiling.

Verbose JIT Compiler

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.

On this page

ExportsEntry Pointsstart(mode, outfile)Mode FlagsInternal NotesSee Also