Skip to content
Snippets Groups Projects
Commit 73f7982c authored by Jin Qian's avatar Jin Qian
Browse files

uid_cputime: fix cputime overflow


Converting cputime_t to usec caused overflow when the value is greater
than 1 hour. Use msec and convert to unsigned long long to support bigger
range.

Bug: 22461683

Change-Id: I853fe3e8e7dbf0d3e2cc5c6f9688a5a6e1f1fb3e
Signed-off-by: default avatarJin Qian <jinqian@google.com>
parent c0084a06
Branches
No related tags found
No related merge requests found
......@@ -119,9 +119,11 @@ static int uid_stat_show(struct seq_file *m, void *v)
uid_entry->active_stime;
unsigned long long total_power = uid_entry->power +
uid_entry->active_power;
seq_printf(m, "%d: %u %u %llu\n", uid_entry->uid,
cputime_to_usecs(total_utime),
cputime_to_usecs(total_stime),
seq_printf(m, "%d: %llu %llu %llu\n", uid_entry->uid,
(unsigned long long)jiffies_to_msecs(
cputime_to_jiffies(total_utime)) * USEC_PER_MSEC,
(unsigned long long)jiffies_to_msecs(
cputime_to_jiffies(total_stime)) * USEC_PER_MSEC,
total_power);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment