diff options
author | Kamil Konieczny <k.konieczny@samsung.com> | 2019-12-06 13:46:39 +0900 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2019-12-30 09:59:05 +0900 |
commit | 1ebd0bc0e8adbfa548335d016ead922cc85fcecd (patch) | |
tree | 486156c8cecd6a122158753788a7b9da76c0aee9 /include/linux/devfreq.h | |
parent | 14a34396819960865ff737c665c6e46b64d0e04a (diff) |
PM / devfreq: Move statistics to separate struct devfreq_stats
Count time and transitions between devfreq frequencies in separate
struct devfreq_stats for improved code readability and maintenance.
Signed-off-by: Kamil Konieczny <k.konieczny@samsung.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
[cw00.choi: Fix the merge conflict in trasn_stat_store
and use 'devfreq->stats.*' style for consistent coding style
and restore the clean-up code of 'devfreq->profile->*']
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'include/linux/devfreq.h')
-rw-r--r-- | include/linux/devfreq.h | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index 95816a8e3d26..9e73c84adf50 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h @@ -108,6 +108,20 @@ struct devfreq_dev_profile { }; /** + * struct devfreq_stats - Statistics of devfreq device behavior + * @total_trans: Number of devfreq transitions. + * @trans_table: Statistics of devfreq transitions. + * @time_in_state: Statistics of devfreq states. + * @last_update: The last time stats were updated. + */ +struct devfreq_stats { + unsigned int total_trans; + unsigned int *trans_table; + u64 *time_in_state; + u64 last_update; +}; + +/** * struct devfreq - Device devfreq structure * @node: list node - contains the devices with devfreq that have been * registered. @@ -132,10 +146,7 @@ struct devfreq_dev_profile { * @suspend_freq: frequency of a device set during suspend phase. * @resume_freq: frequency of a device set in resume phase. * @suspend_count: suspend requests counter for a device. - * @total_trans: Number of devfreq transitions - * @trans_table: Statistics of devfreq transitions - * @time_in_state: Statistics of devfreq states - * @last_stat_updated: The last time stat updated + * @stats: Statistics of devfreq device behavior * @transition_notifier_list: list head of DEVFREQ_TRANSITION_NOTIFIER notifier * @nb_min: Notifier block for DEV_PM_QOS_MIN_FREQUENCY * @nb_max: Notifier block for DEV_PM_QOS_MAX_FREQUENCY @@ -174,11 +185,8 @@ struct devfreq { unsigned long resume_freq; atomic_t suspend_count; - /* information for device frequency transition */ - unsigned int total_trans; - unsigned int *trans_table; - u64 *time_in_state; - u64 last_stat_updated; + /* information for device frequency transitions */ + struct devfreq_stats stats; struct srcu_notifier_head transition_notifier_list; |