forked from rubenslte/android_kernel_samsung_msm8226
uid_cputime: Iterates over all the threads instead of processes.
Bug: 22833116 Change-Id: I775a18f61bd2f4df2bec23d01bd49421d0969f87 Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com> Git-commit: 20dcde6cbc0cd4a17c4d4fd3aa68dc5b03f520d1 Git-repo: https://android.googlesource.com/kernel/msm/ Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
This commit is contained in:
committed by
Srinivasarao P
parent
f4b41b75e3
commit
e4dd583628
@@ -76,7 +76,7 @@ static struct uid_entry *find_or_register_uid(uid_t uid)
|
||||
static int uid_stat_show(struct seq_file *m, void *v)
|
||||
{
|
||||
struct uid_entry *uid_entry;
|
||||
struct task_struct *task;
|
||||
struct task_struct *task, *temp;
|
||||
unsigned long bkt;
|
||||
struct hlist_node *node;
|
||||
|
||||
@@ -89,7 +89,7 @@ static int uid_stat_show(struct seq_file *m, void *v)
|
||||
}
|
||||
|
||||
read_lock(&tasklist_lock);
|
||||
for_each_process(task) {
|
||||
do_each_thread(temp, task) {
|
||||
uid_entry = find_or_register_uid(task_uid(task));
|
||||
if (!uid_entry) {
|
||||
read_unlock(&tasklist_lock);
|
||||
@@ -105,7 +105,7 @@ static int uid_stat_show(struct seq_file *m, void *v)
|
||||
uid_entry->active_utime += task->utime;
|
||||
uid_entry->active_stime += task->stime;
|
||||
uid_entry->active_power += task->cpu_power;
|
||||
}
|
||||
} while_each_thread(temp, task);
|
||||
read_unlock(&tasklist_lock);
|
||||
|
||||
hash_for_each(hash_table, bkt, node, uid_entry, hash) {
|
||||
|
||||
Reference in New Issue
Block a user