synth_event_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the fields array. count 'em, don't guess πŸ™ˆ
  • mod β€” the module creating the event, or NULL if 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 🌸


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