STRUCT TASK_CPUTIME(9)
π struct task_cputime(9)
okay bestie, gather round, because today we're talking about struct task_cputime β literally the collected CPU time counts, no cap. this is a <italic>Kernel API Manual</italic> moment and i'm obsessed. β¨
π SYNOPSIS π
struct task_cputime {
u64 stime;
u64 utime;
unsigned long long sum_exec_runtime;
};
like, that's the whole vibe. three little fields. iconic. π«Ά
πΈ Members πΈ
stimeβ the time spent in kernel mode, in nanoseconds. that's the behind-the-scenes, main-character-working-late energy. πutimeβ the time spent in user mode, in nanoseconds. this is you, out there living your best life in userspace. π¦sum_exec_runtimeβ the total time spent on the CPU, in nanoseconds. the whole picture, the full story, the grand total. π
β¨ Description β¨
so this structure groups together three kinds of CPU time that get tracked for threads and thread groups. three! a little trio. a friend group of counters. π
and here's the thing β most things out there that are considering CPU time want to group these counts together and treat all three of them in parallel. so like, don't be weird about it and only look at one, okay? they're a package deal. fr fr. π
π₯ SEE ALSO π₯
- Kernel file
./include/linux/sched/types.hβ go read it, iykyk π
lowkey reminder bestie: every single one of those numbers is in nanoseconds. don't come for me later saying i didn't warn you. π
and that's the tea! π§ from ./include/linux/sched, dated October 2026, this has been your girl signing off β slay, stay hydrated, and may all your runtime sums be accurate. ππβ
π¦ 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