From patchwork Thu May 31 16:21:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kim Phillips X-Patchwork-Id: 10441355 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 54E4F602BC for ; Thu, 31 May 2018 16:22:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DBF028FAB for ; Thu, 31 May 2018 16:22:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 246D228F7A; Thu, 31 May 2018 16:22:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C4A23291A8 for ; Thu, 31 May 2018 16:21:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To: Message-Id:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=65AtmNxJLBOVp3TWuGd5GLISGPgInQ3QwZwwu4yAp2E=; b=NadNLWTTj74ZHH 92UKtMY0aDIGtGcZTPievm2D556Y8WmNriCbQ6zwf3bM5Hzs8GCxGOgnDNQqAhHo7CzhH1Cje2MId O7JPcEfG/pHgwpJvhHNBGqllmYUVlN6MqHWspcAc3dVrYvAucb2tQVuWauYX/fRZuJa3pjmX3INHb vaMgWCFpvVcIgBAxKF1Sf1i0I+1qYU7n7Mb6C7OD3ubfM1IWrTM3JqhZ5HbuHj+u8XSbgN5SflmWV Xb0eonXl4Wz1WQLH/uq+7qcOsTptix0ZsYjcoWpG/0TuhYEAT0lTJBNDnAWfsN4uqY1m8JnZflD+S HUENWqX8pUoxYiXfHrjw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOQKQ-0000AA-Qt; Thu, 31 May 2018 16:21:30 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOQKM-00009M-Tj for linux-arm-kernel@bombadil.infradead.org; Thu, 31 May 2018 16:21:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: Mime-Version:References:In-Reply-To:Message-Id:Subject:Cc:To:From:Date:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=YeoK5Vft6ZZ473KZR8ZsXQLCX7yh1mwCdPG5iXCOnFA=; b=zldS2+PtTohSMH5E0A9oRwyeNO fMXlYXvpg3ehEziicky4+9+qAFB3LAZG08l6l9kS5kfSnnCkiQxCwl8DPoTdqPzIqzFii90hJjg47 oIdjDnUBBeksqsHBRreHn6nCyPkdebSCTLTIDucjxTAY7Sj7ZfGbClCg3en1wftBohIykb0MsFu1d jwCvodFZ9hHm1lGzaZu6sjqmRNHKWRZ/4sXFksgJ+2WYEqrSSVnEpRdUw/aR7nB2Y9mYsH5X2RuRF SdtTw10RCh8UR4SgdfRHvKpIeFXWjXmkCgcYPx1GdtKLiOfVjYS0kGGJYKXTi3OmBnFiBchdFs7is UJK9IwuQ==; Received: from foss.arm.com ([217.140.101.70]) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOQKJ-0007Gn-LL for linux-arm-kernel@lists.infradead.org; Thu, 31 May 2018 16:21:24 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7A4001596; Thu, 31 May 2018 09:21:11 -0700 (PDT) Received: from dupont (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 121453F53D; Thu, 31 May 2018 09:21:11 -0700 (PDT) Date: Thu, 31 May 2018 11:21:10 -0500 From: Kim Phillips To: Jonathan Corbet Subject: [PATCH v4] coresight: documentation: update sysfs section Message-Id: <20180531112110.5769511ef6e379df24820158@arm.com> In-Reply-To: <20180516152458.d392b0d1e09393da30e2aeb6@arm.com> References: <20180507172915.c032cd71c07b1849bf419a5f@arm.com> <20180514121959.a9a3d2fb3d3d270849ffbc39@arm.com> <20180516131823.4b1a3ecb@lwn.net> <20180516152458.d392b0d1e09393da30e2aeb6@arm.com> Organization: Arm X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180531_122123_838453_F7A10D1D X-CRM114-Status: GOOD ( 13.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Randy Dunlap , linux-arm-kernel , Mathieu Poirier , "open list:DOCUMENTATION" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP - Align and show updated ls devices output from the TC2, based on current driver - Provide an example from an ETMv4 based system (Juno) - Reflect changes to the way the RAM write pointer is accessed since it got changed in commit 7d83d17795ef ("coresight: tmc: adding sysFS management entries"). Cc: Jonathan Corbet Acked-by: Mathieu Poirier Acked-by: Randy Dunlap Signed-off-by: Kim Phillips --- v4: v3 + Randy and Mathieu's acked-bys, for Jonathan to apply. v3: address Randy Dunlap's showns->shown, corrected - and + line merging v2: address Mathieu's comment about clarifying the sinks on the Juno vs. TC2 platforms. Documentation/trace/coresight.txt | 43 +++++++++++++++++++------------ 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/Documentation/trace/coresight.txt b/Documentation/trace/coresight.txt index 6f0120c3a4f1..15d2a0f1e1b8 100644 --- a/Documentation/trace/coresight.txt +++ b/Documentation/trace/coresight.txt @@ -141,13 +141,25 @@ register the device with the core framework. The unregister function takes a reference to a "struct coresight_device", obtained at registration time. If everything goes well during the registration process the new devices will -show up under /sys/bus/coresight/devices, as showns here for a TC2 platform: +show up under /sys/bus/coresight/devices, as shown here for a TC2 platform: root:~# ls /sys/bus/coresight/devices/ -replicator 20030000.tpiu 2201c000.ptm 2203c000.etm 2203e000.etm -20010000.etb 20040000.funnel 2201d000.ptm 2203d000.etm +20010000.etb 20040000.funnel 2201d000.ptm 2203d000.etm replicator +20030000.tpiu 2201c000.ptm 2203c000.etm 2203e000.etm root:~# +and here for a Juno platform: + +root@juno:~# ls /sys/bus/coresight/devices/ +20010000.etf 20120000.replicator 22040000.etm 230c0000.funnel +20030000.tpiu 20130000.funnel 220c0000.funnel 23140000.etm +20040000.funnel 20140000.etf 22140000.etm 23240000.etm +20070000.etr 20150000.funnel 23040000.etm 23340000.etm +root@juno:~# + +Note that on Juno users can select the ETF, ETR and TPIU as a sink target while +on TC2, the ETB and TPIU can be selected. + The functions take a "struct coresight_device", which looks like this: struct coresight_desc { @@ -193,16 +205,16 @@ the information carried in "THIS_MODULE". How to use the tracer modules ----------------------------- -Before trace collection can start, a coresight sink needs to be identify. +Before trace collection can start, a coresight sink needs to be identified. There is no limit on the amount of sinks (nor sources) that can be enabled at any given moment. As a generic operation, all device pertaining to the sink class will have an "active" entry in sysfs: root:/sys/bus/coresight/devices# ls -replicator 20030000.tpiu 2201c000.ptm 2203c000.etm 2203e000.etm -20010000.etb 20040000.funnel 2201d000.ptm 2203d000.etm +20010000.etb 20040000.funnel 2201d000.ptm 2203d000.etm replicator +20030000.tpiu 2201c000.ptm 2203c000.etm 2203e000.etm root:/sys/bus/coresight/devices# ls 20010000.etb -enable_sink status trigger_cntr +enable_sink mgmt power subsystem trigger_cntr uevent root:/sys/bus/coresight/devices# echo 1 > 20010000.etb/enable_sink root:/sys/bus/coresight/devices# cat 20010000.etb/enable_sink 1 @@ -216,16 +228,13 @@ trigger a trace capture: root:/sys/bus/coresight/devices# echo 1 > 2201c000.ptm/enable_source root:/sys/bus/coresight/devices# cat 2201c000.ptm/enable_source 1 -root:/sys/bus/coresight/devices# cat 20010000.etb/status -Depth: 0x2000 -Status: 0x1 -RAM read ptr: 0x0 -RAM wrt ptr: 0x19d3 <----- The write pointer is moving -Trigger cnt: 0x0 -Control: 0x1 -Flush status: 0x0 -Flush ctrl: 0x2001 -root:/sys/bus/coresight/devices# + +Observe the write pointer moving: + +root:/sys/bus/coresight/devices# cat 20010000.etb/mgmt/rwp +0x1a8 +root:/sys/bus/coresight/devices# cat 20010000.etb/mgmt/rwp +0x19a6 Trace collection is stopped the same way: