Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp462688ybl; Fri, 30 Aug 2019 02:25:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjrbbyQNf5YIIOjYRbu0Khr+VxnnGsuX14nUQkttrjrpFJh9nBB7AunGtpHyB7VM5x+AWC X-Received: by 2002:a65:5202:: with SMTP id o2mr11622419pgp.29.1567157124487; Fri, 30 Aug 2019 02:25:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567157124; cv=none; d=google.com; s=arc-20160816; b=Srofc/VLr46LeTSCJ8G+vVT7Gv+dInBPOtfe/zTEZRIN6obOXKQb+7rUYknhvgN/b8 U/e3HSSsrD9R5V56Oi1G1lqSSDcpyzbcjQzCG+DA6UFAevIGbWw76y+ge1MSoRfeWkn/ cU6DFfcrbNjmXEk9Qn8DzcYLlg6P1aD4wP6OeIOZbDKIr+S4YyNM4dJHu6UPyqGD/q2j 58KXTsDO2HIbcjHlsRbavtkXSqRw3/efFjXRwT7sJb1W54gTzqeigdNXLP0yWV2mDEGY 6+wDCSY0Un0TMsY2HIVhwlr3vuS4rHBC/sUP3nQBLxhP4mMfdXJ/LTI4zTTDCVRa7ia1 Sm/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=XUsBWAgs/q1uqrUr0WWXRHRbfsHqao7dYIHLQn/r+lY=; b=TgFOC5T/3TUnF5yT+JEbF5ZA7M3KZSoqs6uZI1Oqr/b7sBhH1ODYveIKOyFBiuIs7f Q4IUo/ZM2xmFbR7KM9iKMq3jDLDkg90hEkS/p4ysKtYc942YMZ/TbnrblMaVCoyIO87x ty3E1ohKgR98zt8y5hok5Rrk1QtBzT1Wyki7QBGMfefECfkhtrbtseYFGaOzN92nnYsN O2huJYa0lYi/2B/y8hHQw+bYca7vYzCfP2VnIoNeEpo6Y88U4yq6pd5CQmhvzSbE4/1o oet0cRwxncr3exMGFyrtNDB18UabH19SBkugypsCqKEfrg9rdKLvrc6100CnExVtJz16 G3EQ== 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=hygon.cn Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c15si4255747plo.202.2019.08.30.02.25.09; Fri, 30 Aug 2019 02:25:24 -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=hygon.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727889AbfH3JYO (ORCPT + 99 others); Fri, 30 Aug 2019 05:24:14 -0400 Received: from [110.188.70.11] ([110.188.70.11]:50151 "EHLO spam1.hygon.cn" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726461AbfH3JYO (ORCPT ); Fri, 30 Aug 2019 05:24:14 -0400 Received: from MK-FE.hygon.cn ([172.23.18.61]) by spam1.hygon.cn with ESMTP id x7U9NJ98068505; Fri, 30 Aug 2019 17:23:19 +0800 (GMT-8) (envelope-from puwen@hygon.cn) Received: from cncheex01.Hygon.cn ([172.23.18.10]) by MK-FE.hygon.cn with ESMTP id x7U9N8Lh034383; Fri, 30 Aug 2019 17:23:09 +0800 (GMT-8) (envelope-from puwen@hygon.cn) Received: from pw-vbox.hygon.cn (172.23.18.44) by cncheex01.Hygon.cn (172.23.18.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1466.3; Fri, 30 Aug 2019 17:23:14 +0800 From: Pu Wen To: , CC: , , , Pu Wen Subject: [RFC PATCH] tools/power turbostat: Fix caller parameter of get_tdp_amd() Date: Fri, 30 Aug 2019 17:22:36 +0800 Message-ID: <1567156956-29634-1-git-send-email-puwen@hygon.cn> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.23.18.44] X-ClientProxiedBy: cncheex02.Hygon.cn (172.23.18.12) To cncheex01.Hygon.cn (172.23.18.10) X-MAIL: spam1.hygon.cn x7U9NJ98068505 X-DNSRBL: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 9392bd98bba760be96ee ("tools/power turbostat: Add support for AMD Fam 17h (Zen) RAPL") add a function get_tdp_amd(), the parameter is CPU family. But the rapl_probe_amd() function use wrong model parameter. Fix the wrong caller parameter of get_tdp_amd() to use family. Cc: # v5.1+ Signed-off-by: Pu Wen --- tools/power/x86/turbostat/turbostat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 75fc4fb..1cd28eb 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -4002,7 +4002,7 @@ void rapl_probe_amd(unsigned int family, unsigned int model) rapl_energy_units = ldexp(1.0, -(msr >> 8 & 0x1f)); rapl_power_units = ldexp(1.0, -(msr & 0xf)); - tdp = get_tdp_amd(model); + tdp = get_tdp_amd(family); rapl_joule_counter_range = 0xFFFFFFFF * rapl_energy_units / tdp; if (!quiet) -- 2.7.4