Re: [PATCHv2] arm: perf: Add event descriptions

From: Will Deacon
Date: Tue Oct 13 2015 - 10:15:58 EST


On Mon, Oct 12, 2015 at 11:10:38AM -0700, Drew Richardson wrote:
> On Mon, Oct 12, 2015 at 03:30:25PM +0100, Will Deacon wrote:
> > I think this looks much better, thanks. The only thing left to do is
> > re-use some of the existing event descriptions from the enum
> > armv7_perf_types that we have at the top of the file, rather than
> > duplicate the event -> ID mapping. Feel free to extend the enumeration
> > if you need to (it's intended to cover all of the architected events).
>
> OK, here you go. I agree that duplicating the event -> ID mapping is
> undesirable, but some rather ugly preprocessor stuff is required to
> convert the enum into it's hex value (is there a better way to do
> this?). I think it may be less ugly if we build the string at runtime
> instead of at compile time (ie, going back to using PMU_EVENT_ATTR
> instead of PMU_EVENT_ATTR_STRING).

Yeah, I see what you mean. However, I don't think we actually need these
as an enum, do we? So maybe just replace the whole lot with a bunch of
#defines (mechanical change since they're already namespaced, separate
patch before this one) and then have this patch use those #defines for
the sysfs stuff.

Sorry for the to-and-fro-ing on this.

Will
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/