cpu_aggr_map__new(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… cpu_aggr_map__new(9) โ€” like, the Kernel API Manual page you actually wanna read ๐ŸŽ€

okay so bestie, gather round, because this one is genuinely a little baddie. This is a page from the Kernel API Manual (yes, that's the manual name, we're being fancy today โœจ), and it's all about building one specific cute little struct. Let's get into it ๐Ÿฆ‹


๐ŸŒธ NAME ๐ŸŒธ

cpu_aggr_map__new โ€” makes you a cpu_aggr_map with an aggr_cpu_id for every single cpu in cpus. no cap, every one ๐Ÿ’–

the aggr_cpu_id gets created using 'get_id', and you can pass a data value to it if you want (or don't, live your truth). and then โ€” this is the iconic part โ€” the cpu_aggr_map comes out sorted, with duplicate values removed. like, it literally declutters itself. main character energy fr fr ๐Ÿ‘‘


โœจ SYNOPSIS โœจ

struct cpu_aggr_map * cpu_aggr_map__new (const struct perf_cpu_map *cpus
, aggr_cpu_id_get_t get_id , void *data , bool needs_sort );

that's the whole signature, copy it exactly, don't freestyle it ๐Ÿ™ˆ


๐Ÿซถ ARGUMENTS ๐Ÿซถ

so about the argumentsโ€ฆ the original page is a little shy here. every single one of them is marked -- undescribed --, and ngl i'm not gonna sit here and invent lore for you. that's not the vibe. facts only, periodt ๐Ÿ’…

  • cpus โ€” -- undescribed --
  • get_id โ€” -- undescribed --
  • data โ€” -- undescribed --
  • needs_sort โ€” -- undescribed --
lowkey tragic that the docs ghosted us on these ๐Ÿ˜ญ but hey, i'm not about to make stuff up. if the page doesn't say it, i don't say it. that's the rule, and we respect the rule ๐Ÿงš

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

the kernel file lives at ./tools/perf/util/cpumap.h and it's giving friend group, because here's everyone else you might wanna meet:

like, the whole topo squad is here โ€” socket, die, cluster, core, node, global โ€” and cpu_aggr_map__empty_new(9) for when you want the map but, y'know, empty ๐Ÿ“


โญ the cute sign-off โญ

this lil masterpiece lives in ./tools/perf/util, and the version/date stamp on it says October 2026 ๐Ÿ’œ so yeah, when you're reading this in October 2026, know that future-you is thriving and so is this manpage.

stay sorted, stay deduplicated, and go build some maps bestie ๐Ÿฆ‹๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from