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: 57401 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1179211lbb; Sun, 29 Nov 2015 18:16:26 -0800 (PST) X-Received: by 10.67.30.227 with SMTP id kh3mr85966383pad.69.1448849786172; Sun, 29 Nov 2015 18:16:26 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s8si253550pfa.140.2015.11.29.18.16.25; Sun, 29 Nov 2015 18:16:26 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753011AbbK3CQY (ORCPT + 28 others); Sun, 29 Nov 2015 21:16:24 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:33230 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752931AbbK3CQT (ORCPT ); Sun, 29 Nov 2015 21:16:19 -0500 Received: by pabfh17 with SMTP id fh17so173094203pab.0 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=ONPNyu1YcE6UPC/38dW+phXv45ACyOPBfuCzwbMhY/qQ950U1eIvub46ZePv1KXjql h6g2P2ILoBplwq5uPzM6O6i1g5cCeeLudgIDYxPqiYMQx9SG/jJ4eXpswHN9e2VSWPVh N9U4m4Ipc1J5lfMiBB1vFc2UsNly4d6HMeJMOnyAOrh9YhEIjQn1xBays7CXaoeQCZQn rPrQ37tone+QKr6D1plfTrnb0mEtZQL6Ow4K54nsl9PuaBjEorSpY9fGK3RnoaPamTx4 If5FQlHQqz/BLFdZt2DD5PCcJ0MXPMDlQKktRVm+P3vABADMeAFy/sX12Y99bqu+fjyP CPXQ== X-Gm-Message-State: ALoCoQk61/LfDC/gAUlfcvahXtnUvJr40PKsfsxjPlW1W0kK9RWMluAry0kIlRcUzdKweUP9rvEH 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 Cc: zhang.chunyan@linaro.org, mike.leach@arm.com, tor@ti.com, al.grant@arm.com, pawel.moll@arm.com, fainelli@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Mathieu Poirier 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ 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);