[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181123143213.GB1617@e119886-lin.cambridge.arm.com>
Date: Fri, 23 Nov 2018 14:32:13 +0000
From: Andrew Murray <andrew.murray@....com>
To: Michael Ellerman <mpe@...erman.id.au>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Will Deacon <will.deacon@....com>,
Mark Rutland <mark.rutland@....com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...en8.de>, x86@...nel.org,
linux-alpha@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 01/10] perf/core: Add macro to test for event exclusion
flags
On Tue, Nov 20, 2018 at 10:28:34PM +1100, Michael Ellerman wrote:
> Andrew Murray <andrew.murray@....com> writes:
>
> > Add a macro that tests if any of the perf event exclusion flags
> > are set on a given event.
> >
> > Signed-off-by: Andrew Murray <andrew.murray@....com>
> > ---
> > include/linux/perf_event.h | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
> > index 53c500f..89ee7fa 100644
> > --- a/include/linux/perf_event.h
> > +++ b/include/linux/perf_event.h
> > @@ -1004,6 +1004,15 @@ perf_event__output_id_sample(struct perf_event *event,
> > extern void
> > perf_log_lost_samples(struct perf_event *event, u64 lost);
> >
> > +static inline bool event_has_exclude_flags(struct perf_event *event)
> > +{
> > + struct perf_event_attr *attr = &event->attr;
> > +
> > + return attr->exclude_idle || attr->exclude_user ||
> > + attr->exclude_kernel || attr->exclude_hv ||
> > + attr->exclude_guest || attr->exclude_host;
> > +}
>
> Sorry to be a total PITA, but using "flags" plural suggests that it only
> returns true if there is more than one exclude flag set.
>
> A better name would be event_has_exclude_flag() or maybe
> event_has_any_exclude_flag().
>
> If you're doing a respin anyway it'd be nice to fix the name, but
> obviously it's not high priority.
No problem - I'll go with event_has_any_exclude_flag.
Thanks,
Andrew Murray
>
> cheers
Powered by blists - more mailing lists