From: Peter Zijlstra <peterz@infradead.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: "Liang, Kan" <kan.liang@intel.com>,
Andi Kleen <andi@firstfloor.org>, Vince Weaver <vince@deater.net>,
lkml <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] perf/x86/uncore: Allow single pmu/box within events group
Date: Fri, 18 Nov 2016 15:45:09 +0100 [thread overview]
Message-ID: <20161118144509.GB3102@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20161118143048.GC15416@krava>
On Fri, Nov 18, 2016 at 03:30:48PM +0100, Jiri Olsa wrote:
> > > > +static bool is_box_event(struct intel_uncore_box *box, struct perf_event *event)
> > > > {
> > > > - return event->pmu->event_init == uncore_pmu_event_init;
> > > > + return box->pmu == event->pmu;
> > >
> > > this one needs to be:
> > >
> > > + return box->pmu == uncore_event_to_pmu(event);
> > >
> > > and it works.. ;-)
> >
> > Will that not explode if we fudge a software event in there?
> >
> > Wouldn't:
> >
> > return box->pmu.pmu == event->pmu;
> >
> > be the safer option?
>
> hum right.. but for some reason I can't crash it nor even fuzzer complains
Its because pmu is the first member, so the pointer is the exact same,
just the type changes. But that is a 'happy' accident of implementation.
next prev parent reply other threads:[~2016-11-18 14:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-18 0:15 [PATCH] perf/x86/uncore: Allow single pmu/box within events group Jiri Olsa
2016-11-18 11:28 ` Peter Zijlstra
2016-11-18 12:33 ` Jiri Olsa
2016-11-18 12:53 ` Peter Zijlstra
2016-11-18 13:23 ` Jiri Olsa
2016-11-18 13:48 ` Jiri Olsa
2016-11-18 14:06 ` Peter Zijlstra
2016-11-18 14:30 ` Jiri Olsa
2016-11-18 14:45 ` Peter Zijlstra [this message]
2016-11-22 12:30 ` [tip:perf/urgent] perf/x86/intel/uncore: Allow only a single PMU/box within an " tip-bot for Peter Zijlstra
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=20161118144509.GB3102@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=andi@firstfloor.org \
--cc=jolsa@redhat.com \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=vince@deater.net \
/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).