mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Matt Fleming <matt@console-pimps.org>,
	Zhang Rui <rui.zhang@intel.com>,
	"Lin, Ming M" <ming.m.lin@intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"mingo@elte.hu" <mingo@elte.hu>,
	"robert.richter@amd.com" <robert.richter@amd.com>,
	"acme@redhat.com" <acme@redhat.com>,
	"paulus@samba.org" <paulus@samba.org>,
	"dzickus@redhat.com" <dzickus@redhat.com>,
	"gorcunov@gmail.com" <gorcunov@gmail.com>,
	"Brown, Len" <lenb@kernel.org>,
	Matthew Garrett <mjg59@srcf.ucam.org>
Subject: Re: [RFC PATCH 0/3] perf: show package power consumption in perf
Date: Mon, 23 Aug 2010 11:31:36 +0200	[thread overview]
Message-ID: <1282555896.2605.1534.camel@laptop> (raw)
In-Reply-To: <20100821011803.GB7959@nowhere>

On Sat, 2010-08-21 at 03:18 +0200, Frederic Weisbecker wrote:
> On Thu, Aug 19, 2010 at 11:44:45AM +0200, Peter Zijlstra wrote:
> > On Thu, 2010-08-19 at 09:32 +0100, Matt Fleming wrote:
> > > 
> > > 
> > > How big is the hardware counter? The problem comes when the process is
> > > scheduled in and runs for a long time, e.g. so long that the energy
> > > hardware counter wraps. This is why it's necessary to periodically
> > > sample the counter.
> > > 
> > Long running processes aren't the only case, you could associate an
> > event with a CPU.

> I don't understand what you mean.

perf_event_open(.pid = -1, .cpu = n);

> > Right, short counters (like SH when not chained) need something to
> > accumulate deltas into the larger u64. You can indeed use timers for
> > that, hr or otherwise, but you don't need the swcounter hrtimer
> > infrastructure for that.
> 
> 
> So what is the point in simulating a PMI using an hrtimer? It won't be
> based on periods on the interesting counter but on time periods. This
> is not how we want the samples. If we want timer based samples, we can
> just launch a seperate software timer based event.

*sigh* that's exactly what we're doing, we're creating a separate
software hrtimer to create samples, the only thing that's different is
that we put this hrtimer and the hw-counter in a group and let the
hrtimer sample include the hw-counter's value.

If you then weight the samples by the hw-counter delta, you get
something that's more or less related to the thing the hw-counter is
counting.

For counter's that do no provide overflow interrupts this is the only
possible way to get anything.

> In the case of SH where we need to flush to avoid wraps, I understand, but
> oterwise?

The wrap issue it totally unrelated.



  parent reply	other threads:[~2010-08-23  9:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-18  7:59 Zhang Rui
2010-08-18 12:25 ` Peter Zijlstra
2010-08-18 12:41   ` Matt Fleming
2010-08-19  3:28     ` Lin Ming
2010-08-19  7:54       ` Matt Fleming
2010-08-19  8:15         ` Lin Ming
2010-08-19  8:31         ` Zhang Rui
2010-08-19  8:32           ` Matt Fleming
2010-08-19  9:44             ` Peter Zijlstra
2010-08-21  1:18               ` Frederic Weisbecker
2010-08-21  9:30                 ` Ingo Molnar
2010-08-23  9:31                 ` Peter Zijlstra [this message]
2010-08-19  9:02       ` Peter Zijlstra
2010-08-20  1:44         ` Zhang Rui
2010-08-20  9:34           ` Peter Zijlstra
2010-08-20 12:31             ` Ingo Molnar
2010-08-20 21:34               ` acme
2010-08-19  2:43   ` Lin Ming
2010-08-19  8:54     ` Peter Zijlstra
2010-08-20  0:21       ` Lin Ming

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=1282555896.2605.1534.camel@laptop \
    --to=peterz@infradead.org \
    --cc=acme@redhat.com \
    --cc=dzickus@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@console-pimps.org \
    --cc=ming.m.lin@intel.com \
    --cc=mingo@elte.hu \
    --cc=mjg59@srcf.ucam.org \
    --cc=paulus@samba.org \
    --cc=robert.richter@amd.com \
    --cc=rui.zhang@intel.com \
    /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

Powered by JetHome