Commit Graph

6 Commits

Author SHA1 Message Date
Connor O'Brien
fa37c212ca ANDROID: cpufreq: times: Remove per-UID time in state tracking
This removes the portion of commit c408992c71 ("ANDROID: cpufreq:
times: track per-uid time in state") adding per-UID tracking, while
preserving an added null check in the per-task tracking code.

Bug: 127641090
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Iae3e0abef32cbbb9fdc674079973040be0060ac7
2020-03-06 12:33:54 -08:00
Connor O'Brien
652638b3bd Revert "ANDROID: cpufreq: Add time_in_state to /proc/uid directories"
This reverts commit ce765ecd8d.

Bug: 127641090
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: If2218dbb21dfd807f8eed79092c9e77f7e1ea840
2020-03-06 12:31:01 -08:00
Connor O'Brien
0d084d72df ANDROID: cpufreq: times: record fast switch frequency transitions
cpufreq_times_record_transition() is not called when fast switch is
enabled, leading /proc/uid_time_in_state to attribute all time on a
cluster to a single frequency. To fix this, add a call to
cpufreq_times_record_transition() in the fast switch path.

Also revise cpufreq_times_record_transition() to simplify the new call
and more closely align with cpufreq_stats_record_transition().

Bug: 121287027
Bug: 127641090
Test: /proc/uid_time_in_state shows times for more than one freq per
cluster
Change-Id: Ib63d19006878fafb88475e401ef243bdd8b11979
Signed-off-by: Connor O'Brien <connoro@google.com>
2019-05-03 10:44:51 -07:00
Connor O'Brien
ce765ecd8d ANDROID: cpufreq: Add time_in_state to /proc/uid directories
Add per-uid files that report the data in binary format rather than
text, to allow faster reading & parsing by userspace.

Signed-off-by: Connor O'Brien <connoro@google.com>
Bug: 72339335
Bug: 127641090
Test: compare values to those reported in /proc/uid_time_in_state
Change-Id: I463039ea7f17b842be4c70024fe772539fe2ce02
2019-05-03 10:44:50 -07:00
Connor O'Brien
c408992c71 ANDROID: cpufreq: times: track per-uid time in state
Add /proc/uid_time_in_state showing per uid/frequency/cluster
times. Allow uid removal through /proc/uid_cputime/remove_uid_range.

Signed-off-by: Connor O'Brien <connoro@google.com>
Bug: 72339335
Bug: 127641090
Test: Read /proc/uid_time_in_state
Change-Id: I20ba3546a27c25b7e7991e2a86986e158aafa58c
2019-05-03 10:44:50 -07:00
Connor O'Brien
8bea10e033 ANDROID: cpufreq: track per-task time in state
Add time in state data to task structs, and create
/proc/<pid>/time_in_state files to show how long each individual task
has run at each frequency.
Create a CONFIG_CPU_FREQ_TIMES option to enable/disable this tracking.

Bug: 72339335
Bug: 127641090
Test: Read /proc/<pid>/time_in_state
Change-Id: Ia6456754f4cb1e83b2bc35efa8fbe9f8696febc8
Signed-off-by: Connor O'Brien <connoro@google.com>
[astrachan: Folded the following changes into this patch:
            a6d3de6a7fba ("ANDROID: Reduce use of #ifdef CONFIG_CPU_FREQ_TIMES")
            b89ada5d9c09 ("ANDROID: Fix massive cpufreq_times memory leaks")]
Signed-off-by: Alistair Strachan <astrachan@google.com>
2019-05-03 10:44:49 -07:00