mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
cputime: Use accessors to read task cputime stats
This is in preparation for the full dynticks feature. While remotely reading the cputime of a task running in a full dynticks CPU, we'll need to do some extra-computation. This way we can account the time it spent tickless in userspace since its last cputime snapshot. Signed-off-by: Frederic Weisbecker <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Li Zhong <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Paul Gortmaker <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Thomas Gleixner <[email protected]>
This commit is contained in:
parent
3f4724ea85
commit
6fac4829ce
16 changed files with 144 additions and 49 deletions
|
|
@ -566,6 +566,7 @@ out:
|
|||
void acct_collect(long exitcode, int group_dead)
|
||||
{
|
||||
struct pacct_struct *pacct = ¤t->signal->pacct;
|
||||
cputime_t utime, stime;
|
||||
unsigned long vsize = 0;
|
||||
|
||||
if (group_dead && current->mm) {
|
||||
|
|
@ -593,8 +594,9 @@ void acct_collect(long exitcode, int group_dead)
|
|||
pacct->ac_flag |= ACORE;
|
||||
if (current->flags & PF_SIGNALED)
|
||||
pacct->ac_flag |= AXSIG;
|
||||
pacct->ac_utime += current->utime;
|
||||
pacct->ac_stime += current->stime;
|
||||
task_cputime(current, &utime, &stime);
|
||||
pacct->ac_utime += utime;
|
||||
pacct->ac_stime += stime;
|
||||
pacct->ac_minflt += current->min_flt;
|
||||
pacct->ac_majflt += current->maj_flt;
|
||||
spin_unlock_irq(¤t->sighand->siglock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue