diff mbox

[4/4] cpu: cpufreq: show Turbo Boost with top _PSS value

Message ID 1400848963-18477-5-git-send-email-colin.king@canonical.com
State Accepted
Headers show

Commit Message

Colin Ian King May 23, 2014, 12:42 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

To clarify CPU _PSS top state, we can flag it as Turbo Boost just
as some extra helpful information.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/cpu/cpufreq/cpufreq.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

Comments

Keng-Yu Lin May 26, 2014, 12:30 a.m. UTC | #1
On Fri, May 23, 2014 at 8:42 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> To clarify CPU _PSS top state, we can flag it as Turbo Boost just
> as some extra helpful information.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/cpu/cpufreq/cpufreq.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/src/cpu/cpufreq/cpufreq.c b/src/cpu/cpufreq/cpufreq.c
> index 22e16ef..8b08146 100644
> --- a/src/cpu/cpufreq/cpufreq.c
> +++ b/src/cpu/cpufreq/cpufreq.c
> @@ -382,11 +382,20 @@ static void do_cpu(fwts_framework *fw, const int cpu)
>         fwts_log_info(fw, "CPU %d: %i CPU frequency steps supported.", cpu, speedcount);
>         fwts_log_info_verbatum(fw, " Frequency | Relative Speed | Bogo loops");
>         fwts_log_info_verbatum(fw, "-----------+----------------+-----------");
> -       for (i = 0; i < speedcount; i++)
> -               fwts_log_info_verbatum(fw, "%10s |     %5.1f %%    | %9" PRIu64,
> +       for (i = 0; i < speedcount; i++) {
> +               char *turbo = "";
> +#ifdef FWTS_ARCH_INTEL
> +               if ((i == 0) && (speedcount > 1) &&
> +                   (hz_almost_equal(freqs[i].Hz, freqs[i + 1].Hz)))
> +                       turbo = " (Turbo Boost)";
> +#endif
> +
> +               fwts_log_info_verbatum(fw, "%10s |     %5.1f %%    | %9" PRIu64 "%s",
>                         hz_to_human(freqs[i].Hz),
>                         100.0 * freqs[i].speed/cpu_top_speed,
> -                       freqs[i].speed);
> +                       freqs[i].speed,
> +                       turbo);
> +       }
>
>         if (number_of_speeds == -1)
>                 number_of_speeds = speedcount;
> --
> 2.0.0.rc0
>
>

Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Alex Hung May 28, 2014, 4:57 a.m. UTC | #2
On 05/23/2014 08:42 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> To clarify CPU _PSS top state, we can flag it as Turbo Boost just
> as some extra helpful information.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/cpu/cpufreq/cpufreq.c | 15 ++++++++++++---
>   1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/src/cpu/cpufreq/cpufreq.c b/src/cpu/cpufreq/cpufreq.c
> index 22e16ef..8b08146 100644
> --- a/src/cpu/cpufreq/cpufreq.c
> +++ b/src/cpu/cpufreq/cpufreq.c
> @@ -382,11 +382,20 @@ static void do_cpu(fwts_framework *fw, const int cpu)
>   	fwts_log_info(fw, "CPU %d: %i CPU frequency steps supported.", cpu, speedcount);
>   	fwts_log_info_verbatum(fw, " Frequency | Relative Speed | Bogo loops");
>   	fwts_log_info_verbatum(fw, "-----------+----------------+-----------");
> -	for (i = 0; i < speedcount; i++)
> -		fwts_log_info_verbatum(fw, "%10s |     %5.1f %%    | %9" PRIu64,
> +	for (i = 0; i < speedcount; i++) {
> +		char *turbo = "";
> +#ifdef FWTS_ARCH_INTEL
> +		if ((i == 0) && (speedcount > 1) &&
> +		    (hz_almost_equal(freqs[i].Hz, freqs[i + 1].Hz)))
> +			turbo = " (Turbo Boost)";
> +#endif
> +
> +		fwts_log_info_verbatum(fw, "%10s |     %5.1f %%    | %9" PRIu64 "%s",
>   			hz_to_human(freqs[i].Hz),
>   			100.0 * freqs[i].speed/cpu_top_speed,
> -			freqs[i].speed);
> +			freqs[i].speed,
> +			turbo);
> +	}
>
>   	if (number_of_speeds == -1)
>   		number_of_speeds = speedcount;
>


Acked-by: Alex Hung <alex.hung@canonical.com>
diff mbox

Patch

diff --git a/src/cpu/cpufreq/cpufreq.c b/src/cpu/cpufreq/cpufreq.c
index 22e16ef..8b08146 100644
--- a/src/cpu/cpufreq/cpufreq.c
+++ b/src/cpu/cpufreq/cpufreq.c
@@ -382,11 +382,20 @@  static void do_cpu(fwts_framework *fw, const int cpu)
 	fwts_log_info(fw, "CPU %d: %i CPU frequency steps supported.", cpu, speedcount);
 	fwts_log_info_verbatum(fw, " Frequency | Relative Speed | Bogo loops");
 	fwts_log_info_verbatum(fw, "-----------+----------------+-----------");
-	for (i = 0; i < speedcount; i++)
-		fwts_log_info_verbatum(fw, "%10s |     %5.1f %%    | %9" PRIu64,
+	for (i = 0; i < speedcount; i++) {
+		char *turbo = "";
+#ifdef FWTS_ARCH_INTEL
+		if ((i == 0) && (speedcount > 1) &&
+		    (hz_almost_equal(freqs[i].Hz, freqs[i + 1].Hz)))
+			turbo = " (Turbo Boost)";
+#endif
+
+		fwts_log_info_verbatum(fw, "%10s |     %5.1f %%    | %9" PRIu64 "%s",
 			hz_to_human(freqs[i].Hz),
 			100.0 * freqs[i].speed/cpu_top_speed,
-			freqs[i].speed);
+			freqs[i].speed,
+			turbo);
+	}
 
 	if (number_of_speeds == -1)
 		number_of_speeds = speedcount;