benchmark_tracedata(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

πŸ’… 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 β€” the TRACE_TRIGGER_* set, the TRACE_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