From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932386AbbJMOP4 (ORCPT ); Tue, 13 Oct 2015 10:15:56 -0400 Received: from foss.arm.com ([217.140.101.70]:53246 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932190AbbJMOPw (ORCPT ); Tue, 13 Oct 2015 10:15:52 -0400 Date: Tue, 13 Oct 2015 15:15:52 +0100 From: Will Deacon To: Drew Richardson Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Russell King , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Wade Cherry , Pawel Moll Subject: Re: [PATCHv2] arm: perf: Add event descriptions Message-ID: <20151013141551.GK21550@arm.com> References: <20151007182735.GA18706@dreric01-gentoo.localdomain> <20151009101338.GH26278@arm.com> <20151009165330.GA22415@dreric01-gentoo.localdomain> <20151012143025.GG16124@arm.com> <20151012181037.GA16013@dreric01-gentoo.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151012181037.GA16013@dreric01-gentoo.localdomain> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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