topa_alloc(9)
π topa_alloc β Kernel API Manual, section 9 π
okay so bestie, we are deep in the kernel today and this one is a <pink>9</pink>-section page, meaning it's a kernel-internal function, not something you type in your shell. no --help here, she's for the C girlies. let's get into it β¨
πΈ NAME πΈ
topa_alloc β literally just: allocate a page-sized ToPA table. that's the whole gig. iconic and focused π
π¦ SYNOPSIS π¦
struct topa * topa_alloc (int cpu , gfp_t gfp );
yes the spacing is funky, that's just how the manpage generator types it, leave her alone π
π ARGUMENTS π
cpuβ the CPU you want to allocate on. like, which CPU. pick one π«Άgfpβ the allocation flags. yep, thegfp_tkind. the whole vibe of the allocation lives in here.
β RETURN β
on success, you get back a pointer to the ToPA table page. that's the prize β¨ no cap, that's the only return behaviour listed here, so don't come at me asking about failure paths, this page simply does not say π
π SEE ALSO π
bestie this list is long, she has a lot of friends. the kernel file ./arch/x86/events/intel/pt.c is where this all lives, and then we got:
struct topa(9)struct topa_page(9)topa_free(9)topa_insert_table(9)topa_table_full(9)topa_insert_pages(9)pt_topa_dump(9)pt_buffer_advance(9)pt_update_head(9)pt_buffer_region(9)pt_buffer_region_size(9)pt_handle_status(9)pt_read_offset(9)pt_buffer_reset_markers(9)pt_buffer_reset_offsets(9)pt_buffer_fini_topa(9)pt_buffer_init_topa(9)pt_buffer_setup_aux(9)pt_buffer_free_aux(9)intel_pt_interrupt(9)
that's the whole squad, go read them too, iykyk ππ₯
π§ quick vibe check bestie: everything above is real, and if you need to know more, the Intel PT corner of arch/x86/events is where you go. no invented behaviour, we stay honest on this blog π
and that's the page! brought to you by the source path ./arch/x86/events/intel, dated October 2026, and yes, she's still signed topa_alloc(9) at the bottom because some things never change β¨π
π¦ 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