[PATCH 1/5] ARM: perf: consolidate common PMU behaviour
Will Deacon
will.deacon at arm.com
Tue Nov 16 04:47:04 EST 2010
Hi Jean,
> > diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
> > index 07a5035..c49e170 100644
> > --- a/arch/arm/kernel/perf_event.c
> > +++ b/arch/arm/kernel/perf_event.c
> ...
>
> > @@ -166,6 +165,19 @@ armpmu_map_cache_event(u64 config)
> > }
> >
> > static int
> > +armpmu_map_event(u64 config)
> > +{
> > + int mapping = (*armpmu->event_map)[config];
> > + return mapping == HW_OP_UNSUPPORTED ? -EOPNOTSUPP : mapping;
> > +}
> > +
> > +static int
> > +armpmu_map_raw_event(u64 config)
> > +{
> > + return (int)(config & armpmu->raw_event_mask);
> > +}
> > +
> > +static int
> > armpmu_event_set_period(struct perf_event *event,
> > struct hw_perf_event *hwc,
> > int idx)
>
> Those functions could be inlined for performance reason.
Since these are static functions with no side effects, any half-decent
compiler should do the inlining for us. I checked the disassembly to be
sure (GCC based on 4.5.1) and, not only are the above functions inlined,
but __hw_perf_event_init is inlined into armpmu_event_init too.
> Other than that minor remark, I am OK
> Acked-by: Jean Pihet <j-pihet at ti.com>
Thanks,
Will
More information about the linux-arm-kernel
mailing list