benchmark_tracedata(3)
π benchmark_tracedata(3) β Arcan Lua API
okay so bestie, this one lives in the Arcan Lua API section of your manuals (benchmark_tracedata(3) to its friends) and it's literally the "drop a lil datapoint in the tracebuffer" girlie. let's get into it π
β¨ NAME β¨
benchmark_tracedata β add a datapoint to the ongoing tracebuffer π«Ά
πΈ SYNOPSIS πΈ
nil
benchmark_tracedata( string:subsystem, string:message )
benchmark_tracedata( string:subsystem, string:message, int:identifier=0,
int:quantity=1 )
benchmark_tracedata( string:subsystem, string:message, int:identifier=0,
int:quantity=1, int:trigger=TRACE_TRIGGER_ONESHOT )
benchmark_tracedata( string:subsystem, string:message, int:identifier=0,
int:quantity=1, int:trigger=TRACE_TRIGGER_ONESHOT,
int:level=TRACE_PATH_DEFAULT )
benchmark_tracedata( string:subsystem, string:message, int:identifier=0,
int:quantity=1, int:trigger=TRACE_TRIGGER_ONESHOT,
int:level=TRACE_PATH_DEFAULT )
no cap, she returns nil β this is a side-effects-only icon, she adds the datapoint and dips π¨ and yes the last two signatures are identical, that's just how the page is, we don't ask questions bestie ππ
π DESCRIPTION π
so what she does is: this function adds a datapoint to the ongoing tracebuffer. that's the whole vibe. β¨
for how the buffer and its reporting function get used and configured, go look at benchmark_enable β that's the main character of this story, this is her supporting role. π
the possible arguments are:
'subsystem'β caller defined πΈ'message'β caller defined (yes you get to name your own message, slay) π- object identifier β caller defined π¦
- quantity indicator β also a thing you pass in π
- trigger β picked from the set of
TRACE_TRIGGER_ONESHOT,TRACE_TRIGGER_ENTER,TRACE_TRIGGER_EXITπ₯ - performance path β one of
TRACE_PATH_DEFAULT,TRACE_PATH_SLOW,TRACE_PATH_WARNING,TRACE_PATH_ERROR,TRACE_PATH_FASTπ
and the defaults, since we're being specific: int:identifier=0, int:quantity=1, int:trigger=TRACE_TRIGGER_ONESHOT, int:level=TRACE_PATH_DEFAULT. periodt. don't come for me, that's literally what the page says π
π§ EXAMPLE π§
okay this is the fun part, look at her go:
function benchmark_tracedata0()
benchmark_enable(1,
function(res)
for k,v in ipairs(res[1]) do
print(k, v);
end
end)
benchmark_tracedata("test", "hi", 10, TRACE_TRIGGER_ONESHOT, TRACE_PATH_DEFAULT)
end
so you benchmark_enable with a reporting function that loops over res[1] with ipairs and prints k, v, then you fire off one benchmark_tracedata("test", "hi", 10, TRACE_TRIGGER_ONESHOT, TRACE_PATH_DEFAULT). iconic behaviour honestly π
π¦ SEE ALSO π¦
benchmark_enable(3)β go read her, she's the one who actually configures all this π«Ά
lowkey reminder bestie: every value up there is exact β theTRACE_TRIGGER_*set, theTRACE_PATH_*set, and those defaults. copy-paste them, don't freestyle them π
β that's the whole page! brought to you by the system manual, October 2026 release, benchmark_tracedata(3) β mwah, go trace some data, you got this πβ¨πΈ
π¦ where this page comes from
- nixos 26.05: arcan 0.7.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms