From patchwork Sun Oct 18 18:24:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 7431681 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 8BADEBEEA4 for ; Sun, 18 Oct 2015 18:27:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 909ED2061B for ; Sun, 18 Oct 2015 18:27:55 +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 95117204E7 for ; Sun, 18 Oct 2015 18:27:54 +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 1Znsf0-00053i-RP; Sun, 18 Oct 2015 18:26:22 +0000 Received: from mail-pa0-f54.google.com ([209.85.220.54]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Znsea-0004ko-3q for linux-arm-kernel@lists.infradead.org; Sun, 18 Oct 2015 18:25:57 +0000 Received: by padhk11 with SMTP id hk11so6277050pad.1 for ; Sun, 18 Oct 2015 11:25:39 -0700 (PDT) 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=JzzOasd4gxe7ua0kkk3+1HAZ8+3e91zmsOo9pWZ03DY=; b=KuQm+TEjTsY3q3m3s9WvnNKeMbXnLS55/xYkvkq4lKK1fTpE20susGWoaB61TkOzNR zJybly/mTcZ5L3IAWr1IhsBaOMA0A4iucHY5CExCSBCL3CY0rILScC+H/89iu/ZoYZlb /viJ5zPzX2WLO8Y1F2isHQPsKka547QzuZ1Ukkdf1A25qnMQ1NAYTiv89xzxmrFv0/X4 KHpe+EGr6w95cMDi4/R2gfZMMbvnHl0b5U4uExNkGRlXovdR2cRXMViwMZ1Tb3vzpAKC m/LyaQmF/oBVczpRyFHmEls1daGtkhqdXJp4563RbSGuyb1I4kFsDd1uBFh58ctRnRu4 Z6wA== X-Gm-Message-State: ALoCoQmz7ptv25S9gyYKCFKVqQQGDR9NyLJ1mG4gNhe6c7ZrikB3pd0VNcM8P0ht8HEkY+TRltZY X-Received: by 10.68.103.2 with SMTP id fs2mr3918175pbb.123.1445192739062; Sun, 18 Oct 2015 11:25:39 -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.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Oct 2015 11:25:38 -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 06/30] coresight: clearly labeling source operarions Date: Sun, 18 Oct 2015 12:24:23 -0600 Message-Id: <1445192687-24112-7-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_112556_313322_BEE484FD X-CRM114-Status: GOOD ( 15.01 ) 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@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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 When integrating coresight with Perf, it is important to clearly identify which operations are used by sysFS and which ones by Perf. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm3x.c | 8 ++++---- drivers/hwtracing/coresight/coresight-etm4x.c | 8 ++++---- drivers/hwtracing/coresight/coresight.c | 8 ++++---- include/linux/coresight.h | 12 ++++++------ 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c index 713ffe1b761f..3d7fa0b2acf9 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x.c +++ b/drivers/hwtracing/coresight/coresight-etm3x.c @@ -346,7 +346,7 @@ static int etm_trace_id(struct coresight_device *csdev) return etm_get_trace_id(drvdata); } -static int etm_enable(struct coresight_device *csdev) +static int sysfs_etm_enable(struct coresight_device *csdev) { struct etm_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); int ret; @@ -407,7 +407,7 @@ static void etm_disable_hw(void *info) dev_dbg(drvdata->dev, "cpu: %d disable smp call done\n", drvdata->cpu); } -static void etm_disable(struct coresight_device *csdev) +static void sysfs_etm_disable(struct coresight_device *csdev) { struct etm_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); @@ -436,8 +436,8 @@ static void etm_disable(struct coresight_device *csdev) static const struct coresight_ops_source etm_source_ops = { .trace_id = etm_trace_id, - .enable = etm_enable, - .disable = etm_disable, + .sysfs_enable = sysfs_etm_enable, + .sysfs_disable = sysfs_etm_disable, }; static const struct coresight_ops etm_cs_ops = { diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 254a81a4e6f4..0808cc5a51a0 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -180,7 +180,7 @@ static void etm4_enable_hw(void *info) dev_dbg(drvdata->dev, "cpu: %d enable smp call done\n", drvdata->cpu); } -static int etm4_enable(struct coresight_device *csdev) +static int sysfs_etm4_enable(struct coresight_device *csdev) { struct etmv4_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); int ret; @@ -231,7 +231,7 @@ static void etm4_disable_hw(void *info) dev_dbg(drvdata->dev, "cpu: %d disable smp call done\n", drvdata->cpu); } -static void etm4_disable(struct coresight_device *csdev) +static void sysfs_etm4_disable(struct coresight_device *csdev) { struct etmv4_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); @@ -261,8 +261,8 @@ static void etm4_disable(struct coresight_device *csdev) static const struct coresight_ops_source etm4_source_ops = { .trace_id = etm4_trace_id, - .enable = etm4_enable, - .disable = etm4_disable, + .sysfs_enable = sysfs_etm4_enable, + .sysfs_disable = sysfs_etm4_disable, }; static const struct coresight_ops etm4_cs_ops = { diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c index a3dcafb81700..d318a338a517 100644 --- a/drivers/hwtracing/coresight/coresight.c +++ b/drivers/hwtracing/coresight/coresight.c @@ -212,8 +212,8 @@ static int coresight_enable_source(struct coresight_device *csdev) } if (!csdev->enable) { - if (source_ops(csdev)->enable) { - ret = source_ops(csdev)->enable(csdev); + if (source_ops(csdev)->sysfs_enable) { + ret = source_ops(csdev)->sysfs_enable(csdev); if (ret) return ret; } @@ -228,8 +228,8 @@ static int coresight_enable_source(struct coresight_device *csdev) static void coresight_disable_source(struct coresight_device *csdev) { if (atomic_dec_return(csdev->refcnt) == 0) { - if (source_ops(csdev)->disable) { - source_ops(csdev)->disable(csdev); + if (source_ops(csdev)->sysfs_disable) { + source_ops(csdev)->sysfs_disable(csdev); csdev->enable = false; } } diff --git a/include/linux/coresight.h b/include/linux/coresight.h index a7cabfa23b55..97155527dbdd 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -205,15 +205,15 @@ struct coresight_ops_link { /** * struct coresight_ops_source - basic operations for a source * Operations available for sources. - * @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. + * @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 (*trace_id)(struct coresight_device *csdev); - int (*enable)(struct coresight_device *csdev); - void (*disable)(struct coresight_device *csdev); + int (*sysfs_enable)(struct coresight_device *csdev); + void (*sysfs_disable)(struct coresight_device *csdev); }; struct coresight_ops {