From patchwork Fri Dec 18 20:58:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 58731 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp1267434lbb; Fri, 18 Dec 2015 12:59:51 -0800 (PST) X-Received: by 10.98.74.199 with SMTP id c68mr8325176pfj.100.1450472391509; Fri, 18 Dec 2015 12:59:51 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fk7si26084456pab.219.2015.12.18.12.59.51; Fri, 18 Dec 2015 12:59:51 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965246AbbLRU7o (ORCPT + 29 others); Fri, 18 Dec 2015 15:59:44 -0500 Received: from mail-io0-f170.google.com ([209.85.223.170]:36453 "EHLO mail-io0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965191AbbLRU7i (ORCPT ); Fri, 18 Dec 2015 15:59:38 -0500 Received: by mail-io0-f170.google.com with SMTP id o67so102236509iof.3 for ; Fri, 18 Dec 2015 12:59:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/isnBlVEol/+kTt/feYApNIO4DnfpDkep4y6MQDGLjU=; b=atOdGNJMsK7CleI4k5Jali0l0wGod8UmTNkbtcjU/uF1mVCNQqI1XbWXzVMQ8I0EAN LeymtlCtoqJYK0iMLrJRXJYukEXLW3AxPVPz83sN/olq0egnWoFmMPxPMkp9tx2zsyp6 cMPmgftNONj4PFp/hSavkCMO6d98xxnoK63jE= 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=/isnBlVEol/+kTt/feYApNIO4DnfpDkep4y6MQDGLjU=; b=YtRHhL/v7xj0/uec66QB8miIJLUMKoq6imvlKrTYhPjwajWVdDJ5DGe5Y0erm4oEd4 eZLz6U0uPGEnY44v1u/hjkc87rOjHFcp911pyiN+RBBsKB7BszPWb2QBYBYVp29imLnA l1ESXAPDYLK8bgFurCjakcJ8vvhWtCaQ+vsk9zlL2/6yjdPwmIJsXHipXqViZA8+BDGM Qc/5k/JxpvLERelUM7/MEKebcPm9ijMmGf4fugpeTKI1g/3sI2Od3MSImS84CTcX13Dc Uz+6ABj47y7GMJlpdiJ9NoOd9xxU4pNuf4wMW46rDCEugSk8E2Mv8hrUV0DArXGr0u+U zuzQ== X-Gm-Message-State: ALoCoQlTgimo6lYetEYVUxllnZzXuhsuP9dVyQsUkq/cPN1r+CGgnzyWQqNXyyIkl3u064fFi0swVt6cISOcgk4n9nTc54uBJA== X-Received: by 10.107.166.79 with SMTP id p76mr6618891ioe.117.1450472377473; Fri, 18 Dec 2015 12:59:37 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [184.64.168.246]) by smtp.gmail.com with ESMTPSA id l10sm843701igx.18.2015.12.18.12.59.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Dec 2015 12:59:37 -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, fainelli@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Mathieu Poirier Subject: [PATCH V7 01/24] coresight: implementing 'cpu_id()' API Date: Fri, 18 Dec 2015 13:58:57 -0700 Message-Id: <1450472361-426-2-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1450472361-426-1-git-send-email-mathieu.poirier@linaro.org> References: <1450472361-426-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 d630b7ece735..755f6f4d6d79 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x.c +++ b/drivers/hwtracing/coresight/coresight-etm3x.c @@ -315,6 +315,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; +} + static int etm_trace_id(struct coresight_device *csdev) { struct etm_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); @@ -421,6 +428,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);