KCOV_REMOTE_REGISTER(9)

πŸ“¦ in nixpkgs unstable

πŸ’… kcov_remote_register(9) πŸ’…

okay so welcome to the Kernel Developer's Manual, bestie β€” this is the page for kcov_remote_register(9) and its whole remote code-coverage squad. It's giving kernel subsystem group chat, and honestly? iconic. πŸ¦‹

✨ NAME ✨

Say hi to kcov_remote_register, kcov_remote_unregister, kcov_remote_enter, and kcov_remote_leave β€” together they're the remote kernel code coverage collection interface. periodt. πŸ’–

🌸 SYNOPSIS 🌸

#include <sys/kcov.h>

void
kcov_remote_register(int subsystem, void *id);

void
kcov_remote_unregister(int subsystem, void *id);

void
kcov_remote_enter(int subsystem, void *id);

void
kcov_remote_leave(int subsystem, void *id);

πŸŽ€ DESCRIPTION πŸŽ€

These functions are the interface for collecting code coverage from various kernel subsystems using kcov(4). The subsystem must be one of the following:

#define KCOV_REMOTE_COMMON 0

The id must be a unique identifier for a resource tied to subsystem that is known both by kernel and user space. For instance, a network interface driver could form a subsystem using the unique interface identifier as the id. highkey a whole vibe. 🫢

  • kcov_remote_register(int subsystem, void *id) β€” registers a new instance of the given subsystem. Calling this function more than once with the same arguments is idempotent, so bestie, same args = same result, no drama. ✨
  • kcov_remote_unregister(int subsystem, void *id) β€” unregisters an existing instance of the given subsystem, if present. If one or many threads are currently within a remote section, kcov_remote_unregister() will sleep until all the sections have been left. It's literally waiting for everybody to exit the group chat. 😭
  • kcov_remote_enter(int subsystem, void *id) β€” enters a remote section. If the current thread has kcov(4) enabled, code coverage will be collected inside the remote section. Remote sections may not be nested β€” do not stack them, bestie, that's forbidden stacking energy πŸ’€.
  • kcov_remote_leave(int subsystem, void *id) β€” leaves a remote section. bye bestie! πŸ‘‹

🧚 CONTEXT 🧚

kcov_remote_register() and kcov_remote_unregister() can be called from process context. kcov_remote_enter() and kcov_remote_leave() can be called from interrupt and process context. slay for flexibility. πŸ”₯

πŸ”₯ CODE REFERENCES πŸ”₯

These functions are implemented in sys/dev/kcov.c. go look, it's right there. πŸ‘‘

🌈 SEE ALSO 🌈

πŸ‘‘ HISTORY πŸ‘‘

These functions first appeared in OpenBSD 6.8. a classic, no cap. πŸ’œ

🫢 AUTHORS 🫢

Anton Lindqvist <anton@openbsd.org>


okay that's the tea β˜• β€” this page is from Debian, dated February 1, 2021, and yes bestie, it's the KCOV_REMOTE_REGISTER(9) manual page. mwah πŸ’‹πŸŽ€

πŸ“¦ 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