synth_event..._array_start(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ 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 the dynevent_cmd struct 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's NULL if 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 the fields array. 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:


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