From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752406AbbJRS0A (ORCPT ); Sun, 18 Oct 2015 14:26:00 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:35568 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752255AbbJRSZ5 (ORCPT ); Sun, 18 Oct 2015 14:25:57 -0400 From: Mathieu Poirier To: gregkh@linuxfoundation.org, a.p.zijlstra@chello.nl, alexander.shishkin@linux.intel.com, acme@kernel.org, mingo@redhat.com, corbet@lwn.net, nicolas.pitre@linaro.org Cc: adrian.hunter@intel.com, zhang.chunyan@linaro.org, mike.leach@arm.com, tor@ti.com, al.grant@arm.com, pawel.moll@arm.com, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org Subject: [PATCH V2 14/30] coresight: etm3x: implementing perf_start/stop() API Date: Sun, 18 Oct 2015 12:24:31 -0600 Message-Id: <1445192687-24112-15-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445192687-24112-1-git-send-email-mathieu.poirier@linaro.org> References: <1445192687-24112-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding an API to deal with runtime PM (and anything else) that might be required by a tracer before and after it is to be used by the Perf framework. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm3x.c | 12 ++++++++++++ include/linux/coresight.h | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c index f565554744fe..9b4c0359ca29 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x.c +++ b/drivers/hwtracing/coresight/coresight-etm3x.c @@ -459,6 +459,16 @@ static int etm_trace_id(struct coresight_device *csdev) return etm_get_trace_id(drvdata); } +static int perf_etm_start(struct coresight_device *csdev) +{ + return pm_runtime_get_sync(csdev->dev.parent); +} + +static int perf_etm_stop(struct coresight_device *csdev) +{ + return pm_runtime_put(csdev->dev.parent); +} + static void *perf_etm_get_config(struct coresight_device *csdev, struct perf_event *event) { @@ -625,6 +635,8 @@ static void sysfs_etm_disable(struct coresight_device *csdev) static const struct coresight_ops_source etm_source_ops = { .cpu_id = etm_cpu_id, .trace_id = etm_trace_id, + .perf_start = perf_etm_start, + .perf_stop = perf_etm_stop, .perf_get_config = perf_etm_get_config, .perf_set_config = perf_etm_set_config, .perf_enable = perf_etm_enable, diff --git a/include/linux/coresight.h b/include/linux/coresight.h index b853d722346b..0601da01eeb2 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -209,6 +209,9 @@ struct coresight_ops_link { * is associated to. * @trace_id: returns the value of the component's trace ID as known to the HW. + * @perf_start: operations to be done before a tracer can be used. + * @perf_stop: operations to be done when a tracer is + * no longer needed. * @perf_get_config: builds the ETM configuration after event' specifics. * @perf_set_config: associate a tracer with a configuration.. * @perf_enable: enables tracing for a source, from Perf. @@ -219,6 +222,8 @@ struct coresight_ops_link { struct coresight_ops_source { int (*cpu_id)(struct coresight_device *csdev); int (*trace_id)(struct coresight_device *csdev); + int (*perf_start)(struct coresight_device *csdev); + int (*perf_stop)(struct coresight_device *csdev); void *(*perf_get_config)(struct coresight_device *csdev, struct perf_event *event); void (*perf_set_config)(struct coresight_device *csdev, void *config); -- 1.9.1