event_triggers_call(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… event_triggers_call πŸ’…

ok so real talk, this one is a Kernel API Manual page, bestie β€” we're in the deep kernel lore today. it lives in event_triggers_call(9), and it's all about firing off the trigger functions that are chillin' next to a trace event. let's get into it 🫢


✨ NAME ✨

event_triggers_call β€” the one that calls the triggers associated with a trace event. literally its whole job. slay πŸ’…


🌸 SYNOPSIS 🌸

enum event_trigger_type event_triggers_call (struct trace_event_file
*file , struct trace_buffer *buffer , void *rec , struct
ring_buffer_event *event );

πŸŽ€ ARGUMENTS πŸŽ€

  • file β€” the trace_event_file that's tied to the event. this is the bestie that knows which event we're talking about πŸ’–
  • buffer β€” the ring buffer the event is being written to. that's where the magic lands ✨
  • rec β€” the trace entry for the event, and it's NULL for an unconditional invocation. so, NULL = "just do it, no questions" πŸ¦‹
  • event β€” the event meta data sitting inside the ring buffer. the receipts, basically πŸ‘‘

🌈 DESCRIPTION 🌈

okay so here's the vibe. for each trigger that's associated with an event, we invoke the trigger function that got registered with the associated trigger command. that's the whole loop. no cap πŸ’…

now, if rec is non-NULL, that's a whole signal: it means the trigger needs further processing and shouldn't be unconditionally invoked. like, it's got ✨conditions✨. and if rec is non-NULL and the trigger has a filter associated with it, then rec gets checked against that filter β€” and if the record matches, the trigger gets invoked. main character energy only πŸŽ€

and if the trigger is a 'post_trigger' β€” meaning it shouldn't be invoked in any case until the current event is written β€” then the trigger function isn't invoked at all. instead, the bit associated with the deferred trigger gets set in the return value. so it's not a no, it's a "not yet, babe" ⭐

it returns an enum event_trigger_type value containing a set bit for any trigger that should be deferred, or ETT_NONE if there's nothing to defer. πŸ¦‹

also important: this gets called from tracepoint handlers, with rcu_read_lock_sched held. so keep that in mind, iykyk πŸ™ˆ

πŸ”₯ RETURN πŸ”₯

an enum event_trigger_type value containing a set bit for any trigger that should be deferred, and ETT_NONE if nothing to defer. periodt πŸ’€βœ¨


πŸ‘‘ SEE ALSO πŸ‘‘

the kernel file it lives in, for the curious besties:

  • ./kernel/trace/trace_events_trigger.c

and the whole friend group 🫢:


πŸ’œ aww that's the whole page!! this one came from the ./kernel/trace source, version vibes dated October 2026, all dressed up in the Kernel API Manual. go read a trace event for me, bestie πŸŒΈπŸ§šπŸ’–
πŸ“¦ where this page comes from