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 /include/linux/sched.h | |
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 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 8377ac73a034..24ea3398ae15 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1702,6 +1702,10 @@ struct task_struct { cputime_t utime, stime, utimescaled, stimescaled; cputime_t gtime; +#ifdef CONFIG_CPU_FREQ_TIMES + u64 *time_in_state; + unsigned int max_state; +#endif struct prev_cputime prev_cputime; #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN seqlock_t vtime_seqlock; |