From patchwork Mon Nov 30 02:14:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 7720191 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7768DBEEE1 for ; Mon, 30 Nov 2015 02:19:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 94FF220524 for ; Mon, 30 Nov 2015 02:19:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 95ECB2051D for ; Mon, 30 Nov 2015 02:19:26 +0000 (UTC) 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 1a3E1u-0005tS-0A; Mon, 30 Nov 2015 02:17:26 +0000 Received: from mail-pa0-x236.google.com ([2607:f8b0:400e:c03::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a3E19-0005Lm-Bp for linux-arm-kernel@lists.infradead.org; Mon, 30 Nov 2015 02:16:42 +0000 Received: by padhx2 with SMTP id hx2so168009963pad.1 for ; Sun, 29 Nov 2015 18:16:18 -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=HR8eLAR3PRMcLAgYaRtjG1nCRlsy519WXN95Qp1O+Ug=; b=MxjeU6W/QBRFcuwn4iqi3wOWIx+VBS+1SNiUBgVEUdXIJhQrtsRpHEgLzSaEhIoODe t7lw48twXl3GAtDUAYEYf5levu3F9jFWwaVToGxvle1sDs8BCNri6i/FkCQ8aVDQFbBw NoReBdfUCY309S7ebYkeJOJdnxzfe5jgNo/PVIG7zimt2wsTk/+C5rkTGecPZLfB+Lub 59dHhoATzYZEGUHU0et2GXrC33+yDwbsPXxRPJCVmizfmZJaWJKLmtKENH4oMYiT1apu wU75QwwnyLkyDuoWplEMhLOK8epYyi4VQyIaGqyuco/v5Lfbl7HX5/vGn0uKC4L8VK9o rbLg== 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=HR8eLAR3PRMcLAgYaRtjG1nCRlsy519WXN95Qp1O+Ug=; b=cR6y9LZtLCb0suEoGDhoLM9ZSRFrlq0qlZB1tIO5btme8nVf4iNJqFy7jHhtIRxTbe wxJpFb67SCc5HoUbdDOKK2gcyNUwXhwQjkBmZxTB1KuvP1n+mWM/LhwNd5sulKNddwLe HC0VrNpxnrdDuRe3emkdRb4YNNN8qOrgERrO2sETdZwkTqz9V8WHNG7FLEL7U7a6Da22 +JiKCDaIMPcOW6AASswv8zJ3sFFDBO+LLRgAcZbTOSo1uXslW7YyPRNxysiTx8Yf2t5v AXroJP7SLppbRCA6YGXsEd+fSeUaczCKnSGocaVpriyiSyc/a5mCDFM+BK6xuixv4il7 Xl5g== X-Gm-Message-State: ALoCoQk7pMm5B4a3lw6TP2ouh3A9vauUQTMp/4X7v7S4iQeS3Cpn9aaHX4m1bLFrXSX+29wQ70dd X-Received: by 10.98.66.152 with SMTP id h24mr67766563pfd.52.1448849778371; Sun, 29 Nov 2015 18:16:18 -0800 (PST) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id n16sm47168818pfa.53.2015.11.29.18.16.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 29 Nov 2015 18:16:17 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org, alexander.shishkin@linux.intel.com Subject: [PATCH V5 05/26] coresight: etm3x: implementing 'cpu_id()' API Date: Sun, 29 Nov 2015 19:14:26 -0700 Message-Id: <1448849687-5724-6-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1448849687-5724-1-git-send-email-mathieu.poirier@linaro.org> References: <1448849687-5724-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151129_181639_930031_EFEB1CAB X-CRM114-Status: GOOD ( 14.05 ) X-Spam-Score: -2.6 (--) 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 , pawel.moll@arm.com, linux-doc@vger.kernel.org, fainelli@broadcom.com, linux-kernel@vger.kernel.org, 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c index 3491c46d695a..9ee692a5c482 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);