ftrace_set_filter(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ ftrace_set_filter(9) ✨

okay bestie, welcome to the ftrace_set_filter page πŸ’… this is straight out of the Kernel API Manual, and it's literally the glow-up you need to understand function filtering in ftrace. no cap.


🌸 NAME 🌸

ftrace_set_filter β€” set a function to filter on in ftrace πŸŽ€


✨ SYNOPSIS ✨

int ftrace_set_filter (struct ftrace_ops *ops , unsigned char *buf , int
len , int reset );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • ops β€” the ops you're setting the filter with, bestie. this is the main character here πŸ‘‘
  • buf β€” the string that holds the function filter text ✍️
  • len β€” the length of that string, fr fr
  • reset β€” non-zero to reset all the filters before applying this filter. like a full clear before the new aesthetic πŸ’€

πŸ’– DESCRIPTION πŸ’–

Filters denote which functions should be enabled when tracing is enabled. that's the whole vibe β€” they decide who gets to show up to the party πŸŽ‰

If buf is NULL and reset is set, all functions will be enabled for tracing. everyone's invited, no guest list, no drama 🫢

⚠️ okay important: this can allocate memory which must be freed before ops can be freed β€” either by removing each filtered addr or by using ftrace_free_filter(ops). don't leave that memory hanging, it's giving bad manners 😭

🌈 SEE ALSO 🌈

Kernel file ./kernel/trace/ftrace.c, plus the whole squad:

ftrace_lookup_ip(9), ftrace_free_filter(9), ftrace_hash_move(9), ftrace_location_range(9), ftrace_location(9), ftrace_text_reserved(9), ftrace_bug(9), ftrace_update_record(9), ftrace_test_record(9), ftrace_get_addr_new(9), ftrace_get_addr_curr(9), ftrace_rec_iter_start(9), ftrace_rec_iter_next(9), ftrace_rec_iter_record(9), ftrace_run_stop_machine(9), arch_ftrace_update_code(9), ftrace_startup_subops(9), ftrace_shutdown_subops(9), ftrace_regex_open(9), allocate_ftrace_func_mapper(9), ftrace_func_mapper_find_ip(9), ftrace_func_mapper_add_ip(9), ftrace_func_mapper_remove_ip(9), free_ftrace_func_mapper(9), register_ftrace_direct(9), unregister_ftrace_direct(9), modify_ftrace_direct_nolock(9), modify_ftrace_direct(9), hash_add(9), update_ftrace_direct_add(9), hash_sub(9), update_ftrace_direct_del(9), update_ftrace_direct_mod(9), ftrace_set_filter_ip(9), ftrace_set_filter_ips(9), ftrace_ops_set_global_filter(9), ftrace_set_notrace(9), ftrace_set_global_filter(9), ftrace_set_global_notrace(9), ftrace_ops_get_func(9), ftrace_kill(9), ftrace_is_dead(9), register_ftrace_function(9), unregister_ftrace_function(9), ftrace_lookup_symbols(9)


and that's the whole page, bestie πŸ§šπŸ’œ this one lives in ./kernel/trace and it's stamped October 2026 β€” go forth and filter your functions responsibly, ily, mwah πŸ“πŸ’…

πŸ“¦ where this page comes from