thread_group_sample_cputime(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… thread_group_sample_cputime ✨

ok so bestie, welcome to the Kernel API Manual entry for thread_group_sample_cputime β€” yes that's a mouthful, yes it's iconic, and yes we're gonna get through it together 🫢


🌸 NAME 🌸

thread_group_sample_cputime β€” sample cputime for a given task ⏱️✨


πŸŽ€ SYNOPSIS πŸŽ€

void thread_group_sample_cputime (struct task_struct *tsk , u64 *samples );

literally that's the whole signature. no cap. πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • tsk β€” the task whose cputime needs to be started πŸ‘‘
  • samples β€” your storage spot for the time samples, aka where the numbers go πŸ“

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the vibe: this one gets called from sys_getitimer to calculate the expiry time of an active timer. which means β€” and this is the important part, bestie β€” group cputime accounting is already active. it also gets called with the task sighand lock held, so don't go doing anything weird in there, iykyk πŸ”’

what does it actually do? it updates the times with an up-to-date sample of the thread group cputimes. that's it. that's the whole job. main character energy, minimal drama ✨


🌈 SEE ALSO 🌈

go read those too, fr fr, they're all besties πŸ’–


ngl if you skimmed all of that, the takeaway is: it samples cputime for a task's thread group, it's called from sys_getitimer with the sighand lock held, and group cputime accounting is already active when you get here. periodt πŸ’…

and that's the page!! 🧚 this little gem lives under ./kernel/time and it's dated October 2026 β€” mwah, sending you off with a kiss and a πŸŽ€, go forth and sample those cputimes bestie πŸ’œ

πŸ“¦ where this page comes from