From patchwork Thu Dec 3 21:04:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 57681 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp167381lbb; Thu, 3 Dec 2015 13:08:04 -0800 (PST) X-Received: by 10.98.14.207 with SMTP id 76mr16368874pfo.86.1449176884871; Thu, 03 Dec 2015 13:08:04 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id v14si14169788pfi.156.2015.12.03.13.08.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Dec 2015 13:08:04 -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 1a4b5O-0004xM-8g; Thu, 03 Dec 2015 21:06:42 +0000 Received: from mail-ig0-x22e.google.com ([2607:f8b0:4001:c05::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a4b4Y-0004SN-BE for linux-arm-kernel@lists.infradead.org; Thu, 03 Dec 2015 21:06:02 +0000 Received: by igbxm8 with SMTP id xm8so22108490igb.1 for ; Thu, 03 Dec 2015 13:05:28 -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=i00h96S2Trh+P/vL8y3i5EGJ+Wme8lJMpvahetuwcyo=; b=qmeTMK+AV7lXGKo6JJod6R8+rs+MB4ssYq35f4TZZGr5Ih0pl22WUCF6pCbXZ1fl4K FHYndOrs7iEnlNfe6Nzj1Y8oocyavFrY4oXpPCEyu8VxDj/eMDWs0UvQUi/Dd3/KUTB+ DoRR6NPnBMQ6etVEhlaH0BO1vOrle+RNUrjp0RmnUVeIsnN7ImYMVWGp+YhpxQCLD5hx 2ovrCBDm+Nj2VSpdcFZLKwTPUlNIBPLUNZ8vIB8P5hKokKb2DAetML54QrOfZOr4e/hg ny8ckIN+xrywh2rFGXHc3lphGgSEoFDM074Jb9tuIu6iy40+LwiOjhAcfD6EgHUNC6cj eG4g== 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=i00h96S2Trh+P/vL8y3i5EGJ+Wme8lJMpvahetuwcyo=; b=HucJKu/36t+8RH7ef3AJV7fqmhJABnMJbfg/FZR3P/TnkdYRs8syjgzlWdzc33H1Uc cJB1jXwf5qngkhDcLTmzDIZgLfd1c3a/me7Vn9yp9X1FmtcBZMWScYGXFOmU8Er7oJ3X iOylpux2fWJZWHPtyVUdbOmAFFszYEmJggEFcF97EO6YpAO0Kxfysq18E109OdbX+HMx C66Gepakij3iD5MZsQNCvoavTtsoZHtOBvwlZ1W5KqGHYaaMzQ9fC6bSzunguHespOC5 JoO+SlN1oAYMxS1MfEd7f/NQL3RIO+tsJ2oIiO7sMilsVh8bnDOuJozveCsHWoAyiv4U cB7w== X-Gm-Message-State: ALoCoQkuO2C4oGlz+dWCsGQHHw+AkLGwqGwcOyke4spOlXIDtaTRbkB0UjvJZwSwQzLT4uH8NhKvzs1yybha7kTgtjqackM2+Q== X-Received: by 10.50.183.9 with SMTP id ei9mr669005igc.81.1449176728752; Thu, 03 Dec 2015 13:05:28 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [184.64.168.246]) by smtp.gmail.com with ESMTPSA id d81sm3615433ioj.12.2015.12.03.13.05.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Dec 2015 13:05:28 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org, alexander.shishkin@linux.intel.com Subject: [PATCH V6 05/26] coresight: etm3x: implementing 'cpu_id()' API Date: Thu, 3 Dec 2015 14:04:41 -0700 Message-Id: <1449176702-13213-6-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1449176702-13213-1-git-send-email-mathieu.poirier@linaro.org> References: <1449176702-13213-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151203_130550_636438_84A162AA X-CRM114-Status: GOOD ( 14.38 ) 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:4001:c05:0:0:0:22e 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 , 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+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(+) -- 2.1.4 _______________________________________________ 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 b30add73c0ae..9dd88cf8f15c 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; @@ -439,6 +446,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);