uid_cputime: skip power reporting per uid for now
authorAmit Pundir <amit.pundir@linaro.org>
Mon, 14 Dec 2015 06:26:35 +0000 (11:56 +0530)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 16 Feb 2016 21:53:55 +0000 (13:53 -0800)
AOSP's cpufreq_stats patch to report power/current
per cpufreq is broken at the moment so skip power
reporting for now.

Change-Id: I07779511f51ff3a9303dc98a3b71ac0a5882a4e9
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
drivers/misc/uid_cputime.c

index c751188ce2abab5c8b5a0077a30a4ba5bbc672ad..c1ad5246f564e5c1a0b210820492b785f7b76d4e 100644 (file)
@@ -38,8 +38,6 @@ struct uid_entry {
        cputime_t stime;
        cputime_t active_utime;
        cputime_t active_stime;
-       unsigned long long active_power;
-       unsigned long long power;
        struct hlist_node hash;
 };
 
@@ -85,7 +83,6 @@ static int uid_stat_show(struct seq_file *m, void *v)
        hash_for_each(hash_table, bkt, uid_entry, hash) {
                uid_entry->active_stime = 0;
                uid_entry->active_utime = 0;
-               uid_entry->active_power = 0;
        }
 
        read_lock(&tasklist_lock);
@@ -100,15 +97,9 @@ static int uid_stat_show(struct seq_file *m, void *v)
                                task_uid(task)));
                        return -ENOMEM;
                }
-               /* if this task is exiting, we have already accounted for the
-                * time and power.
-                */
-               if (task->cpu_power == ULLONG_MAX)
-                       continue;
                task_cputime_adjusted(task, &utime, &stime);
                uid_entry->active_utime += utime;
                uid_entry->active_stime += stime;
-               uid_entry->active_power += task->cpu_power;
        } while_each_thread(temp, task);
        read_unlock(&tasklist_lock);
 
@@ -117,14 +108,11 @@ static int uid_stat_show(struct seq_file *m, void *v)
                                                        uid_entry->active_utime;
                cputime_t total_stime = uid_entry->stime +
                                                        uid_entry->active_stime;
-               unsigned long long total_power = uid_entry->power +
-                                                       uid_entry->active_power;
-               seq_printf(m, "%d: %llu %llu %llu\n", uid_entry->uid,
+               seq_printf(m, "%d: %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);
+                               cputime_to_jiffies(total_stime)) * USEC_PER_MSEC);
        }
 
        mutex_unlock(&uid_lock);
@@ -218,8 +206,6 @@ static int process_notifier(struct notifier_block *self,
        task_cputime_adjusted(task, &utime, &stime);
        uid_entry->utime += utime;
        uid_entry->stime += stime;
-       uid_entry->power += task->cpu_power;
-       task->cpu_power = ULLONG_MAX;
 
 exit:
        mutex_unlock(&uid_lock);