Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1062842ybe; Thu, 5 Sep 2019 09:44:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzStM7BGHi9AYA/renLQcNeleET3GywFHAoZK4E7N8iXM/kTcl4W+wROzbfkX14lRebqyP8 X-Received: by 2002:a63:d30f:: with SMTP id b15mr3984914pgg.341.1567701870968; Thu, 05 Sep 2019 09:44:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567701870; cv=none; d=google.com; s=arc-20160816; b=glgqYsGya9FaiO3eB3ZegR1LMV5ZYninIeXy8Hwzey4SoAZBDAEWm8ueERD0Kfc/RM 5j9zzKSJ2/U3hUfBmLwN07mSE3gK4YgiPXRtVK/r7SwsxedzS9Cj+1S/OuQpYl2DurJc w35PqKgdpLqaTQlaOOFfSP7Cm8hc8I/wgoi6ktMzl9mcWh/Jts3wNSFaCzcUtk16NaLd axc8C3gI4g6O2qEeTBKXK86quh0deMGt8iV685bVJIeOSMcBrBDTtwWv7Z/VsOSpmsZi /0JXS92HKxuxaYCl39Et5OA+ea78IcILBfZNdpzLx3WlvkXg9JulMkLVqltE9b7R5ZTF /fsA== 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=zF52CqoEwprVfMXPpjyYkJJIQY3y3sYpCBTfMPHc60c=; b=nQwFuBe/ykXr10Wbw0ltmYZECQy7pbwYdXW3/73COL8WWnigE9jZFxgnKe0q8yEJrC 9CXhhdVIkLRqykVjrw4GwAv8GcMRBhpNiL3BscA2Xy6QCJxePH6tkcrnBu6K6Zu0oEW3 rX6qyNiPalnmtZfs7k4IcAqHHTv0eKsNjEgeZXimNNw5Fo+6WxqhaBgGBlYI8kPDddwj jUvXzlEBs0QNTerhk6XNwhOD5aj0ehuwRvdPYY+Frf6nHWy3PhpY0bXCy65zt/bd1WYu AkX/1tWh27P/dbgq2nZ/BrnmC1iQxjGkVwFkT3ufWiFBmdhTUXrnhaeiMOmRyaVZC5q1 wJjw== 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 x1si2455913pgt.258.2019.09.05.09.44.13; Thu, 05 Sep 2019 09:44:30 -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 S2389078AbfIEMDY (ORCPT + 99 others); Thu, 5 Sep 2019 08:03:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48634 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730718AbfIEMDX (ORCPT ); Thu, 5 Sep 2019 08:03:23 -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 3B628189DAE3; Thu, 5 Sep 2019 12:03:23 +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 879BD10002B8; Thu, 5 Sep 2019 12:03:22 +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 4/9] tools/power/x86/intel-speed-select: Simplify output for turbo-freq and base-freq Date: Thu, 5 Sep 2019 08:03:06 -0400 Message-Id: <20190905120311.15286-5-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.6.2 (mx1.redhat.com [10.5.110.63]); Thu, 05 Sep 2019 12:03:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Srinivas Pandruvada Cc: David Arcari 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