From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Mark Rutland <mark.rutland@arm.com>
Cc: linux-kernel@vger.kernel.org, Will Deacon <will.deacon@arm.com>,
Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] perf: provide PMU when initing events
Date: Thu, 11 Aug 2011 13:43:57 +0200 [thread overview]
Message-ID: <1313063037.4709.0.camel@twins> (raw)
In-Reply-To: <1313062280-19123-1-git-send-email-mark.rutland@arm.com>
On Thu, 2011-08-11 at 12:31 +0100, Mark Rutland wrote:
> Currently, an event's 'pmu' field is set after pmu::event_init() is
> called. This means that pmu::event_init() must figure out which struct
> pmu the event was initialised from. This makes it difficult to
> consolidate common event initialisation code for similar PMUs, and
> very difficult to implement drivers for PMUs which can have multiple
> instances (e.g. a USB controller PMU, a GPU PMU, etc).
>
> This patch sets the 'pmu' field before initialising the event, allowing
> event init code to identify the struct pmu instance easily. In the
> event of failure to initialise an event, the event is destroyed via
> kfree() without calling perf_event::destroy(), so this shouldn't
> result in bad behaviour even if the destroy field was set before
> failure to initialise was noted.
I thought there was a reason for things being the way they are, but
since I can't seem to recollect and your argument does make sense to me
I've merged it.
Thanks!
next prev parent reply other threads:[~2011-08-11 11:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-11 11:31 [PATCH] perf: provide PMU when initing events Mark Rutland
2011-08-11 11:43 ` Peter Zijlstra [this message]
2011-08-14 15:54 ` [tip:perf/core] " tip-bot for Mark Rutland
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=1313063037.4709.0.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@elte.hu \
--cc=will.deacon@arm.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