event_trigger_count(9)
π event_trigger_count(9) β from the Kernel API Manual, bestie π
okay so picture this: you're deep in the kernel API manual (yes, that manual, the one from the 9 section, iykyk) and you land on event_trigger_count. It's the optional count function for event triggers, and honestly? It's giving "small but mighty." Let's get into it. β¨
πΈ NAME πΈ
event_trigger_count β the optional count function for event triggers π«Ά
β¨ SYNOPSIS β¨
bool event_trigger_count (struct event_trigger_data *data , struct
trace_buffer *buffer , void *rec , struct ring_buffer_event *event );
yeah that's the whole signature, no cap. four params, one bool coming back at you π
π¦ ARGUMENTS π¦
okay bestie, here's who's who in this function call:
dataβ the trigger-specific data. it's your data, the trigger's own little bag of stuff πbufferβ the ring buffer that the event is being written to. that's where the action's happening β¨recβ the trace entry for the event. heads up: it'sNULLfor unconditional invocation π (yes, literallyNULL, not a vibe, an actual null)eventβ the event meta data in the ring buffer. the meta of it all π
π DESCRIPTION π
so here's the tea β β if you've got a trigger that can take a count parameter and that count doesn't do anything special, you can just point its .count_func field at this function and call it a day. it's the "default outfit" of count functions, fr fr π
what does it actually do? it simply does a count down of the data->count field. that's it. that's the whole job. iconic, lowkey π§
and the logic is chef's kiss simple:
- if
data->countis greater than zero, it decrements it β - it returns
falseifdata->countis zero - otherwise it returns
trueβ
so basically: zero means "nope, false," anything above zero gets ticked down one and you get a true back. that's the whole personality π
π SEE ALSO π
the kernel file lives at ./kernel/trace/trace_events_trigger.c β go say hi π«Ά
and here's the whole friend group, all the sibling functions, not one of them skipped, periodt:
event_triggers_call(9)event_triggers_post_call(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)set_trigger_filter(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)
ngl bestie, if you remember nothing else: count goes down, zero returnsfalse, everything else returnstrue. that's the vibe check and it passed π―
mwah π this lil page came from ./kernel/trace and it's dated October 2026 β that's the source and the date, folded in all cute at the end like a signature on a note. go read some more kernel API pages, you're doing 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