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 <fweisbec@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Li Zhong <zhong@linux.vnet.ibm.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
+2
-2
@@ -449,7 +449,7 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
|
||||
do {
|
||||
min_flt += t->min_flt;
|
||||
maj_flt += t->maj_flt;
|
||||
gtime += t->gtime;
|
||||
gtime += task_gtime(t);
|
||||
t = next_thread(t);
|
||||
} while (t != task);
|
||||
|
||||
@@ -472,7 +472,7 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
|
||||
min_flt = task->min_flt;
|
||||
maj_flt = task->maj_flt;
|
||||
task_cputime_adjusted(task, &utime, &stime);
|
||||
gtime = task->gtime;
|
||||
gtime = task_gtime(task);
|
||||
}
|
||||
|
||||
/* scale priority and nice values from timeslices to -20..20 */
|
||||
|
||||
Reference in New Issue
Block a user