ftrace_bug(9)
π ftrace_bug β a Kernel API Manual moment (section 9, bestie)
okay so this is ftrace_bug(9) from the Kernel API Manual, and it's literally the function that catches the function tracer mid-crisis and shuts the whole thing down. it's giving "we need to talk" energy π«Ά
β¨ NAME β¨
ftrace_bug β report and shutdown function tracer. yes bestie, both: it snitches AND it pulls the plug π
πΈ SYNOPSIS πΈ
void ftrace_bug (int failed , struct dyn_ftrace *rec );
π ARGUMENTS π
failedβ the failed type, and it's gotta be one ofEFAULT,EINVAL,EPERM. no vibes-based error codes allowed πrecβ the record that failed. the actualstruct dyn_ftracethat did the mess π
π¦ DESCRIPTION π¦
so the arch code β the one that enables or disables the function tracing β can call ftrace_bug when it has detected a problem in modifying the code. that's the whole point of it, it's the "hey something went sideways while we were poking at instructions" hotline π₯
and failed should be one of either:
EFAULTβ if the problem happens on reading the ip address πEINVALβ if what is read at ip is not what was expected π¬EPERMβ if the problem happens on writing to the ip address π«
like, each code tells you where in the read/write dance things went wrong, iykyk. use the right one, don't just pick your fave π
β SEE ALSO β
Kernel file ./kernel/trace/ftrace.c
ftrace_lookup_ip(9)ftrace_free_filter(9)ftrace_hash_move(9)ftrace_location_range(9)ftrace_location(9)ftrace_text_reserved(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_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)
like, that's the whole ftrace friend group right there, go say hi π
ngl this whole page lives in ./kernel/trace and it's dated October 2026 β so yeah, this manual page is from the future and it's still out here documenting a bug reporter. main character energy fr fr πβ¨π
π¦ 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