STRUCT KVM_STATS_DESC(9)
β¨ struct kvm_stats_desc(9) β¨
okay bestie so this is a page from the Kernel API Manual and it's literally all about struct kvm_stats_desc β the Descriptor of a KVM statistics. yes, a statistics, that's what the manpage says, we don't question the manpage π
it's giving "small struct, big responsibilities."
πΈ NAME πΈ
struct kvm_stats_desc β Descriptor of a KVM statistics. that's it, that's the whole job description π
π¦ SYNOPSIS π¦
struct kvm_stats_desc {
__u32 flags;
__s16 exponent;
__u16 size;
__u32 offset;
__u32 bucket_size;
#ifdef __KERNEL__;
char name[KVM_STATS_NAME_SIZE];
#else;
char name[];
#endif;
};
no cap, copy it exactly like that, semicolons after the preprocessor lines and all β that's what the original says and we are not out here editing the source, periodt π₯
π Members π
flagsβ the annotations of the stats, like type, unit, etc. basically the little vibe check labels so everyone knows what kind of stat this is β¨exponentβ used together withflagsto determine the unit. dynamic duo energy, they work as a team π«Άsizeβ the number of data items for this stats. and every single data item is of type__u64, so plan accordingly πoffsetβ the offset of the stats to the start of stat structure in structurekvmorkvm_vcpu. yes, it's a whole "where do I even sit" situation πͺbucket_sizeβ a parameter value used for histogram stats. it is only used for linear histogram stats, specifying the size of the bucket; lowkey a niche queen but iconic in her lane πnameβ the name string for the stats. its size is indicated by thekvm_stats_header->name_size. πnameβ the name string for the stats. its size is indicated by thekvm_stats_header->name_size. yeah bestie it's listed twice in the original, i'm not gonna gaslight you and pretend it isn't π twice! we respect the duplication π
π§ SEE ALSO π§
- Kernel file
./tools/include/uapi/linux/kvm.h struct kvm_stats_header(9)
like, go read those too, iykyk π
π tiny reminder: thenamefield is sized differently depending on whether you're in__KERNEL__or not βchar name[KVM_STATS_NAME_SIZE]inside the kernel, flexiblechar name[]outside. the#ifdefsays it all, no notes π
and that's the page!! ty for coming to my ted talk, go forth and describe your KVM stats with confidence π π¦β¨
β with love, from ./tools/include/uapi/linux, October 2026 π
π¦ 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