STRUCT PERF_CPU(9)
π struct perf_cpu(9) β from the Kernel API Manual, bestie
okay so real talk, this one is a tiny little legend and i need you to appreciate it. it's struct perf_cpu, and it's basically a glow-up wrapper around a CPU number. that's it. that's the whole vibe. β¨
π NAME
struct perf_cpu β a wrapper around a CPU number. lowkey iconic for how small it is.
πΈ SYNOPSIS
struct perf_cpu {
int16_t cpu;
};
yes bestie, that's the entire struct. no cap. she's compact and she knows it. π
π¦ Members
cpuβ the CPU number itself. and listen: it's-1for the"any CPU"/ dummy value. so if you see a-1in there, that's not a glitch, that's her saying "any CPU, idc, whichever" π«Ά
π Description
okay so here's the tea β it's int16_t, which means this whole thing is capped at 32767 CPUs. that's the limit, periodt. π₯
and widening it to int? not free, babe. that requires a libperf ABI bump, so it's a whole thing. if you want the full scope of that saga, go look at tools/lib/perf/TODO β it's all laid out in there. iykyk π
π SEE ALSO
- Kernel file:
./tools/lib/perf/include/perf/cpumap.h perf_cpu_map__new_any_cpu(9)perf_cpu_map__new_online_cpus(9)perf_cpu_map__new(9)perf_cpu_map__cpu(9)perf_cpu_map__nr(9)perf_cpu_map__has_any_cpu_or_is_empty(9)perf_cpu_map__is_any_cpu_or_is_empty(9)perf_cpu_map__is_empty(9)perf_cpu_map__min(9)perf_cpu_map__max(9)
like, go read the whole cpumap family, they're all main character energy together fr fr π
and that's the page!! source/version live at ./tools/lib/perf/include/perf, dated October 2026 β so yes, she's recent, she's fresh, she ate and left no crumbs ππ go forth and map those CPUs bestie π§β
π¦ 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