Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp582158ybz; Wed, 15 Apr 2020 14:30:50 -0700 (PDT) X-Google-Smtp-Source: APiQypK42grNq3xdkkwcRBiSaXkfcVVLNinR3/YQ4soAz4KR0X9NdhMcA9783129z+MNif+92Gim X-Received: by 2002:a17:906:258a:: with SMTP id m10mr7073530ejb.255.1586986250713; Wed, 15 Apr 2020 14:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586986250; cv=none; d=google.com; s=arc-20160816; b=NdAvh0zP0Oc6KE+/6FurEaM6dlrCzKg3fWJE9x0R5hgwZcuc+v/CvHIJB2sh6vOZtm Bjefuhf17Osqs+m+xmIPHpyl87yDQeae0nuRFzTC7jFDAXzIqmov90CLS3uxYVLDzTTv BtyKrIo26zFg2lKzCusTD4s8GvH+swsnUMprdlqC1ZS66Kq+2Dhdf8yD4hoPO7Uvz+Ak DQee1d/kZf3MHrIoSKvPXbqb6K+fM9HiURcWAyZFV5SMspjamf+5cdZFnzzOp/rQPDuv 3/szi28lz1DD4ObByUqaeIN9QRnYZLaXFBD0sveoArNDCXWm3RhnxxeH4ouT3oyzEFeA PufA== 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=0KpOhbR7EqyDzciKl9CxYkwG+1+3/kcGAuIPY03cfyU=; b=g+rCdfeLQ0x2TsCFMik1Vm0pIHwU/SXCF+D6hEaHLSaNVgFVqD0WK8MRQ5SYSzeWRp dniiXnLeyBrETwQVEnPZ9OWxc7GTZnH/qiZU8ku5KZImVhjMvzuiB8d4YjveoFkUlcL7 vHyFJx4uZavofp5MNV1AznkPmPsNvOxbsCdGnCrxWg4C3uvhh0aMS8GK4fXrFvP1kfor MBHSSmuj7hQxWvi0UabHxfCsW2iBZrVdgPzw5Br5kp2p0t4frZWuCzcZpmDdXrLz8XlJ Tx4eQWglGpI+vkzXu5aqFxHcsZRkZzVTfHA750HS2TXCi4iUTJoBM1gOv7QkKcx9ao0n uxxg== 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 rv13si4319423ejb.115.2020.04.15.14.30.25; Wed, 15 Apr 2020 14:30:50 -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 S2502455AbgDNM4p (ORCPT + 99 others); Tue, 14 Apr 2020 08:56:45 -0400 Received: from mga18.intel.com ([134.134.136.126]:30327 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502379AbgDNM4h (ORCPT ); Tue, 14 Apr 2020 08:56:37 -0400 IronPort-SDR: RALUCLWzA513w5YLsdb+DuMoI3qmO9SBvtQ+wz21FWHI0TEjmB5d1hhQBzoGGJD30K1kL3tsX6 Zeu0OusZ0E9g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2020 05:56:35 -0700 IronPort-SDR: 0t2LpaZzXlrLiysgg+XThqX3bjmDETP/jkxtCWox8fvVjUjySzFjzb/fbcs52LNgL3lyv+Fwjo Ppo2e/h182MA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,382,1580803200"; d="scan'208";a="277244660" Received: from chenyu-office.sh.intel.com ([10.239.158.173]) by fmsmga004.fm.intel.com with ESMTP; 14 Apr 2020 05:56:34 -0700 From: Chen Yu To: linux-pm@vger.kernel.org Cc: Len Brown , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Chen Yu Subject: [PATCH 3/3][RFC v2] tools/power turbostat: Enable accumulate RAPL display Date: Tue, 14 Apr 2020 20:57:07 +0800 Message-Id: <81e85cd2b8e2d386bac71731307c0dcd4ad2871f.1586782089.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 | 34 +++++++++++---------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index ef380db38cba..29fc4069f467 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,34 +2062,34 @@ 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)) @@ -6073,6 +6066,7 @@ int main(int argc, char **argv) return 0; } + msr_sum_record(); /* * if any params left, it must be a command to fork */ -- 2.20.1