linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Prarit Bhargava <prarit@redhat.com>
To: platform-driver-x86@vger.kernel.org
Cc: Prarit Bhargava <prarit@redhat.com>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	David Arcari <darcari@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/8] tools/power/x86/intel-speed-select: Simplify output for turbo-freq and base-freq
Date: Tue,  3 Sep 2019 11:37:30 -0400	[thread overview]
Message-ID: <20190903153734.11904-5-prarit@redhat.com> (raw)
In-Reply-To: <20190903153734.11904-1-prarit@redhat.com>

The current output of 'intel-speed-select -c 53 perf-profile info -l 0'
shows

        speed-select-turbo-freq-support:1
        speed-select-base-freq-support:1
        speed-select-base-freq-enabled:0
        speed-select-turbo-freq-enabled:0

Simplify the output to single lines displaying status of disabled,
enabled, and unsupported.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: David Arcari <darcari@redhat.com>
Cc: linux-kernel@vger.kernel.org
---
 .../x86/intel-speed-select/isst-display.c     | 30 ++++++++++---------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/tools/power/x86/intel-speed-select/isst-display.c b/tools/power/x86/intel-speed-select/isst-display.c
index 0d9a53a5da2d..3ae693efceaa 100644
--- a/tools/power/x86/intel-speed-select/isst-display.c
+++ b/tools/power/x86/intel-speed-select/isst-display.c
@@ -297,23 +297,25 @@ void isst_ctdp_display_information(int cpu, FILE *outf, int tdp_level,
 		format_and_print(outf, base_level + 4, header, value);
 
 		snprintf(header, sizeof(header),
-			 "speed-select-turbo-freq-support");
-		snprintf(value, sizeof(value), "%d", ctdp_level->fact_support);
+			 "speed-select-turbo-freq");
+		if (ctdp_level->fact_support) {
+			if (ctdp_level->fact_enabled)
+				snprintf(value, sizeof(value), "enabled");
+			else
+				snprintf(value, sizeof(value), "disabled");
+		} else
+			snprintf(value, sizeof(value), "unsupported");
 		format_and_print(outf, base_level + 4, header, value);
 
 		snprintf(header, sizeof(header),
-			 "speed-select-base-freq-support");
-		snprintf(value, sizeof(value), "%d", ctdp_level->pbf_support);
-		format_and_print(outf, base_level + 4, header, value);
-
-		snprintf(header, sizeof(header),
-			 "speed-select-base-freq-enabled");
-		snprintf(value, sizeof(value), "%d", ctdp_level->pbf_enabled);
-		format_and_print(outf, base_level + 4, header, value);
-
-		snprintf(header, sizeof(header),
-			 "speed-select-turbo-freq-enabled");
-		snprintf(value, sizeof(value), "%d", ctdp_level->fact_enabled);
+			 "speed-select-base-freq");
+		if (ctdp_level->pbf_support) {
+			if (ctdp_level->pbf_enabled)
+				snprintf(value, sizeof(value), "enabled");
+			else
+				snprintf(value, sizeof(value), "disabled");
+		} else
+			snprintf(value, sizeof(value), "unsupported");
 		format_and_print(outf, base_level + 4, header, value);
 
 		snprintf(header, sizeof(header), "thermal-design-power(W)");
-- 
2.21.0


  parent reply	other threads:[~2019-09-03 15:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 15:37 [PATCH 0/8] tools-power-x86-intel-speed-select: Fixes and updates for output Prarit Bhargava
2019-09-03 15:37 ` [PATCH 1/8] tools/power/x86/intel-speed-select: Fix package typo Prarit Bhargava
2019-09-03 15:37 ` [PATCH 2/8] tools/power/x86/intel-speed-select: Fix help option typo Prarit Bhargava
2019-09-03 15:37 ` [PATCH 3/8] tools/power/x86/intel-speed-select: Fix cpu-count output Prarit Bhargava
2019-09-03 15:37 ` Prarit Bhargava [this message]
2019-09-03 15:37 ` [PATCH 5/8] tools/power/x86/intel-speed-select: Switch output to MHz Prarit Bhargava
2019-09-03 15:37 ` [PATCH 6/8] tools/power/x86/intel-speed-select: Change turbo ratio output to maximum turbo frequency Prarit Bhargava
2019-09-03 15:37 ` [PATCH 7/8] tools/power/x86/intel-speed-select: Output human readable CPU list Prarit Bhargava
2019-09-03 15:37 ` [PATCH 8/8] tools/power/x86/intel-speed-select: Output success/failed for command output Prarit Bhargava
2019-09-03 22:18   ` Srinivas Pandruvada
2019-09-04 20:06 ` [PATCH 0/8] tools-power-x86-intel-speed-select: Fixes and updates for output Srinivas Pandruvada
2019-09-04 20:55   ` Prarit Bhargava
2019-09-04 20:59     ` Srinivas Pandruvada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190903153734.11904-5-prarit@redhat.com \
    --to=prarit@redhat.com \
    --cc=darcari@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).