create_target_field_var(9)
π create_target_field_var(9) β Kernel API Manual β¨
okay so bestie, welcome to the create_target_field_var page β this is one of those little kernel helper functions that does a lot of quiet emotional labor so you don't have to. It's living in the Kernel API Manual and honestly? underrated. π
πΈ NAME πΈ
create_target_field_var β Automatically create a variable for a field. no cap, that's literally the whole job description π
π¦ SYNOPSIS π¦
struct field_var * create_target_field_var (struct hist_trigger_data
*target_hist_data , char *subsys_name , char *event_name , char
*var_name );
β¨ ARGUMENTS β¨
target_hist_dataβ The target hist trigger. this is the main character of the whole function, everything's happening on its turf πsubsys_nameβ Optional subsystem name. optional bestie, it can absolutely be a no-show πevent_nameβ Optional event name. also optional, also fine if it ghosts π«Άvar_nameβ The name of the field (and the resulting variable). two for the price of one, we love efficiency π
π§ DESCRIPTION π§
so here's the lore: hist trigger actions fetch data from variables, not directly from events. like, that's the rule. they don't do the direct-event thing. π
BUT β and this is the iconic part β for convenience, users are allowed to directly specify an event field in an action, and it will be automatically converted into a variable on their behalf. the kernel just does it for you. main character energy fr fr π₯
This function creates a field variable with the name var_name on the hist trigger currently being defined on the target event. and if subsys_name and event_name are specified? then this function simply verifies that they do in fact match the target event subsystem and event name. that's it. vibe check passed or not, no extra drama π
β RETURN β
The variable created for the field. that's your gift, bestie π
π SEE ALSO π
- Kernel file
./kernel/trace/trace_events_hist.c check_field_for_var_ref(9),find_var_ref(9),find_any_var_ref(9),check_var_refs(9),create_var_ref(9),create_field_var_hist(9)β the whole friend group, go read the rest of them iykyk π¦
and that's the page!! π this lil icon came straight out of ./kernel/trace, dated October 2026, and it's create_target_field_var(9) slandering nobody and serving facts. periodt. πβ¨
π¦ 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