synth_event_add_next_val(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ synth_event_add_next_val(9) ✨

okay so bestie, this one lives in the Kernel API Manual and it's literally the glow-up your synthetic trace events have been waiting for πŸ¦‹


πŸŽ€ NAME πŸŽ€

synth_event_add_next_val β€” add the next field's value to an open synth trace πŸ’…


🌸 SYNOPSIS 🌸

int synth_event_add_next_val (u64 val , struct synth_event_trace_state *trace_state );

✨ ARGUMENTS ✨

  • val β€” the value you're setting the next field to 🫢
  • trace_state β€” a pointer to the object that's tracking your piecewise trace state, iykyk

πŸ’– DESCRIPTION πŸ’–

So what this does is set the value of the next field in an event that's already been opened up by synth_event_trace_start. That's the whole vibe πŸ’«

The val param should be the value cast to u64. And if the value is actually pointing at a string? Then val should be a char * cast to u64. No cap, that's just how it goes.

This function assumes all the fields in an event are getting set one after another β€” like, you make successive calls to this function, one for each field, in the order of the fields in the event, until every single field has been set. Main character energy: strict order, no skipping 🎯

But if you'd rather set each field individually without caring about ordering at all? Then synth_event_add_val can be used instead. Pick your fighter πŸ’…

⚠️ Note however that synth_event_add_next_val and synth_event_add_val can't be intermixed for a given event trace β€” it's one or the other, but not both at the same time. fr fr, don't try it.
🚨 Note also that synth_event_trace_end must be called after all values have been added for each event trace β€” regardless of whether adding all the field values succeeded or not. Like, even if it flopped, you still call it. periodt.

πŸ”₯ RETURN πŸ”₯

0 on success, err otherwise. slay πŸŽ€


🌈 SEE ALSO 🌈

Kernel file ./kernel/trace/trace_events_synth.c πŸ‘‘


okay that's the whole page, bestie πŸ’œ this one's from the ./kernel/trace corner of the world, dated October 2026, and it's literally synth_event_add_next_val(9) β€” go forth and add those values in order, you icon πŸ‘‘πŸŒΈ

πŸ“¦ where this page comes from