mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -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
|
|
@ -1139,6 +1139,7 @@ struct rusage32 {
|
|||
SYSCALL_DEFINE2(osf_getrusage, int, who, struct rusage32 __user *, ru)
|
||||
{
|
||||
struct rusage32 r;
|
||||
cputime_t utime, stime;
|
||||
|
||||
if (who != RUSAGE_SELF && who != RUSAGE_CHILDREN)
|
||||
return -EINVAL;
|
||||
|
|
@ -1146,8 +1147,9 @@ SYSCALL_DEFINE2(osf_getrusage, int, who, struct rusage32 __user *, ru)
|
|||
memset(&r, 0, sizeof(r));
|
||||
switch (who) {
|
||||
case RUSAGE_SELF:
|
||||
jiffies_to_timeval32(current->utime, &r.ru_utime);
|
||||
jiffies_to_timeval32(current->stime, &r.ru_stime);
|
||||
task_cputime(current, &utime, &stime);
|
||||
jiffies_to_timeval32(utime, &r.ru_utime);
|
||||
jiffies_to_timeval32(stime, &r.ru_stime);
|
||||
r.ru_minflt = current->min_flt;
|
||||
r.ru_majflt = current->maj_flt;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue