STRUCT WAKEUP_SOURCE(9)
β¨ struct wakeup_source β Kernel API Manual, section 9 β¨
okay so bestie, welcome to the glow-up era of struct wakeup_source(9). this is the little struct that tells the kernel "hey, something is keeping me awake, pls don't sleep yet" and honestly? it's giving main character energy. let's get into it π
π NAME π
struct wakeup_source β the literal representation of wakeup sources, no cap β¨
π¦ SYNOPSIS π¦
struct wakeup_source {
const char *name;
int id;
struct list_head entry;
spinlock_t lock;
struct wake_irq *wakeirq;
struct timer_list timer;
unsigned long timer_expires;
ktime_t total_time;
ktime_t max_time;
ktime_t last_time;
ktime_t start_prevent_time;
ktime_t prevent_sleep_time;
unsigned long event_count;
unsigned long active_count;
unsigned long relax_count;
unsigned long expire_count;
unsigned long wakeup_count;
struct device *dev;
bool active:1;
bool autosleep_enabled:1;
};
like, look at her. every field is exactly where it should be, not one character moved. iconic. π
πΈ Members πΈ
time for the member-by-member vibe check, bestie. every single one, fr fr:
nameβ the name of the wakeup source π·οΈidβ the wakeup source identryβ the wakeup source's list entry (she's linked in, she's on a list, she's social π)lockβ the wakeup source lock πwakeirqβ an optional, device-specific wakeirqtimerβ the wakeup timer list β°timer_expiresβ when the wakeup timer expirestotal_timeβ the total amount of time this wakeup source has been activemax_timeβ the maximum amount of time this wakeup source has been continuously active (the longest unbroken stretch, bestie π)last_timeβ the monotonic clock reading from the last time the wakeup source's was touchedprevent_sleep_timeβ the total amount of time this source has been preventing autosleep πevent_countβ how many wakeup events have been signaledactive_countβ how many times the wakeup source was activatedrelax_countβ how many times the wakeup source was deactivated (she's chilling, she's resting, she's relaxing π)expire_countβ how many times the wakeup source's timeout has expiredwakeup_countβ how many times the wakeup source might abort suspend π³devβ the struct device used for sysfs statistics about the wakeup sourceactiveβ the status of the wakeup sourceautosleep_enabledβ autosleep is active, so updateprevent_sleep_timeπ
π₯ SEE ALSO π₯
the kernel file ./include/linux/pm_wakeup.h plus these two besties:
and that's the whole page, bestie, you ate that π«Ά
ngl if you skipped the member list, go back up, there were nineteen of them and every single one matters π
kiss kiss, this came from ./include/linux, dated October 2026, and it's filed under struct wakeup_source(9) β slay πβ¨
π¦ 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