synth_event_add_next_val(9)
β¨ 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 thatsynth_event_add_next_valandsynth_event_add_valcan'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 π
synth_event_add_field(9)synth_event_add_field_str(9)synth_event_add_fields(9)__synth_event_gen_cmd_start(9)synth_event_gen_cmd_array_start(9)synth_event_create(9)synth_event_delete(9)synth_event_cmd_init(9)synth_event_trace(9)synth_event_trace_array(9)synth_event_trace_start(9)synth_event_add_val(9)synth_event_trace_end(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms