STRUCT KMOD_TEST_DEVICE(9)
π struct kmod_test_device(9) β a Kernel API Manual moment
okay bestie, so this is a page from the Kernel API Manual, and it's all about struct kmod_test_device β literally the test device that helps you test kmod. that's the whole vibe. it's a struct, it's got members, and every single one of them is here. no cap. π§
β¨ NAME β¨
struct kmod_test_device β the test device that exists to help test kmod. iconic behavior, honestly. π
πΈ SYNOPSIS πΈ
struct kmod_test_device {
int dev_idx;
struct test_config config;
struct miscdevice misc_dev;
struct device *dev;
struct mutex config_mutex;
struct mutex trigger_mutex;
struct mutex thread_mutex;
unsigned int done;
bool test_is_oom;
struct completion kthreads_done;
struct list_head list;
struct kmod_test_device_info *info;
};
like, that's the whole thing. every field accounted for, periodt. π
π¦ Members π¦
okay so let's go member by member because every single one of these matters and we are NOT skipping any π
dev_idxβ the unique ID for the test device. it's how you tell your test devices apart, iykyk.configβ the configuration for the test. obviously. πmisc_devβ plot twist: we use a misc device under the hood. main character energy from a side character.devβ pointer tomisc_dev's ownstruct device. it's giving "my own device's device."config_mutexβ protects configuration of test. do not touch the config without it, fr fr.trigger_mutexβ because the test trigger can only be fired once at a time. one trigger. no queue-jumping. π₯thread_mutexβ protects thedonecount, and theinfoper each thread. she's a busy little lock.doneβ number of threads which have completed or failed. both count! slay. β¨test_is_oomβ when we run out of memory, use this to halt moving forward. like, the moment memory runs out, this is the flag that says "nope, stopping here." πkthreads_doneβ completion used to signal when all work is done. the group-chat "we're all done here" notification π«Άlistβ needed to be part of thereg_test_devs. gotta be on the list to be on the list.infoβ array of info for each thread. one entry per thread, no favorites. π
π SEE ALSO π
- Kernel file
./lib/test_kmod.c enum kmod_test_case(9)struct kmod_test_device_info(9)
go read those next, bestie. it's giving a whole lore arc. π
side note bestie: this struct is straight from the docs under ./lib, so that's where the source lives. no guessing, no extra tips β just the facts as printed.
okay and finally, the cute sign-off π: this page lives in ./lib and it's dated October 2026, and the whole header situation is struct kmod_test_device(9) from the Kernel API Manual. mwah. πππ¦
π¦ 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