From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754887AbcGTPeY (ORCPT ); Wed, 20 Jul 2016 11:34:24 -0400 Received: from foss.arm.com ([217.140.101.70]:42942 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752787AbcGTPeK (ORCPT ); Wed, 20 Jul 2016 11:34:10 -0400 Subject: Re: [PATCH 01/10] coresight: etm-perf: pass struct perf_event to source::enable/disable() To: Mathieu Poirier , linux-arm-kernel@lists.infradead.org References: <1468871491-10997-1-git-send-email-mathieu.poirier@linaro.org> <1468871491-10997-2-git-send-email-mathieu.poirier@linaro.org> Cc: linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com From: Suzuki K Poulose Message-ID: Date: Wed, 20 Jul 2016 16:34:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1468871491-10997-2-git-send-email-mathieu.poirier@linaro.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/07/16 20:51, Mathieu Poirier wrote: > With this commit [1] address range filter information is now found > in the struct hw_perf_event::addr_filters. As such pass the event > itself to the coresight_source::enable/disable() functions so that > both event attribute and filter can be accessible for configuration. > > [1] 'commit 375637bc5249 ("perf/core: Introduce address range filtering")' > diff --git a/include/linux/coresight.h b/include/linux/coresight.h > index 385d62e64abb..2a5982c37dfb 100644 > --- a/include/linux/coresight.h > +++ b/include/linux/coresight.h > @@ -232,8 +232,9 @@ struct coresight_ops_source { > int (*cpu_id)(struct coresight_device *csdev); > int (*trace_id)(struct coresight_device *csdev); > int (*enable)(struct coresight_device *csdev, > - struct perf_event_attr *attr, u32 mode); > - void (*disable)(struct coresight_device *csdev); > + struct perf_event *event, u32 mode); > + void (*disable)(struct coresight_device *csdev, > + struct perf_event *event); nit: Should we make this a a bit more generic API rather than hard coding the perf stuff in there ? i.e, how about : int (*enable)(struct coresight_device *csdev, void *data, u32 mode) void (*disable)(struct coresight_device *csdev, void *data, u32 mode) where data is specific to the mode of operation. That way the API is cleaner and each mode could pass their own data (even though sysfs doesn't use any at the moment). Suzuki