public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Matt Fleming <matt@console-pimps.org>
Cc: Gui Jianfeng <guijianfeng@cn.fujitsu.com>,
	Yanmin Zhang <yanmin_zhang@linux.intel.com>,
	mingo@elte.hu,
	linux kernel mailing list <linux-kernel@vger.kernel.org>,
	Paul Mundt <lethal@linux-sh.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH 2/3] perf: Remove dead code in buildin-record.c
Date: Wed, 04 Aug 2010 12:56:06 +0200	[thread overview]
Message-ID: <1280919366.1923.985.camel@laptop> (raw)
In-Reply-To: <87hbjwzhak.fsf@linux-g6p1.site>

On Sun, 2010-07-18 at 21:06 +0100, Matt Fleming wrote:
> On Sat, 26 Jun 2010 16:14:46 +0100, Matt Fleming <matt@console-pimps.org> wrote:
> > On Fri, 25 Jun 2010 16:48:05 +0200, Peter Zijlstra <peterz@infradead.org> wrote:
> > > 
> > > Ah, yes, it would be nice for SH (which doesn't have a PMI) to couple a
> > > software timer with their hardware counter to get samples.
> > > 
> > > Never got around to actually implementing that though, maybe Paul has a
> > > minion interested in making that work?
> > 
> > I'll take a look at it.
> 
> How does the 'group_fd' parameter relate to the lack of PMI? Is the idea
> to have one hrtimer that, when it fires, we sample all the counters? So
> the first counter to be created is the group leader, which starts the
> hrtimer, and all other counters are linked to this one? I had a go at
> using a hrtimer per counter (minus any weighting of samples) and it
> worked OK and seemed sensible given that we may want to sample counters
> at different frequencies.
> 
> Is this what you had in mind with the 'group_fd' paramter, Peter? That
> there'd be only one hrtimer?

Right. So sys_perf_event_open() creates a stand alone event, but if you
supply the group_fd param it will attach the newly created one to the
leader indicated by group_fd.

Groups have the properly that they will always be scheduled together,
and read/sample can access/provide data of all of them.

So you can have a sampling leader report the counts of its siblings.

You can make multiple groups, like {hrtimer, cycles} and {hrtimer,
instructions} and {hrtimer, dcache-miss} and perf will schedule the
stuff. If you'd try to do {hrtimer, cycles, insns, dcache-miss} but only
have 2 hardware counters the group creation should fail because the
implementation should dis-allow creating groups that cannot be
scheduled 



  reply	other threads:[~2010-08-04 10:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-25  2:15 [PATCH 1/3] perf kvm: Get rid of unused guest_kallsyms Gui Jianfeng
2010-06-25  2:16 ` [PATCH 2/3] perf: Remove dead code in buildin-record.c Gui Jianfeng
2010-06-25 13:13   ` Arnaldo Carvalho de Melo
2010-06-25 14:48     ` Peter Zijlstra
2010-06-26 15:14       ` Matt Fleming
2010-06-26 18:12         ` Arnaldo Carvalho de Melo
2010-07-18 20:06         ` Matt Fleming
2010-08-04 10:56           ` Peter Zijlstra [this message]
2010-08-04 11:25             ` Matt Fleming
2010-06-25  2:18 ` [PATCH 3/3] perf: Fix the bug which fails to put memory mapping to record file Gui Jianfeng
2010-06-25 15:29 ` [tip:perf/core] perf kvm: Get rid of unused guest_kallsyms tip-bot for Gui Jianfeng

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=1280919366.1923.985.camel@laptop \
    --to=peterz@infradead.org \
    --cc=acme@redhat.com \
    --cc=guijianfeng@cn.fujitsu.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@console-pimps.org \
    --cc=mingo@elte.hu \
    --cc=yanmin_zhang@linux.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