From patchwork Sun Oct 18 18:24:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 55203 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lf0-f69.google.com (mail-lf0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id D38D722FFA for ; Sun, 18 Oct 2015 18:28:24 +0000 (UTC) Received: by lfaz124 with SMTP id z124sf32585962lfa.0 for ; Sun, 18 Oct 2015 11:28:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:cc:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=VYgj3Dv+lIwG0RgFDYAlUsZZSjA9AMjfYhss4Rd3ebc=; b=Rb8A0Gp9qokVNlWErKE9It6vhZxqho3TUof7ZmC4APF5pAIpvb867Js7NLZN+9uZmj QttzfYe2aUBoyaKEIG5c1QAsDAMQ0dGujAQxlsb23OzuW2Ba6arQBTbA+nM9Sdki0oAo jWPuc3GbRDws5XLEPHTGjDZtxnqQ54jErpnGVGH5rGN2sEe2NC9oHwlJp1gZuMQRTJf4 bBYowMH3HOqaVrktWiS6ScO50uC5+GV7RgGdhDQGFywNF2Fr4CntT17vewWuJXvg2kuk KDa0mPyfWLMk89IAHQmNq9f1SMpsgXsTcGTQIbQK9UCcnmpDMZQ4x7rP7RMpwW5CZlvs n3wA== X-Gm-Message-State: ALoCoQlg3XRRU9cbKXpLcUJJIxAnRq7gWAm/URa8QB4kge6EtG4uoXzSg2ksuHWH5yURIVJ2sido X-Received: by 10.194.71.166 with SMTP id w6mr30435wju.6.1445192903587; Sun, 18 Oct 2015 11:28:23 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.209.80 with SMTP id i77ls517569lfg.0.gmail; Sun, 18 Oct 2015 11:28:23 -0700 (PDT) X-Received: by 10.25.87.9 with SMTP id l9mr6374424lfb.99.1445192903295; Sun, 18 Oct 2015 11:28:23 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id gn4si1918520lbc.173.2015.10.18.11.28.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Oct 2015 11:28:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbbes7 with SMTP id es7so38259317lbb.2 for ; Sun, 18 Oct 2015 11:28:23 -0700 (PDT) X-Received: by 10.112.64.72 with SMTP id m8mr12324337lbs.41.1445192903047; Sun, 18 Oct 2015 11:28:23 -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 w3csp1078510lbq; Sun, 18 Oct 2015 11:28:21 -0700 (PDT) X-Received: by 10.66.145.97 with SMTP id st1mr29334447pab.145.1445192901835; Sun, 18 Oct 2015 11:28:21 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id tp2si46483489pbc.123.2015.10.18.11.28.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Oct 2015 11:28:21 -0700 (PDT) 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; 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 1Znsg0-00068p-5b; Sun, 18 Oct 2015 18:27:24 +0000 Received: from mail-pa0-f47.google.com ([209.85.220.47]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Znseh-0004ln-4c for linux-arm-kernel@lists.infradead.org; Sun, 18 Oct 2015 18:26:04 +0000 Received: by pacfv9 with SMTP id fv9so70830277pac.3 for ; Sun, 18 Oct 2015 11:25:42 -0700 (PDT) X-Received: by 10.68.110.165 with SMTP id ib5mr29625752pbb.58.1445192742393; Sun, 18 Oct 2015 11:25:42 -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.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Oct 2015 11:25:41 -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 Subject: [PATCH V2 08/30] coresight: etm3x: implementing 'cpu_id()' API Date: Sun, 18 Oct 2015 12:24:25 -0600 Message-Id: <1445192687-24112-9-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151018_112603_312507_90619610 X-CRM114-Status: GOOD ( 13.04 ) 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 [209.85.220.47 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.220.47 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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, 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 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.217.169 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 Adding an interface to lookup the CPU a tracer has been affined to along with a source operation allowing external customers to access it. 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 3fe6433764d4..e199746bba05 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; @@ -444,6 +451,7 @@ 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, .sysfs_enable = sysfs_etm_enable, .sysfs_disable = sysfs_etm_disable, diff --git a/include/linux/coresight.h b/include/linux/coresight.h index 97155527dbdd..f9210df15f03 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. * @sysfs_enable: enables tracing for a source, from sysFS. * @sysfs_disable: disables tracing for a source, from sysFS. */ struct coresight_ops_source { + int (*cpu_id)(struct coresight_device *csdev); int (*trace_id)(struct coresight_device *csdev); int (*sysfs_enable)(struct coresight_device *csdev); void (*sysfs_disable)(struct coresight_device *csdev);