Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 0ae80885 authored by Jin Qian's avatar Jin Qian Committed by Alistair Strachan
Browse files

ANDROID: uid_cputime: Adds accounting for the cputimes per uid.



Adds proc files /proc/uid_cputime/show_uid_stat and
/proc/uid_cputime/remove_uid_range.

show_uid_stat lists the total utime and stime for the active as well as
terminated processes for each of the uids.

Writing a range of uids to remove_uid_range will delete the accounting
for all the uids within that range.

Bug: 120442023
Change-Id: I21d9210379da730b33ddc1a0ea663c8c9d2ac15b
Signed-off-by: default avatarJin Qian <jinqian@google.com>
[AmitP: Refactored the original patch because upstream commit
        605dc2b3 ("tsacct: Convert obsolete cputime type to nsecs")
        made cputime_t type obsolete, so use u64 nanoseconds directly instead.
        Also folded following android-4.9 changes into this patch
        48a9906c0fd8 ("ANDROID: proc: uid_cputime: create uids from kuids")
        453ac31cab34 ("ANDROID: proc: uid_cputime: fix show_uid_stat permission")]
Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
[connoro: Used by batterystats.]
[astrachan: Folded in the file/kconfig rename and the following changes:
            da3687fbc393 ("ANDROID: uid_cputime: fix cputime overflow")
            71e3eb512d00 ("ANDROID: uid_cputime: Iterates over all the threads instead of processes.")
            c65f0080c300 ("ANDROID: uid_cputime: Check for the range while removing range of UIDs.")
            c8212458e3a5 ("ANDROID: uid_sys_stats: fix access of task_uid(task)")
            bb5ee21cc4dd ("ANDROID: uid_sys_stats: change to use rt_mutex")
            6dc5d8173a8c ("ANDROID: uid_sys_stats: check previous uid_entry before call find_or_register_uid")
            82b9872b3894 ("ANDROID: uid_sys_stats: Replace tasklist lock with RCU in uid_cputime_show")]
Signed-off-by: default avatarAlistair Strachan <astrachan@google.com>
parent 74c61e68
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment