RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

cdefDebugDraw ReferencecdefGpuMesh ReferencecdefImgui ReferencecdefMath Referencecdefs ReferencecontrolSystems Referencecsvlib ReferencedelayLine Referencedequeue ReferencedevUtils ReferenceEvent Referenceextensions Referencefilters Referencegraphpath Referenceguihooks ReferenceinputFilters ReferenceinterpolatedMap Referenceintrospection ReferencejbeamWriter Referencejson-ast Referencejson ReferencejsonDebug ReferencejsonPrettyEncoderCustom Referencekdtreebox2d Referencekdtreebox3d Referencekdtreepoint3d Referencelpack ReferenceluaBinding ReferenceluaCore ReferenceluaProfiler Referencemathlib Referenceparticles Referencequadtree Referencesettings ReferencetcpServer ReferencetimeEvents Referenceutils Reference
jit/ - LuaJIT Compiler & Profiler Modulesjit.p (LuaJIT Profiler) Referencejit.v (Verbose JIT Compiler Output) Referencejit.vmdef (VM Definitions) Referencejit.zone (Profiler Zones) Reference

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

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 module
  • l - 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 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

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.

On this page

ExportsEntry Pointsstart(mode, outfile)Mode FlagsInternal Notes