From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e9.ny.us.ibm.com (e9.ny.us.ibm.com [32.97.182.139]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e9.ny.us.ibm.com", Issuer "GeoTrust SSL CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 6447A2C0089 for ; Sat, 5 Jan 2013 12:47:46 +1100 (EST) Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 4 Jan 2013 20:47:42 -0500 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 5AC61C9003E for ; Fri, 4 Jan 2013 20:47:40 -0500 (EST) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r051leLI290384 for ; Fri, 4 Jan 2013 20:47:40 -0500 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r051lcSd022282 for ; Fri, 4 Jan 2013 23:47:39 -0200 Date: Fri, 4 Jan 2013 17:47:41 -0800 From: Sukadev Bhattiprolu To: Jiri Olsa Subject: Re: [PATCH 2/5] perf: Make EVENT_ATTR and EVENT_PTR global Message-ID: <20130105014741.GA4438@us.ibm.com> References: <20121219072802.GA30790@us.ibm.com> <20130102145850.GE931@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20130102145850.GE931@krava.brq.redhat.com> Cc: Andi Kleen , Peter Zijlstra , robert.richter@amd.com, Anton Blanchard , linux-kernel@vger.kernel.org, Stephane Eranian , linuxppc-dev@ozlabs.org, Ingo Molnar , Paul Mackerras , Arnaldo Carvalho de Melo List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Jiri Olsa [jolsa@redhat.com] wrote: | On Tue, Dec 18, 2012 at 11:28:02PM -0800, Sukadev Bhattiprolu wrote: | > | > Rename EVENT_ATTR() and EVENT_PTR() PMU_EVENT_ATTR() and PMU_EVENT_PTR(). | > Make them global so they are available to all architectures. | > | > Further to allow architectures flexibility, have PMU_EVENT_PTR() pass in the | > variable name as a parameter. | > | hi, | the change looks ok apart from some nits below. | | There' another version of the x86 event attributes change | I mentioned earlier: | | http://marc.info/?l=linux-kernel&m=135601815224373&w=2 | | I'm not sure which one will make it in first, but you | guys need to sync ;-) CC-ing Andi and Stephane. One change that would help powerpc (and other architectures) is to move the 'struct perf_pmu_events_attr' to say, include/linux/perf_event.h. Each architecture can define EVENT_VAR(), EVENT_PTR() etc as needed. | | thanks, | jirka | | > +struct perf_pmu_events_attr { | > + struct device_attribute attr; | > + u64 id; | > +}; | > + | > +#define PMU_EVENT_PTR(_var) &_var.attr.attr | | this one seems superfluous as well, could be replaced by '&' I guess that would encode the assumption that both the 'attr' fields are the first in their respective structures. If so, an explicit comment beside the fields would be useful. Sukadev From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755493Ab3AEBru (ORCPT ); Fri, 4 Jan 2013 20:47:50 -0500 Received: from e8.ny.us.ibm.com ([32.97.182.138]:44689 "EHLO e8.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755290Ab3AEBrr (ORCPT ); Fri, 4 Jan 2013 20:47:47 -0500 Date: Fri, 4 Jan 2013 17:47:41 -0800 From: Sukadev Bhattiprolu To: Jiri Olsa Cc: Peter Zijlstra , Paul Mackerras , Ingo Molnar , Arnaldo Carvalho de Melo , Anton Blanchard , robert.richter@amd.com, linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org, Stephane Eranian , Andi Kleen Subject: Re: [PATCH 2/5] perf: Make EVENT_ATTR and EVENT_PTR global Message-ID: <20130105014741.GA4438@us.ibm.com> References: <20121219072802.GA30790@us.ibm.com> <20130102145850.GE931@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130102145850.GE931@krava.brq.redhat.com> X-Operating-System: Linux 2.0.32 on an i486 User-Agent: Mutt/1.5.20 (2009-06-14) X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13010501-9360-0000-0000-00000ECA40F4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jiri Olsa [jolsa@redhat.com] wrote: | On Tue, Dec 18, 2012 at 11:28:02PM -0800, Sukadev Bhattiprolu wrote: | > | > Rename EVENT_ATTR() and EVENT_PTR() PMU_EVENT_ATTR() and PMU_EVENT_PTR(). | > Make them global so they are available to all architectures. | > | > Further to allow architectures flexibility, have PMU_EVENT_PTR() pass in the | > variable name as a parameter. | > | hi, | the change looks ok apart from some nits below. | | There' another version of the x86 event attributes change | I mentioned earlier: | | http://marc.info/?l=linux-kernel&m=135601815224373&w=2 | | I'm not sure which one will make it in first, but you | guys need to sync ;-) CC-ing Andi and Stephane. One change that would help powerpc (and other architectures) is to move the 'struct perf_pmu_events_attr' to say, include/linux/perf_event.h. Each architecture can define EVENT_VAR(), EVENT_PTR() etc as needed. | | thanks, | jirka | | > +struct perf_pmu_events_attr { | > + struct device_attribute attr; | > + u64 id; | > +}; | > + | > +#define PMU_EVENT_PTR(_var) &_var.attr.attr | | this one seems superfluous as well, could be replaced by '&' I guess that would encode the assumption that both the 'attr' fields are the first in their respective structures. If so, an explicit comment beside the fields would be useful. Sukadev