Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1473781ybz; Sat, 18 Apr 2020 01:35:51 -0700 (PDT) X-Google-Smtp-Source: APiQypJa4AB8eCBuMWo5Whj2P4SGfLmL63Z0p3RHFy3kEdlB20m57PoEVfdjLC67dmyQkI1i5GGk X-Received: by 2002:aa7:c701:: with SMTP id i1mr6283844edq.184.1587198951148; Sat, 18 Apr 2020 01:35:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587198951; cv=none; d=google.com; s=arc-20160816; b=aqWsDTyTdJoYqRQtoAMIlikC6qYyF/kadSC8TGUQ8AHZ/e8Nu6r5yaegjjSyYAxqqh xsqK22h10Av6xpXVkS2b6UjcXTL1qaJvAsYwdQ5CZ8UKSa+LZkaD1UevHFiDgQsWcMVf 4Ash3E+pIufmCvcYIajo/J1HCbOfznAxMjcnZJgqi2sYoO2WUcDFTXrKegUl5UCMSOXR HYxcBbi0ctTueKlBWZyH7KN+QBt54MD7gss797BU2gcX6jB+d3Dyjs4G1dsFZX7kcf9n qyPve+kQMlv4dIeDNqUiEdZzdTCKxeXRz6BZg3nKSS0tGzE4HZSLDnV4lcL2HLqCNpSJ JSFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:ironport-sdr:ironport-sdr; bh=pmyk78HG+MMJX1e7Luo9Nhr7aItklLeHY96U7GKacoo=; b=FwtZ8nwPRJk/yaAPpawpUy8L/0X3p+DH5aihc8yrAi8acxQCEK+7MM7+yu30gAQkht okD8SBpDRQbMMy0h+X3YuC3U+lwwKlxnZpTETrs2RwKS9tqwNEBb9L6kPbTCLxzk/IQO 6ztHzdF5k/5QT7BFO/oWD8BLhwQuvj4JSoBsxqxZOz2IBtEds0Rg7t8xYL4dUkhxmbhW apwj9SNwe30MzR8aVXTd8M2TrWgM3Yhsz7AK5Zzw8MTBm/zAtI5aGK/CK8/wQStfWvWy x/HUoJqs4jHsumS7qoEmtLPRySS1DB4FG6KP3Pd8FUONoVwd7J8wi97xKdbH7M3AkOPY 9jeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 95si17223079edq.375.2020.04.18.01.35.28; Sat, 18 Apr 2020 01:35:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726069AbgDRIbk (ORCPT + 99 others); Sat, 18 Apr 2020 04:31:40 -0400 Received: from mga07.intel.com ([134.134.136.100]:56271 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725801AbgDRIbj (ORCPT ); Sat, 18 Apr 2020 04:31:39 -0400 IronPort-SDR: OL7yKVU8kd3J/jLxVuwJd35EN3BOlIJj4FB6Q20Bv4JmFJ5iqcQz2dg7kkCzrFkwhX7BVXEYOj VshssAFYXOAA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2020 01:31:38 -0700 IronPort-SDR: bfSFfTVDcKltw7Q5JBo71kyfC8v8UwfHz80cbBkrqBkDEvki7/lPCjLE2GcP5cCyOmR2cBNoez dQ2SKO2rxPkw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,398,1580803200"; d="scan'208";a="254442291" Received: from chenyu-office.sh.intel.com ([10.239.158.173]) by orsmga003.jf.intel.com with ESMTP; 18 Apr 2020 01:31:36 -0700 From: Chen Yu To: linux-pm@vger.kernel.org Cc: Len Brown , "Rafael J. Wysocki" , Doug Smythies , linux-kernel@vger.kernel.org, Chen Yu Subject: [PATCH 3/3][v3] tools/power turbostat: Enable accumulate RAPL display Date: Sat, 18 Apr 2020 16:32:05 +0800 Message-Id: <1f6d32e14f121a8ccf8807b8343597c3ae88c7d2.1587196252.git.yu.c.chen@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enable the accumulated RAPL display by default. Signed-off-by: Chen Yu --- tools/power/x86/turbostat/turbostat.c | 38 +++++++++++---------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 44fd3822a5fa..cc1661e753d2 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -1169,14 +1169,7 @@ int format_counters(struct thread_data *t, struct core_data *c, } } - /* - * If measurement interval exceeds minimum RAPL Joule Counter range, - * indicate that results are suspect by printing "**" in fraction place. - */ - if (interval_float < rapl_joule_counter_range) - fmt8 = "%s%.2f"; - else - fmt8 = "%6.0f**"; + fmt8 = "%s%.2f"; if (DO_BIC(BIC_CorWatt) && (do_rapl & RAPL_PER_CORE_ENERGY)) outp += sprintf(outp, fmt8, (printed++ ? delim : ""), c->core_energy * rapl_energy_units / interval_float); @@ -2069,39 +2062,39 @@ int get_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p) p->sys_lpi = cpuidle_cur_sys_lpi_us; if (do_rapl & RAPL_PKG) { - if (get_msr(cpu, MSR_PKG_ENERGY_STATUS, &msr)) + if (get_msr_sum(cpu, MSR_PKG_ENERGY_STATUS, &msr)) return -13; - p->energy_pkg = msr & 0xFFFFFFFF; + p->energy_pkg = msr; } if (do_rapl & RAPL_CORES_ENERGY_STATUS) { - if (get_msr(cpu, MSR_PP0_ENERGY_STATUS, &msr)) + if (get_msr_sum(cpu, MSR_PP0_ENERGY_STATUS, &msr)) return -14; - p->energy_cores = msr & 0xFFFFFFFF; + p->energy_cores = msr; } if (do_rapl & RAPL_DRAM) { - if (get_msr(cpu, MSR_DRAM_ENERGY_STATUS, &msr)) + if (get_msr_sum(cpu, MSR_DRAM_ENERGY_STATUS, &msr)) return -15; - p->energy_dram = msr & 0xFFFFFFFF; + p->energy_dram = msr; } if (do_rapl & RAPL_GFX) { - if (get_msr(cpu, MSR_PP1_ENERGY_STATUS, &msr)) + if (get_msr_sum(cpu, MSR_PP1_ENERGY_STATUS, &msr)) return -16; - p->energy_gfx = msr & 0xFFFFFFFF; + p->energy_gfx = msr; } if (do_rapl & RAPL_PKG_PERF_STATUS) { - if (get_msr(cpu, MSR_PKG_PERF_STATUS, &msr)) + if (get_msr_sum(cpu, MSR_PKG_PERF_STATUS, &msr)) return -16; - p->rapl_pkg_perf_status = msr & 0xFFFFFFFF; + p->rapl_pkg_perf_status = msr; } if (do_rapl & RAPL_DRAM_PERF_STATUS) { - if (get_msr(cpu, MSR_DRAM_PERF_STATUS, &msr)) + if (get_msr_sum(cpu, MSR_DRAM_PERF_STATUS, &msr)) return -16; - p->rapl_dram_perf_status = msr & 0xFFFFFFFF; + p->rapl_dram_perf_status = msr; } if (do_rapl & RAPL_AMD_F17H) { - if (get_msr(cpu, MSR_PKG_ENERGY_STAT, &msr)) + if (get_msr_sum(cpu, MSR_PKG_ENERGY_STAT, &msr)) return -13; - p->energy_pkg = msr & 0xFFFFFFFF; + p->energy_pkg = msr; } if (DO_BIC(BIC_PkgTmp)) { if (get_msr(cpu, MSR_IA32_PACKAGE_THERM_STATUS, &msr)) @@ -6076,6 +6069,7 @@ int main(int argc, char **argv) return 0; } + msr_sum_record(); /* * if any params left, it must be a command to fork */ -- 2.17.1