From patchwork Wed Mar 1 05:27:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 9597585 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 75DB2600CB for ; Wed, 1 Mar 2017 05:39:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68BAA28306 for ; Wed, 1 Mar 2017 05:39:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B7BC2842B; Wed, 1 Mar 2017 05:39:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EA3E28306 for ; Wed, 1 Mar 2017 05:39:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752121AbdCAFjf (ORCPT ); Wed, 1 Mar 2017 00:39:35 -0500 Received: from mail-qk0-f193.google.com ([209.85.220.193]:33995 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750707AbdCAFjc (ORCPT ); Wed, 1 Mar 2017 00:39:32 -0500 Received: by mail-qk0-f193.google.com with SMTP id s186so8260716qkb.1; Tue, 28 Feb 2017 21:36:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references:reply-to:organization; bh=VDrUmnrDmxHJ5brMX8uo1QMuMYn0AjxMU9DQ9599xVE=; b=QuRYEtTwyJhF21WZ3pkkkzljAqVPptIrmYTR45Vc5mVReIzkv2iOuxPIV2sJLNfD7M eRd5SBn+5BezDResP+RPCWslEPbRJXcA4FqiUQhddb375DdBBMbid0/zWVmg1kdcsStk QgLZC39X+t6htU4BdRzYjidO/T8SOSxzDGCL160Mb3hR0ViugMEFrQYm/3YoiDfvn1Ow 9YmxybCMpYz+FQGv/tz74UzzS0zyUr2MTQg078A6ZR4cmf7mOHYCqtWFpqPy529964t8 g4D4LUluaqPnhwQxoYzuc7KFDd2NRTwr21isrQzXc5l0o/7+VTJzE//QnMg3ce2NtwFu 1RLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references:reply-to:organization; bh=VDrUmnrDmxHJ5brMX8uo1QMuMYn0AjxMU9DQ9599xVE=; b=RLyxB24DPhZ5GZQ9zy0fMkR/xoX+X75mgXoMR+dVMv1a8fUc0Bvcif8aDeU5VDrs5i 66RLEKGZqFKhdt4Z9rgissKCs+yiaVltxuIazzvXTXy8ug2MhVt+tmI35gaADG6rnZ74 2Rj+cRVq6Kz+XRELIfKKfhAVYtdWD73FCJYcz7MfmftSwTWIukKWHf2/xdsXyRmcbVkW U/lbM/KXu2ie56hqLkZAf8kwG1cXv67WvTd8iYnh+gDkIgvDfF6kWtysAHCNYTHbp28m RhD0ynuABGGHC5oYs15/SIO3chKtcNcZOdUom6X6Al/52WrYgj2GCm5TYE/w2cLboKxH DXsg== X-Gm-Message-State: AMke39ljJ+e1p6QwQpLCByQdRu3VsTTSUf5QugyCQB8ooMlVNZUBN/t07pfJGSD+61oNig== X-Received: by 10.200.2.150 with SMTP id p22mr8067187qtg.197.1488346121064; Tue, 28 Feb 2017 21:28:41 -0800 (PST) Received: from z87.localdomain (pool-96-230-116-151.bstnma.fios.verizon.net. [96.230.116.151]) by smtp.gmail.com with ESMTPSA id c141sm2530517qkb.10.2017.02.28.21.28.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Feb 2017 21:28:40 -0800 (PST) From: Len Brown To: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH 27/44] tools/power turbostat: skip unused counters on SKX Date: Wed, 1 Mar 2017 00:27:31 -0500 Message-Id: <34c7619762f7b4ebbd5157b312e6022b725c031e.1488345270.git.len.brown@intel.com> X-Mailer: git-send-email 2.11.0.161.g6610af872 In-Reply-To: <20170301052748.27810-1-lenb@kernel.org> References: <20170301052748.27810-1-lenb@kernel.org> In-Reply-To: <678a3bd1b3de6d2ebf604e7d708bc8150bb667e9.1488345270.git.len.brown@intel.com> References: <678a3bd1b3de6d2ebf604e7d708bc8150bb667e9.1488345270.git.len.brown@intel.com> Reply-To: Len Brown Organization: Intel Open Source Technology Center Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Len Brown Skip these four counters on SKX, as they are always zero: cc3, pc3 cc7, pc7 Signed-off-by: Len Brown --- tools/power/x86/turbostat/turbostat.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 1010135ee973..8c437115d41b 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -2584,6 +2584,18 @@ int is_dnv(unsigned int family, unsigned int model) } return 0; } +int is_skx(unsigned int family, unsigned int model) +{ + + if (!genuine_intel) + return 0; + + switch (model) { + case INTEL_FAM6_SKYLAKE_X: + return 1; + } + return 0; +} int has_nhm_turbo_ratio_limit(unsigned int family, unsigned int model) { @@ -3871,6 +3883,12 @@ void process_cpuid() BIC_NOT_PRESENT(BIC_Pkgpc7); use_c1_residency_msr = 1; } + if (is_skx(family, model)) { + BIC_NOT_PRESENT(BIC_CPU_c3); + BIC_NOT_PRESENT(BIC_Pkgpc3); + BIC_NOT_PRESENT(BIC_CPU_c7); + BIC_NOT_PRESENT(BIC_Pkgpc7); + } if (has_hsw_msrs(family, model)) { BIC_PRESENT(BIC_Pkgpc8); BIC_PRESENT(BIC_Pkgpc9);