aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/misc/uid_cputime.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/misc/uid_cputime.c b/drivers/misc/uid_cputime.c
index c751188ce..a2d4cbb66 100644
--- a/drivers/misc/uid_cputime.c
+++ b/drivers/misc/uid_cputime.c
@@ -38,6 +38,8 @@ struct uid_entry {
cputime_t stime;
cputime_t active_utime;
cputime_t active_stime;
+ cputime_t total_utime;
+ cputime_t total_stime;
unsigned long long active_power;
unsigned long long power;
struct hlist_node hash;
@@ -66,6 +68,8 @@ static struct uid_entry *find_or_register_uid(uid_t uid)
return NULL;
uid_entry->uid = uid;
+ uid_entry->total_utime = 0;
+ uid_entry->total_stime = 0;
hash_add(hash_table, &uid_entry->hash, uid);
@@ -119,6 +123,20 @@ 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;
+
+ /***
+ * workaround for KernelUidCpuTimeReader issue
+ ***/
+ if (total_stime < uid_entry->total_stime)
+ total_stime = uid_entry->total_stime;
+ else
+ uid_entry->total_stime = total_stime;
+
+ if (total_utime < uid_entry->total_utime)
+ total_utime = uid_entry->total_utime;
+ else
+ uid_entry->total_utime = total_utime;
+
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,