mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: Prarit Bhargava <prarit@redhat.com>, platform-driver-x86@vger.kernel.org
Cc: David Arcari <darcari@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 8/8] tools/power/x86/intel-speed-select: Output success/failed for command output
Date: Tue, 03 Sep 2019 15:18:43 -0700	[thread overview]
Message-ID: <1da2a58548277dfd8086be02b8467cc903ed7932.camel@linux.intel.com> (raw)
In-Reply-To: <20190903153734.11904-9-prarit@redhat.com>

On Tue, 2019-09-03 at 11:37 -0400, Prarit Bhargava wrote:
> 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'.
We need to fix also help in the function usage() to match new
implementation

"        printf("\t\t\tFor Set commands, status is 0 for success and
rest for failures\n");
"

Thanks,
Srinivas

> 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);


  reply	other threads:[~2019-09-03 22:18 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 ` [PATCH 8/8] tools/power/x86/intel-speed-select: Output success/failed for command output Prarit Bhargava
2019-09-03 22:18   ` Srinivas Pandruvada [this message]
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=1da2a58548277dfd8086be02b8467cc903ed7932.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=darcari@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=prarit@redhat.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

Powered by JetHome