die_find_child(9)
π die_find_child(9) β the kernel API manual, but make it make sense
okay bestie, welcome to the die_find_child(9) page, straight out of the Kernel API Manual. this one is literally the generic DIE search function in a DIE tree π¦ and it's way less scary than it sounds, i promise. come walk the tree with me β¨
πΈ NAME πΈ
die_find_child β the generic DIE search function in the DIE tree. that's it, that's the whole vibe check π
β¨ SYNOPSIS β¨
Dwarf_Die * die_find_child (Dwarf_Die *rt_die , int
(*callback)(Dwarf_Die *, void *) , void *data , Dwarf_Die *die_mem );
like, four things go in, and a Dwarf_Die * comes out. slay π
π«Ά ARGUMENTS π«Ά
rt_dieβ a root DIE. this is where the whole thing starts, your main character DIE πcallbackβ a callback function. yes, a function pointer, and yes, you have to bring your owndataβ a user data passed to the callback function. your little care package to the callback πdie_memβ a buffer for result DIE. where the winner gets stored π
π₯ DESCRIPTION π₯
so here's what happens. it traces the DIE tree from rt_die and calls callback for each child DIE. no cap, every single child π§
now, the callback gets to make choices, and its return value is basically the plot twist:
- if
callbackreturnsDIE_FIND_CB_END, this stores the DIE intodie_memand returns it. found it, we're done, iconic β - if
callbackreturnsDIE_FIND_CB_CONTINUE, this continues to trace the tree. keep going bestie π - optionally,
callbackcan returnDIE_FIND_CB_CHILDandDIE_FIND_CB_SIBLINGβ those mean trace only the children and trace only the siblings respectively. okay that's lowkey specific but the manual says it so i'm saying it π«‘
and if callback can't find any appropriate DIE, it returns NULL. sad girl hours π
ngl,DIE_FIND_CB_CHILDandDIE_FIND_CB_SIBLINGare tagged as optional behaviour in the source text, so don't go assuming your callback can always get away with them π
π SEE ALSO π
bestie the friend group is huge, buckle up. all of these live in the kernel file ./tools/perf/util/dwarf-aux.c:
cu_find_realpath(9), cu_get_comp_dir(9), cu_find_lineinfo(9), cu_walk_functions_at(9), die_get_linkage_name(9), die_compare_name(9), die_match_name(9), die_get_call_lineno(9), die_get_type(9), die_get_real_type(9), die_get_pointer_type(9), die_is_signed_type(9), die_is_func_def(9), die_entrypc(9), die_is_func_instance(9), die_get_data_member_location(9), die_get_call_file(9), die_get_decl_file(9), die_find_tailfunc(9), die_find_realfunc(9), die_find_top_inlinefunc(9), die_find_inlinefunc(9), die_find_func_rettype(9), die_walk_instances(9), die_walk_lines(9), die_find_variable_at(9), die_find_member(9), die_get_typename_from_type(9), die_get_typename(9), die_get_varname(9), die_get_var_innermost_scope(9), die_get_var_range(9), is_breg_access_indirect(9), die_find_variable_by_reg(9), die_find_variable_by_addr(9), die_collect_vars(9), die_collect_global_vars(9), die_get_cfa(9), die_get_scopes(9), die_get_member_type(9), die_deref_ptr_type(9) π
like. that's the whole group chat. go say hi π
and that's the page, babes π¦ this little number came from ./tools/perf/util and it's dated October 2026 β so yeah, it's giving future-fresh. go trace that tree, you absolute icon π
β¨
π¦ 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