Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1057047ybe; Thu, 5 Sep 2019 09:39:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDoX1cDo/NpgmI2+FA5f23vVrQsp7E00SVSKRHUdk7jNDka/fgS1orb9fNt4dz+ADerISJ X-Received: by 2002:a17:902:f215:: with SMTP id gn21mr4567342plb.156.1567701543626; Thu, 05 Sep 2019 09:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567701543; cv=none; d=google.com; s=arc-20160816; b=0XKc9gZ0m4NAPDXGpgUp9xekTVMOMNnCmNIAZUBqYrZWUnF/J1bT57dryP0itQD/0A 5T+A8XnSe03p8oc2MpU2ju49MY663Mt7qceCv+GyhthrDsCu6FRiUJV9d5osUSrHIZxV f6nmy6IeYoLgUUYfbfow660yTZq+jMl9+HpCUPoeWqX6n5pZG9wEfiTrAt0ir1ywDoNi gVyWNBsE8pYm8YU0hxMKWo5CTAVeRpGIWAEIsOJzWrFjNG16YXydyCLYCuKECKqnBLpj VqwZNE75hxCxmOfEnbgL7BT5dQ0p3EGodnCbJ9RM1b/HzfkCuL4c6X7uc/EP76sfd0xQ Oghw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=uhRaz1UxIcvkCCTVOi6IoHfvCt268iGnqTbisNyduEs=; b=PTcpM2htH7X0TTokrG2JwBvEAlkdi0yD5cWte7F2uv+W0Lwu+GZQyGozLzDDn9CMtg u7wCN+uQsf3ndFCHHWbiYpAvgJpmL8elGs+lf/CMQuVK03BivlQFe6Xm7DTJ1mt4Lll5 yYmlgK5cv3LdAk4A4lleN/n4A/pa3tMdwMqjt/CsTKTWlFwBdPCnVf6D7IrP6RgAXIPl YZzZu8mfcKYhKPLapj5S85TmGQo3OsVk4BZjP6Eh2WDT9bpkHEyzBJ5NW08HduvFMT+m bK3mUwkbYktp55i5oJXZOAgd9Wla/9O4/giZkPIqaSh91UtG3KQZmJd9UZ0AfIS//uEn p1VQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68si2209836pgb.104.2019.09.05.09.38.47; Thu, 05 Sep 2019 09:39:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389117AbfIEMD3 (ORCPT + 99 others); Thu, 5 Sep 2019 08:03:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35510 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389092AbfIEMD0 (ORCPT ); Thu, 5 Sep 2019 08:03:26 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 84445335D9; Thu, 5 Sep 2019 12:03:26 +0000 (UTC) Received: from prarit.bos.redhat.com (prarit-guest.khw1.lab.eng.bos.redhat.com [10.16.200.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id CBFCF1001947; Thu, 5 Sep 2019 12:03:25 +0000 (UTC) From: Prarit Bhargava To: platform-driver-x86@vger.kernel.org Cc: andriy.shevchenko@intel.com, Prarit Bhargava , Srinivas Pandruvada , David Arcari , linux-kernel@vger.kernel.org Subject: [PATCH v2 8/9] tools/power/x86/intel-speed-select: Output success/failed for command output Date: Thu, 5 Sep 2019 08:03:10 -0400 Message-Id: <20190905120311.15286-9-prarit@redhat.com> In-Reply-To: <20190905120311.15286-1-prarit@redhat.com> References: <20190905120311.15286-1-prarit@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 05 Sep 2019 12:03:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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'. v2: Remove help output line. Signed-off-by: Prarit Bhargava Cc: Srinivas Pandruvada Cc: David Arcari Cc: linux-kernel@vger.kernel.org --- tools/power/x86/intel-speed-select/isst-config.c | 1 - tools/power/x86/intel-speed-select/isst-display.c | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c index f81a28c6b586..78f0cebda1da 100644 --- a/tools/power/x86/intel-speed-select/isst-config.c +++ b/tools/power/x86/intel-speed-select/isst-config.c @@ -1514,7 +1514,6 @@ static void usage(void) printf("\tResult display uses a common format for each command:\n"); printf("\tResults are formatted in text/JSON with\n"); printf("\t\tPackage, Die, CPU, and command specific results.\n"); - printf("\t\t\tFor Set commands, status is 0 for success and rest for failures\n"); exit(1); } 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