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 8/8] tools/power/x86/intel-speed-select: Output success/failed for command output
Date: Tue,  3 Sep 2019 11:37:34 -0400	[thread overview]
Message-ID: <20190903153734.11904-9-prarit@redhat.com> (raw)
In-Reply-To: <20190903153734.11904-1-prarit@redhat.com>

Command output has confusing data, returning "0" on success.  For example

|# ./intel-speed-select -c 14 turbo-freq enable
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
 package-1
   die-0
     cpu-14
       turbo-freq
         enable:0

To avoid confusion change the command output to 'success' or 'failed'.

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
---
 tools/power/x86/intel-speed-select/isst-display.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/power/x86/intel-speed-select/isst-display.c b/tools/power/x86/intel-speed-select/isst-display.c
index 890a01bfee4b..8500cf2997a6 100644
--- a/tools/power/x86/intel-speed-select/isst-display.c
+++ b/tools/power/x86/intel-speed-select/isst-display.c
@@ -519,7 +519,10 @@ void isst_display_result(int cpu, FILE *outf, char *feature, char *cmd,
 	snprintf(header, sizeof(header), "%s", feature);
 	format_and_print(outf, 4, header, NULL);
 	snprintf(header, sizeof(header), "%s", cmd);
-	snprintf(value, sizeof(value), "%d", result);
+	if (!result)
+		snprintf(value, sizeof(value), "success");
+	else
+		snprintf(value, sizeof(value), "failed(error %d)", result);
 	format_and_print(outf, 5, header, value);
 
 	format_and_print(outf, 1, NULL, NULL);
-- 
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 ` [PATCH 4/8] tools/power/x86/intel-speed-select: Simplify output for turbo-freq and base-freq Prarit Bhargava
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 ` Prarit Bhargava [this message]
2019-09-03 22:18   ` [PATCH 8/8] tools/power/x86/intel-speed-select: Output success/failed for command output 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-9-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).