set_trigger_filter(9)
π 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 passNULLit just nukes the filter, bye πtrigger_dataβ trigger-specific data, iykyk, it's the trigger's own little bag of stuff πfileβ thetrace_event_filethat'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:
event_triggers_call(9)event_triggers_post_call(9)event_trigger_count(9)event_trigger_print(9)event_trigger_init(9)event_trigger_free(9)clear_event_triggers(9)update_cond_flag(9)register_trigger(9)unregister_trigger(9)event_trigger_check_remove(9)event_trigger_empty_param(9)event_trigger_separate_filter(9)trigger_data_alloc(9)event_trigger_parse_num(9)event_trigger_set_filter(9)event_trigger_reset_filter(9)event_trigger_register(9)event_trigger_unregister(9)event_trigger_parse(9)find_named_trigger(9)is_named_trigger(9)save_named_trigger(9)del_named_trigger(9)pause_named_trigger(9)unpause_named_trigger(9)set_named_trigger_data(9)
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
- 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