Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1525408

Re: [PATCH] perf/x86/uncore: Allow single pmu/box within events group

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH] perf/x86/uncore: Allow single pmu/box within events group
Date 2016-11-18 15:50 +0100
Message-ID <sESEi-8qT-41@gated-at.bofh.it> (permalink)
References (2 earlier) <sEQCu-75C-39@gated-at.bofh.it> <sEQVQ-7dC-9@gated-at.bofh.it> <sERId-7NQ-1@gated-at.bofh.it> <sES1z-8aS-1@gated-at.bofh.it> <sESuB-8nd-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] perf/x86/uncore: Allow single pmu/box within events group Jiri Olsa <jolsa@redhat.com> - 2016-11-18 01:20 +0100
  Re: [PATCH] perf/x86/uncore: Allow single pmu/box within events group Peter Zijlstra <peterz@infradead.org> - 2016-11-18 12:30 +0100
    Re: [PATCH] perf/x86/uncore: Allow single pmu/box within events group Jiri Olsa <jolsa@redhat.com> - 2016-11-18 13:40 +0100
      Re: [PATCH] perf/x86/uncore: Allow single pmu/box within events group Peter Zijlstra <peterz@infradead.org> - 2016-11-18 14:00 +0100
        Re: [PATCH] perf/x86/uncore: Allow single pmu/box within events group Jiri Olsa <jolsa@redhat.com> - 2016-11-18 14:30 +0100
        Re: [PATCH] perf/x86/uncore: Allow single pmu/box within events group Jiri Olsa <jolsa@redhat.com> - 2016-11-18 14:50 +0100
          Re: [PATCH] perf/x86/uncore: Allow single pmu/box within events group Peter Zijlstra <peterz@infradead.org> - 2016-11-18 15:10 +0100
            Re: [PATCH] perf/x86/uncore: Allow single pmu/box within events group Jiri Olsa <jolsa@redhat.com> - 2016-11-18 15:40 +0100
              Re: [PATCH] perf/x86/uncore: Allow single pmu/box within events group Peter Zijlstra <peterz@infradead.org> - 2016-11-18 15:50 +0100
        [tip:perf/urgent] perf/x86/intel/uncore: Allow only a single  PMU/box within an events group tip-bot for Peter Zijlstra <tipbot@zytor.com> - 2016-11-22 13:40 +0100

csiph-web