diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2017-01-30 22:09:23 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-02-01 03:13:49 -0500 |
commit | 5613fda9a503cd6137b120298902a34a1386b2c1 (patch) | |
tree | 5431dd50508a6cfa052a3b9966e58842b430804d /fs/proc/array.c | |
parent | a1cecf2ba78e0a6de00ff99df34b662728535aa5 (diff) |
sched/cputime: Convert task/group cputime to nsecs
Now that most cputime readers use the transition API which return the
task cputime in old style cputime_t, we can safely store the cputime in
nsecs. This will eventually make cputime statistics less opaque and more
granular. Back and forth convertions between cputime_t and nsecs in order
to deal with cputime_t random granularity won't be needed anymore.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Wanpeng Li <wanpeng.li@hotmail.com>
Link: http://lkml.kernel.org/r/1485832191-26889-8-git-send-email-fweisbec@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r-- | fs/proc/array.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index 25b54cf0c042..fe12b519d09b 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
@@ -401,7 +401,7 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, | |||
401 | unsigned long long start_time; | 401 | unsigned long long start_time; |
402 | unsigned long cmin_flt = 0, cmaj_flt = 0; | 402 | unsigned long cmin_flt = 0, cmaj_flt = 0; |
403 | unsigned long min_flt = 0, maj_flt = 0; | 403 | unsigned long min_flt = 0, maj_flt = 0; |
404 | cputime_t cutime, cstime, utime, stime; | 404 | u64 cutime, cstime, utime, stime; |
405 | u64 cgtime, gtime; | 405 | u64 cgtime, gtime; |
406 | unsigned long rsslim = 0; | 406 | unsigned long rsslim = 0; |
407 | char tcomm[sizeof(task->comm)]; | 407 | char tcomm[sizeof(task->comm)]; |
@@ -497,10 +497,10 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, | |||
497 | seq_put_decimal_ull(m, " ", cmin_flt); | 497 | seq_put_decimal_ull(m, " ", cmin_flt); |
498 | seq_put_decimal_ull(m, " ", maj_flt); | 498 | seq_put_decimal_ull(m, " ", maj_flt); |
499 | seq_put_decimal_ull(m, " ", cmaj_flt); | 499 | seq_put_decimal_ull(m, " ", cmaj_flt); |
500 | seq_put_decimal_ull(m, " ", cputime_to_clock_t(utime)); | 500 | seq_put_decimal_ull(m, " ", nsec_to_clock_t(utime)); |
501 | seq_put_decimal_ull(m, " ", cputime_to_clock_t(stime)); | 501 | seq_put_decimal_ull(m, " ", nsec_to_clock_t(stime)); |
502 | seq_put_decimal_ll(m, " ", cputime_to_clock_t(cutime)); | 502 | seq_put_decimal_ll(m, " ", nsec_to_clock_t(cutime)); |
503 | seq_put_decimal_ll(m, " ", cputime_to_clock_t(cstime)); | 503 | seq_put_decimal_ll(m, " ", nsec_to_clock_t(cstime)); |
504 | seq_put_decimal_ll(m, " ", priority); | 504 | seq_put_decimal_ll(m, " ", priority); |
505 | seq_put_decimal_ll(m, " ", nice); | 505 | seq_put_decimal_ll(m, " ", nice); |
506 | seq_put_decimal_ll(m, " ", num_threads); | 506 | seq_put_decimal_ll(m, " ", num_threads); |