KSTAT_KV_INIT(9)
πΈ NAME πΈ
okay bestie, this is KSTAT_KV_INIT(9) from the Kernel Developer's Manual, and it's literally the kernel statistic key/value data API page of your dreams π
kstat_kv_init, kstat_kv_unit_init, KSTAT_KV_INITIALIZER, KSTAT_KV_UNIT_INITIALIZER β kernel statistic key/value data API β¨
β¨ SYNOPSIS β¨
#include <sys/kstat.h>
void
kstat_kv_init(struct kstat_kv *kv, const char *key,
enum kstat_kv_type type);
void
kstat_kv_unit_init(struct kstat_kv *kv, const char *key,
enum kstat_kv_type type, enum kstat_kv_unit unit);
KSTAT_KV_INITIALIZER(const char *name, enum kstat_kv_type type);
KSTAT_KV_UNIT_INITIALIZER(const char *name, enum kstat_kv_type type,
enum kstat_kv_unit unit);
π DESCRIPTION π
okay so the kstat key/value data API supports the creation and maintenance of kstat_kv structures that can be exported to userland using the kstat API. no cap, that's the whole vibe π
A kstat key/value data payload for a kstat structure (created using kstat_create(9) with KSTAT_T_KV as the type argument) is a series of kstat_kv structures in memory. kstat_kv values are typed, and the memory used to store values of different types is either inline as part of the structure, or is extra bytes following a structure of a specified length. it's giving structured-data main character energy π₯
π§ the functions, bestie π§
kstat_kv_init()β initialiseskvwith a name specified askey. The type of the value is specified astype. β¨kstat_kv_unit_init()β initialiseskvwith a name specified askey. The integer or counter type of the value is specified astype, and specifies the units for the values inunit. πKSTAT_KV_INITIALIZER()β akstat_kvstructure can be initialised at compile time with this macro. Thekstat_kvstructure will be declared with the namekeywith the type of the values astype. πKSTAT_KV_UNIT_INITIALIZER()β akstat_kvstructure can be initialised at compile time with this macro too. Thekstat_kvstructure will be declared with the namekeywith the integer or counter type of the values astype, and specifies the units for the values inunit. π¦
π SEE ALSO π
π°οΈ HISTORY π°οΈ
These functions first appeared in OpenBSD 6.8. iconic behavior, honestly π
π«Ά AUTHORS π«Ά
David Gwynne <dlg@openbsd.org> π
mwah π this page's footer says Debian, August 10, 2020, KSTAT_KV_INIT(9) β that's the source/version and date, bestie, and that's the whole page. periodt π
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 2020 David Gwynne <dlg@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms