KSTAT_KV_INIT(9)

πŸ“¦ in nixpkgs unstable

🌸 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() β€” initialises kv with a name specified as key. The type of the value is specified as type. ✨
  • kstat_kv_unit_init() β€” initialises kv with a name specified as key. The integer or counter type of the value is specified as type, and specifies the units for the values in unit. πŸ’…
  • KSTAT_KV_INITIALIZER() β€” a kstat_kv structure can be initialised at compile time with this macro. The kstat_kv structure will be declared with the name key with the type of the values as type. πŸŽ€
  • KSTAT_KV_UNIT_INITIALIZER() β€” a kstat_kv structure can be initialised at compile time with this macro too. The kstat_kv structure will be declared with the name key with the integer or counter type of the values as type, and specifies the units for the values in unit. πŸ¦‹

πŸ‘€ 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms