synth_event_add_fields(9)
β¨ synth_event_add_fields(9) β¨
okay so bestie, we're in the Kernel API Manual today and this page is literally all about synth_event_add_fields β the glow-up move where you add a whole set of fields to a synthetic event cmd in one go instead of one at a time. iconique behavior, honestly π«Ά
πΈ NAME πΈ
synth_event_add_fields β add multiple fields to a synthetic event cmd β¨ (yes, multiple, we love an efficient queen π
)
π¦ SYNOPSIS π¦
int synth_event_add_fields (struct dynevent_cmd *cmd , struct
synth_field_desc *fields , unsigned int n_fields );
π ARGUMENTS π
cmdβ a pointer to thedynevent_cmdstruct that's representing your brand-new event. main character struct energy πfieldsβ an array of type/name field descriptions. it's giving "here's the whole squad" π§n_fieldsβ the number of field descriptions chillin' in thefieldsarray. count 'em, bestie π’
π DESCRIPTION π
So what this does: it adds a new set of fields to a synthetic event cmd object. lowkey the whole point. π
The event fields that will be defined for your 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. no cap, that's the whole vibe.
Field ordering will retain the ordering given in the fields array. so like, the order you give it is the order you get. respect the queue, periodt π
Also: go check out synth_field_size for the available types β that's where the type lore lives π. And if field_name contains [n], the field is considered to be an array. noted. β
π₯ RETURN π₯
0 if successful, error otherwise. that's it, that's the returns section fr fr π
π SEE ALSO π
Kernel file ./kernel/trace/trace_events_synth.c β the sacred text π
Then all these besties:
synth_event_add_field(9)synth_event_add_field_str(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_next_val(9)synth_event_add_val(9)synth_event_trace_end(9)
ngl the whole family is here, it's a whole reunion π
okay that's the page!! it lives under ./kernel/trace π and it's dated October 2026 β so go forth and add those fields, bestie, you're gonna slay πβ¨
π¦ 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