synth_event..._array_start(9)
π¦ synth_event..._array_start(9) β the Kernel API Manual, bestie edition π¦
okay so picture this: you're in the Kernel API Manual, page synth_event..._array_start(9), and you need to start a synthetic event command... from an array. iconic behavior honestly. let's get into it π
β¨ NAME β¨
synth_event_gen_cmd_array_start β start a synthetic event command from an array π
Like, the whole vibe of this function is "begin the synthetic event command, but the fields come pre-packaged in an array." slay.
πΈ SYNOPSIS πΈ
int synth_event_gen_cmd_array_start (struct dynevent_cmd *cmd , const
char *name , struct module *mod , struct synth_field_desc *fields ,
unsigned int n_fields );
π ARGUMENTS π
cmdβ a pointer to thedynevent_cmdstruct that represents the new event. it's giving "this is the thing we're building."nameβ the name of the synthetic event. name her, periodt.modβ the module creating the event. it'sNULLif it's not created from a module, iykyk.fieldsβ an array of type/name field descriptions.n_fieldsβ the number of field descriptions contained in thefieldsarray. literally just the count, bestie. keep it accurate or it's gonna be a mess π
π§ DESCRIPTION π§
so what does this actually do? it generates a synthetic event command that's meant to be executed by synth_event_gen_cmd_end. π«Ά
and here's the cute part β this function is flexible. you can use it to generate the complete command, OR you can use it for only the first part of it. and in that latter case? synth_event_add_field, synth_event_add_field_str, or synth_event_add_fields can be used to add more fields following this. so you start here, then you keep adding. build-a-bear energy, honestly. π§Έ
the event fields that will be defined for the event should be passed in as an array of struct synth_field_desc, and the number of elements in that array gets passed in as n_fields. π₯
and bestie, listen β field ordering will retain the ordering given in the fields array. no re-sorting, no surprises, the order you gave is the order you get. π―
see synth_field_size for the available types. and one more little detail: if field_name contains [n], the field is considered to be an array. π
β RETURN β
0 if successful, error otherwise. that's it, that's the whole story. π
π SEE ALSO π
kernel file ./kernel/trace/trace_events_synth.c (the source, the mothership π)
and the whole friend group:
synth_event_add_field(9)synth_event_add_field_str(9)synth_event_add_fields(9)__synth_event_gen_cmd_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_next_val(9)synth_event_add_val(9)synth_event_trace_end(9)
okay that's the whole page, no cap π this came out of ./kernel/trace in October 2026, and the header/footer said synth_event..._array_start(9) on repeat like a little hype chant. go forth and build your synthetic events, bestie β you're gonna eat πβ¨
π¦ 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