set_trigger_filter(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… set_trigger_filter(9) β€” a Kernel API Manual moment ✨

okay so real talk, this is a page from the Kernel API Manual and it's genuinely such a helpful little function. welcome bestie, let's get into it 🫢


✨ NAME ✨

set_trigger_filter β€” the Generic event_command @set_filter implementation πŸ‘‘


🌸 SYNOPSIS 🌸

int set_trigger_filter (char *filter_str , struct event_trigger_data
*trigger_data , struct trace_event_file *file );

like, that's the whole signature, no notes πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • filter_str β€” the filter string for the trigger, and honestly if you pass NULL it just nukes the filter, bye πŸ‘‹
  • trigger_data β€” trigger-specific data, iykyk, it's the trigger's own little bag of stuff πŸ“
  • file β€” the trace_event_file that's associated with the event, it's giving "which event are we even talking about" energy πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

So this is the common implementation for event command filter parsing and filter instantiation β€” lowkey the whole filter pipeline lives here ✨

Most of the time it's used directly as the set_filter method in event command implementations, like that's just its job and it ate πŸ’…

It's also the one you call to remove a filter, and the way you do that is if filter_str = NULL β€” periodt, that's the whole removal mechanism πŸŽ€


πŸ”₯ RETURN πŸ”₯

0 on success, errno otherwise 😭 (so like, check your return value bestie, fr fr)


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./kernel/trace/trace_events_trigger.c β€” the source, go read it, it's iconic πŸ“–

And the whole squad, no cap:

like okay go off, trigger function family reunion 🌈


this slice of kernel lore comes to you from ./kernel/trace and it's dated October 2026 β€” catch you in the next one, mwah πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from