tools/power/cpupower: Display boost frequency separately
PATCH 1/1 tools/power/cpupower: Display boost frequency separately
cpufreq driver creates sysfs file "scaling_boost_frequency" for platforms which support boost frequency. Cpupower now prints boost frequencies separately. For few x86 vendors who already have different way to get boost frequency, will continue to use the existing logic. Rest of the platforms will rely on "scaling_boost_frequency" file to display boost frequency.
Signed-off-by Abhishek Goel <[email protected]>
--- tools/power/cpupower/lib/cpufreq.c | 19 +++++----- tools/power/cpupower/lib/cpufreq.h | 16 ++++----- tools/power/cpupower/utils/cpufreq-info.c | 42 +++++++++++++++++------ 3 files changed, 50 insertions(+), 27 deletions(-)
tools/power/cpupower/lib/cpufreq.c +11 -8
@@ -333,17 +333,20 @@ void cpufreq_put_available_governors(struct cpufreq_available_governors *any) } -struct cpufreq_available_frequencies -*cpufreq_get_available_frequencies (unsigned int cpu) +struct cpufreq_frequencies +*cpufreq_get_frequencies (const char *type,unsigned int cpu) { -struct cpufreq_available_frequencies *first =NULL ; -struct cpufreq_available_frequencies *current =NULL ; +struct cpufreq_frequencies *first =NULL ; +struct cpufreq_frequencies *current =NULL ;char one_value[SYSFS_PATH_MAX ];char linebuf[MAX_LINE_LEN ]; +char fname[MAX_LINE_LEN ];unsigned int pos, i;unsigned int len; - len =sysfs_cpufreq_read_file (cpu,"scaling_available_frequencies" , +snprintf (fname,MAX_LINE_LEN ,"scaling_%s_frequencies" , type); + + len =sysfs_cpufreq_read_file (cpu, fname, linebuf,sizeof (linebuf));if (len ==0 )return NULL ;
@@ -389,9 +392,9 @@ struct cpufreq_available_frequenciesreturn NULL ; } -void cpufreq_put_available_frequencies (struct cpufreq_available_frequencies - *any) { -struct cpufreq_available_frequencies *tmp, *next; +void cpufreq_put_frequencies (struct cpufreq_frequencies *any) +{ +struct cpufreq_frequencies *tmp, *next;if (!any)return ;
tools/power/cpupower/lib/cpufreq.h +8 -8
@@ -28,10 +28,10 @@ struct cpufreq_available_governors {struct cpufreq_available_governors *first; }; -struct cpufreq_available_frequencies { +struct cpufreq_frequencies {unsigned long frequency; -struct cpufreq_available_frequencies *next; -struct cpufreq_available_frequencies *first; +struct cpufreq_frequencies *next; +struct cpufreq_frequencies *first; };
@@ -129,14 +129,14 @@ void cpufreq_put_available_governors(* * Only present on _some_ ->target() cpufreq drivers. For information purposes * only. Please free allocated memory by calling -* cpufreq_put_available_frequencies after use. +* cpufreq_put_frequencies after use. */ -struct cpufreq_available_frequencies -*cpufreq_get_available_frequencies (unsigned int cpu); +struct cpufreq_frequencies +*cpufreq_get_frequencies (const char *type,unsigned int cpu); -void cpufreq_put_available_frequencies ( -struct cpufreq_available_frequencies *first); +void cpufreq_put_frequencies ( +struct cpufreq_frequencies *first);/* determine affected CPUs
tools/power/cpupower/utils/cpufreq-info.c +31 -11
77 lines not on this page · raw message
Signature · 1 line
2.17.1