synth_event_create(9)
π synth_event_create β like, the Kernel API Manual, but make it cute β¨
okay so bestie, you know how the kernel has a whole manual and some of those pages are lowkey a snooze? not this one. this is synth_event_create(9) from the Kernel API Manual, and it's literally the glow-up moment for synthetic events. no cap, we're gonna make a brand new event and it's gonna be iconic. π¦
β¨ NAME β¨
synth_event_create β create a new synthetic event. that's it. that's the whole vibe. π
πΈ SYNOPSIS πΈ
int synth_event_create (const char *name , struct synth_field_desc
*fields , unsigned int n_fields , struct module *mod );
π ARGUMENTS π
nameβ the name of the new synthetic event. choose wisely bestie, this is her whole identity πfieldsβ an array of type/name field descriptions. like, the blueprint of what she's made of β¨n_fieldsβ the number of field descriptions contained in thefieldsarray. count 'em, don't guess πmodβ the module creating the event, orNULLif it's not being created from a module π«Ά
π DESCRIPTION π
so here's the tea. you're creating a brand new synthetic event with the given name, and she lives under the trace/events/synthetic/ directory. main character address, 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 elements in the array passed in as n_fields. and the ordering? field ordering will retain the ordering given in the fields array β so whatever order you hand them over in is the order they stay in. she does not rearrange. periodt. β
okay important bit, no skipping: if the new synthetic event is being created from a module, the mod param must be non-NULL. this will ensure that the trace buffer won't contain unreadable events. so like, don't leave it NULL and then act surprised, bestie π
the new synth event should be deleted using synth_event_delete function. yes, she needs a proper goodbye too β clean up after yourself, it's giving responsible. and the new synthetic event can be generated from modules or other kernel code using trace_synth_event and related functions. slay, she's reusable. π₯
π RETURN π
0 if successful, error otherwise. that's the whole thing ngl β zero means we ate, anything else means go read the error. π
π§ SEE ALSO π§
kernel file ./kernel/trace/trace_events_synth.c β like, the source, the origin story, iykyk πΈ
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_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)
and that's the page! π this whole thing came to you from the ./kernel/trace corner of the world, dated October 2026 β so yeah, future vibes only. go forth and create synthetic events, bestie, you're gonna do amazing π«Άπ
π¦ 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