From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755750AbcBBUYM (ORCPT ); Tue, 2 Feb 2016 15:24:12 -0500 Received: from e38.co.us.ibm.com ([32.97.110.159]:37054 "EHLO e38.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755200AbcBBUYH (ORCPT ); Tue, 2 Feb 2016 15:24:07 -0500 X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: sukadev@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Date: Tue, 2 Feb 2016 12:23:16 -0800 From: Sukadev Bhattiprolu To: Madhavan Srinivasan Cc: Michael Ellerman , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] powerpc/perf/hv-24x7: Display change in counter values Message-ID: <20160202202315.GA8240@us.ibm.com> References: <20160130030710.GA7330@us.ibm.com> <20160130030744.GB7330@us.ibm.com> <56B0F2BD.4090007@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56B0F2BD.4090007@linux.vnet.ibm.com> X-Operating-System: Linux 2.0.32 on an i486 User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16020220-0029-0000-0000-00001029BDEF Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Madhavan Srinivasan [maddy@linux.vnet.ibm.com] wrote: > > > On Saturday 30 January 2016 08:37 AM, Sukadev Bhattiprolu wrote: > > From a1aa992fb25fb8e98a5c5724376ae8cc91463de3 Mon Sep 17 00:00:00 2001 > > From: Sukadev Bhattiprolu > > Date: Mon, 25 Jan 2016 23:05:36 -0500 > > Subject: [PATCH 2/2] powerpc/perf/hv-24x7: Display change in counter values > > > > For 24x7 counters, perf displays the raw value of the 24x7 counter, which > > is a monotonically increasing value. > > > > perf stat -C 0 -e \ > > 'hv_24x7/HPM_0THRD_NON_IDLE_CCYC__PHYS_CORE,core=1/' \ > > sleep 1 > > > > Performance counter stats for 'CPU(s) 0': > > > > 9,105,403,170 hv_24x7/HPM_0THRD_NON_IDLE_CCYC__PHYS_CORE,core=1/ > > > > 0.000425751 seconds time elapsed > > > > In the typical usage of 'perf stat' this counter value is not as useful > > as the _change_ in the counter value over the duration of the application. > > This may break application using this interface right? i.e, since > for all this time, counter output was raw values and application > may be post processing to calculate the difference, now with > this patch, application may need some change? Also, > should not this be documented somewhere? Agree that it does change the behavior. I am checking to see if it was explicitly documented that the values would be raw. But current behavior seems counter-intuitive and inconsistent with 'perf stat'. If we run something like: perf stat -C 0 -e <24x7-event> make we see the large number (raw value of the counter) when the application terminates. The raw value not very useful. To effectively use the counter in this scenario, user would ahve to run: perf stat -C 0 -e <24x7-event> sleep 1 #note raw value 1 perf stat -C 0 -e <24x7-event> make # note raw value 2 # compute diff of value2 and value1. Reporting the change in value seems to be consistent with normal usage of perf stat with events like cycles or instructions: Thanks, Sukadev