diff options
| author | Connor O'Brien <connoro@google.com> | 2018-01-31 18:11:57 -0800 |
|---|---|---|
| committer | Connor O'Brien <connoro@google.com> | 2018-03-06 20:37:28 +0000 |
| commit | fba21f6831a2c5507adb5f4d9e35f02e207ad18b (patch) | |
| tree | 06b256364987c67a6e20a083ad0e327b01c06c79 /kernel/exit.c | |
| parent | d63fdf61a4dc9ba1ac84bc975f79cdc59296777e (diff) | |
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.
Signed-off-by: Connor O'Brien <connoro@google.com>
Bug: 72339335
Test: Read /proc/<pid>/time_in_state
Change-Id: Ia6456754f4cb1e83b2bc35efa8fbe9f8696febc8
Diffstat (limited to 'kernel/exit.c')
| -rw-r--r-- | kernel/exit.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 0003d8b97fd9..0a480853d527 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -54,6 +54,7 @@ #include <linux/writeback.h> #include <linux/shm.h> #include <linux/kcov.h> +#include <linux/cpufreq_times.h> #include "sched/tune.h" @@ -173,6 +174,9 @@ void release_task(struct task_struct *p) { struct task_struct *leader; int zap_leader; +#ifdef CONFIG_CPU_FREQ_TIMES + cpufreq_task_times_exit(p); +#endif repeat: /* don't need to get the RCU readlock here - the process is dead and * can't be modifying its own credentials. But shut RCU-lockdep up */ |
