From patchwork Sun Oct 18 18:24:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 55188 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id 09E9D22FFA for ; Sun, 18 Oct 2015 18:26:27 +0000 (UTC) Received: by lbcao8 with SMTP id ao8sf37672869lbc.1 for ; Sun, 18 Oct 2015 11:26:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=uX5NWeRuc0E5X/CsrrZo/z5EaN2AZ5Dw+w+s1M1UhU8=; b=UPwRk/kwPp3/LxahyBYrCktpIdcLKRGn4869DuDhDhZ7/4f0Vl3faCRYfpvMoC0Bes edllVcnL3EQ2DqP/t1Y6V5+FhjqrhZXO3wdMCChJajSgCjtAY7UfJOnh8iVrsI/yGE1h McC8GDwtW9Ukx42mre5LUb18et90i4nolAsvu509H+8TUiBZvkiCB8C2UyG18r7cZdP7 RbAEYd+qxw4lVSukYJVEMqj9u9N5L7f3srszRGMS8w4q3s2/etvUPv96fEB2sE6hCbGq v3uBouPi4d2PEFRZzHNJ0f7i3yxSAvCfe90bT4csWo5bbVnNecGkxbAezKzeYbaXGVW3 dQpg== X-Gm-Message-State: ALoCoQmpT531mjLH36IeZZ8MYmofkXQmPP/wDoUXnjU8iX/86wgLd66nI1uZQvogsTGfPpR7dDjA X-Received: by 10.180.107.167 with SMTP id hd7mr3493895wib.6.1445192785643; Sun, 18 Oct 2015 11:26:25 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.18.90 with SMTP id h87ls528360lfi.9.gmail; Sun, 18 Oct 2015 11:26:25 -0700 (PDT) X-Received: by 10.25.29.20 with SMTP id d20mr8130440lfd.107.1445192785465; Sun, 18 Oct 2015 11:26:25 -0700 (PDT) Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id v9si18079465lby.76.2015.10.18.11.26.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Oct 2015 11:26:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lffz202 with SMTP id z202so15139219lff.3 for ; Sun, 18 Oct 2015 11:26:25 -0700 (PDT) X-Received: by 10.25.28.81 with SMTP id c78mr8282860lfc.29.1445192785323; Sun, 18 Oct 2015 11:26:25 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1078024lbq; Sun, 18 Oct 2015 11:26:24 -0700 (PDT) X-Received: by 10.66.219.227 with SMTP id pr3mr30087418pac.33.1445192783450; Sun, 18 Oct 2015 11:26:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yj10si46408823pab.237.2015.10.18.11.26.23; Sun, 18 Oct 2015 11:26:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752408AbbJRS0A (ORCPT + 28 others); 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 Received: by pasz6 with SMTP id z6so6765929pas.2 for ; Sun, 18 Oct 2015 11:25:56 -0700 (PDT) X-Received: by 10.66.254.101 with SMTP id ah5mr29665661pad.10.1445192756893; Sun, 18 Oct 2015 11:25:56 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [184.64.168.246]) by smtp.gmail.com with ESMTPSA id hq1sm20402076pbb.43.2015.10.18.11.25.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Oct 2015 11:25:56 -0700 (PDT) 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 Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mathieu.poirier@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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);