From patchwork Wed Nov 11 22:17:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 56405 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp76011lbb; Wed, 11 Nov 2015 14:22:42 -0800 (PST) X-Received: by 10.66.228.3 with SMTP id se3mr17674328pac.75.1447280562281; Wed, 11 Nov 2015 14:22:42 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id bg5si15248464pbb.218.2015.11.11.14.22.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Nov 2015 14:22:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zwdl7-0007vt-MJ; Wed, 11 Nov 2015 22:20:53 +0000 Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zwdk3-000606-FV for linux-arm-kernel@lists.infradead.org; Wed, 11 Nov 2015 22:20:02 +0000 Received: by padhx2 with SMTP id hx2so42979520pad.1 for ; Wed, 11 Nov 2015 14:19:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mJtCMODWSwgWbfJDn5XBAFGusvbTAom1iFHE/nOf6B0=; b=X7RK98N7TBsE1XmuGPH1ZPjy/XYbq0yedDVA3uJ7D3324lLXrkXWqlfaDd3Clut823 bNnDlkmSbhbnQjumQTVoqfx2VM1R/pHnF2NX2AMHqb9laxh2kPTFBn3KLBGBXHzBYiee iLz3RhNgRmCqx7RrdAu2q/uIsTMi21rV+XGV6Cmln2vW/FHT3fICGYLNlu+9lYSo1/PP 1RY/sZphUaEIczdCunxifW8mrZL+8h4zpB94CItt3V8Sd3dtLCB5V3DyXqlejbXlTyuS dhMFRVy6nV34GB7e0meqeaEyes1ilE22q93gh0Yvw7nadFSlKvPf6ftO+YNoR33AXPKE GGvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mJtCMODWSwgWbfJDn5XBAFGusvbTAom1iFHE/nOf6B0=; b=cuTwbs8ajXtCUZcjRmpS0jBAWgzj/mSq3/dmAMPVe32bxZaYwGTKfZuOo3sOn2L+ly zUPsaNZxzHLk+uzaOXf4qsHvYY5sPeFvp/R0p4IEo9rEgiPXUo6NgQvdc/KtUiPEfydR 2KSwgROJ/cP82M16WceCU6gN910gVX9OSH4xJZmjvUtw4kY9el+T2GWgIg+u6Mrv8Kxd XjoZmy52ir13TMRsgCE9GvuOo4ndwK5jU3YWbVJD2W4b4nuwKfGmxZPy6ZohEUf9TzFw glwRqd2T153+14nZm5aAjIWrf56u7M0ZzCeLB6HqLQvgw+Xm1fj419pR5zCuPMOcYGVG srJA== X-Gm-Message-State: ALoCoQm4Pyy28F/an1o0kGFeMUbYXo/iS3LKxmBl65H6VVKaH3J4XKeQdXEp5nn/TktXBM882qB8 X-Received: by 10.68.204.39 with SMTP id kv7mr17903645pbc.165.1447280366993; Wed, 11 Nov 2015 14:19:26 -0800 (PST) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id h10sm11156697pat.7.2015.11.11.14.19.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Nov 2015 14:19:26 -0800 (PST) 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 Subject: [PATCH V3 05/26] coresight: etm3x: implementing 'cpu_id()' API Date: Wed, 11 Nov 2015 15:17:55 -0700 Message-Id: <1447280296-19147-6-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447280296-19147-1-git-send-email-mathieu.poirier@linaro.org> References: <1447280296-19147-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151111_141947_715679_C405D943 X-CRM114-Status: GOOD ( 14.51 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c03:0:0:0:235 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: al.grant@arm.com, mathieu.poirier@linaro.org, pawel.moll@arm.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, fainelli@broadcom.com, adrian.hunter@intel.com, tor@ti.com, mike.leach@arm.com, zhang.chunyan@linaro.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Other than plainly parsing the device tree there is no way to know which CPU a tracer is affined to. As such adding an interface to lookup the CPU field enclosed in the etm_drvdata structure that was initialised at boot time. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm3x.c | 8 ++++++++ include/linux/coresight.h | 3 +++ 2 files changed, 11 insertions(+) -- 1.9.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c index 67af548a874d..74526f044a06 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x.c +++ b/drivers/hwtracing/coresight/coresight-etm3x.c @@ -312,6 +312,13 @@ static void etm_enable_hw(void *info) dev_dbg(drvdata->dev, "cpu: %d enable smp call done\n", drvdata->cpu); } +static int etm_cpu_id(struct coresight_device *csdev) +{ + struct etm_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); + + return drvdata->cpu; +} + int etm_get_trace_id(struct etm_drvdata *drvdata) { unsigned long flags; @@ -438,6 +445,7 @@ static void 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, .enable = etm_enable, .disable = etm_disable, diff --git a/include/linux/coresight.h b/include/linux/coresight.h index a7cabfa23b55..bf62b265bf52 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -205,12 +205,15 @@ struct coresight_ops_link { /** * struct coresight_ops_source - basic operations for a source * Operations available for sources. + * @cpu_id: returns the value of the CPU number this component + * is associated to. * @trace_id: returns the value of the component's trace ID as known to the HW. * @enable: enables tracing for a source. * @disable: disables tracing for a source. */ struct coresight_ops_source { + int (*cpu_id)(struct coresight_device *csdev); int (*trace_id)(struct coresight_device *csdev); int (*enable)(struct coresight_device *csdev); void (*disable)(struct coresight_device *csdev);