linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
To: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] powerpc/perf/hv-24x7: Display change in counter values
Date: Tue, 2 Feb 2016 12:23:16 -0800	[thread overview]
Message-ID: <20160202202315.GA8240@us.ibm.com> (raw)
In-Reply-To: <56B0F2BD.4090007@linux.vnet.ibm.com>

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 <sukadev@linux.vnet.ibm.com>
> > 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

  reply	other threads:[~2016-02-02 20:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-30  3:07 [PATCH 1/2] powerpc/perf/hv-24x7: Fix usage with chip events Sukadev Bhattiprolu
2016-01-30  3:07 ` [PATCH 2/2] powerpc/perf/hv-24x7: Display change in counter values Sukadev Bhattiprolu
2016-02-02 18:17   ` Madhavan Srinivasan
2016-02-02 20:23     ` Sukadev Bhattiprolu [this message]
2016-03-11  0:30 ` [1/2] powerpc/perf/hv-24x7: Fix usage with chip events Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160202202315.GA8240@us.ibm.com \
    --to=sukadev@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.vnet.ibm.com \
    --cc=mpe@ellerman.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).