From patchwork Fri Dec 13 14:54:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Leach X-Patchwork-Id: 11291685 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 873C3175D for ; Fri, 13 Dec 2019 22:24:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6C746214D8 for ; Fri, 13 Dec 2019 22:24:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Unp9mAKF"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TYdT2pkO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C746214D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=z3AkS0+lFjOAcub3k6uFeb7tCkFdamqe5XvNsupkQkM=; b=Unp9mAKFpzq/HkRRl8buPHsoq+ TEch4zxm68lFbVJSCpJFSFS/zSGg3tGAimZeORztu8vHuJbO3yvsbf7Z/YCShCAqN+qSTBMVP2Mka dLgZm530Q8BoMv29Auw1o2ovuJgF6Kuao6y3v0pMqxc78A1Op2iKXiu8VTfuqHlmRsfJlYymaarIq JMUIg3oGloO5GPjxz4HAPXtTxrsJ8nRXZEQkX5At6i7a1J/ny/eLzmeKEGPv1ucnAePEQZzrKwmSF WdDPKyox81/LfuXUGmHxYLI7sBpl8n8sGmFEswh/QQpBaibpaigQhJzXNK20YfBi0EU5FB9On6uTL 54L0HTCg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifmMj-0002xP-NO; Fri, 13 Dec 2019 14:56:25 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifmLF-0000Ju-F1 for linux-arm-kernel@lists.infradead.org; Fri, 13 Dec 2019 14:54:55 +0000 Received: by mail-wm1-x32d.google.com with SMTP id a5so6699842wmb.0 for ; Fri, 13 Dec 2019 06:54:53 -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=2YwP6QBfzQP6f/G0zY/S7Suzi5qrARix9Xc8Gv5qaHQ=; b=TYdT2pkONfULBiwMD/YbY8m1Q62C+sbMx/D4Hq3/UcYkRiHN3bG1B88I6Wd9/rAQmU 2vFF1wRoIS1Myx9dxWZKCJMXbRDn8Nq1OHts5JGiz8eHcWLlXDK6iO0l3aE9Y4IHTX9P SJNIBkTMW6SwKuM/kRbenMUi00b7yJ+BMHpYgLHlRkiCKEzcyjTcRtArHTlDQS2hPFH9 kbqNub7aLKsK5rfYFY+ZXSaOrfo9jVIh8HbrqdGQLmNj9whmGJHeN08WA7Md9WswxE1E c//O/B3BNwHjYaAen2Z7yXOr03rvPy/5F54vMttUE1WUwwBM5i4Qwll3Uz5vAykggGDg 5slw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2YwP6QBfzQP6f/G0zY/S7Suzi5qrARix9Xc8Gv5qaHQ=; b=Fc1NlcDYxfSD6jHN+Sml0IAQ3Xcnt9yaL25gkhpDbvWR6cHkT2gx4ZdiYIDsjpnZSx 550S5C17lL0iI1RjEphDf4wQGJZQAh2K1MMpaWGjx63C1uvoxAHMX6pVtqRczBno7UlB z0Y7hIsxOzfquJ7ioMUJ+xOtcXZ2/3ioA6UWDEHR4M6iOAME5YK+9peqH0stw5/dOYPB qv3Ql5HNx/V6qAKn14aGSF2b3Ie2bj/YMPpYHJJ4TZoZW/6elDrT5rrpX7wUpBA+s4JL lV1YYLgpdZCCUVuddON4JCkgUP6NTIhkdwO4WbaJPkjYS12dDIQtx+zNRC2QRlPn2py+ iUCw== X-Gm-Message-State: APjAAAUDJV2hYrLCfcmZ3RHzR3k3p8Opw8RKn2QQbxGSs4sIB24PAvti NgWud9yCz1iwCv8Kh8LLqqvu93v2DZw= X-Google-Smtp-Source: APXvYqyiLhydSvxVSrJxzAFZW8l4eacnf06DiY5jupLrekbNgincNh9VIFPrYzT6VizCS6bhBnaU1g== X-Received: by 2002:a7b:c8c7:: with SMTP id f7mr13891602wml.91.1576248891348; Fri, 13 Dec 2019 06:54:51 -0800 (PST) Received: from linaro.org ([2a00:23c5:6815:3901:54:d457:4f7b:f42c]) by smtp.gmail.com with ESMTPSA id n189sm10002979wme.33.2019.12.13.06.54.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2019 06:54:50 -0800 (PST) From: Mike Leach To: linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, linux-doc@vger.kernel.org Subject: [PATCH v3 6/6] coresight: docs: Add information about the topology representations. Date: Fri, 13 Dec 2019 14:54:31 +0000 Message-Id: <20191213145431.24067-7-mike.leach@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191213145431.24067-1-mike.leach@linaro.org> References: <20191213145431.24067-1-mike.leach@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191213_065453_545448_E8C6A277 X-CRM114-Status: GOOD ( 15.26 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:32d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mike Leach , mathieu.poirier@linaro.org, suzuki.poulose@arm.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Update the CoreSight documents to describe the new connections directory and the links between CoreSight devices in this directory. Signed-off-by: Mike Leach --- .../trace/coresight/coresight-ect.rst | 5 +- Documentation/trace/coresight/coresight.rst | 85 +++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) diff --git a/Documentation/trace/coresight/coresight-ect.rst b/Documentation/trace/coresight/coresight-ect.rst index 3e06588f24fa..0e535ab1574d 100644 --- a/Documentation/trace/coresight/coresight-ect.rst +++ b/Documentation/trace/coresight/coresight-ect.rst @@ -71,7 +71,7 @@ capable of generating or using trigger signals.:: >$ ls /sys/bus/coresight/devices/etm0/cti_cpu0 channels ctmid enable nr_trigger_cons mgmt power regs subsystem - triggers0 triggers1 uevent + connections triggers0 triggers1 uevent *Key file items are:-* * ``enable``: enables/disables the CTI. @@ -84,6 +84,9 @@ capable of generating or using trigger signals.:: * ``channels``: Contains the channel API - CTI main programming interface. * ``regs``: Gives access to the raw programmable CTI regs. * ``mgmt``: the standard CoreSight management registers. + * ``connections``: Links to connected *CoreSight* devices. The number of + links can be 0 to ``nr_trigger_cons``. Actual number given by ``nr_links`` + in this directory. triggers directories diff --git a/Documentation/trace/coresight/coresight.rst b/Documentation/trace/coresight/coresight.rst index 108600ee1e12..0b73acb44efa 100644 --- a/Documentation/trace/coresight/coresight.rst +++ b/Documentation/trace/coresight/coresight.rst @@ -241,6 +241,91 @@ to the newer scheme, to give a confirmation that what you see on your system is not unexpected. One must use the "names" as they appear on the system under specified locations. +Topology Representation +----------------------- + +Each CoreSight component has a ``connections`` directory which will contain +links to other CoreSight components. This allows the user to explore the trace +topology and for larger systems, determine the most appropriate sink for a +given source. The connection information can also be used to establish +which CTI devices are connected to a given component. This directory contains a +``nr_links`` attribute detailing the number of links in the directory. + +For an ETM source, in this case ``etm0`` on a Juno platform, a typical +arrangement will be:: + + linaro-developer:~# ls - l /sys/bus/coresight/devices/etm0/connections + cti_cpu0 -> ../../../23020000.cti/cti_cpu0 + nr_links + out:0 -> ../../../230c0000.funnel/funnel2 + +Following the out port to ``funnel2``:: + + linaro-developer:~# ls -l /sys/bus/coresight/devices/funnel2/connections + in:0 -> ../../../23040000.etm/etm0 + in:1 -> ../../../23140000.etm/etm3 + in:2 -> ../../../23240000.etm/etm4 + in:3 -> ../../../23340000.etm/etm5 + nr_links + out:0 -> ../../../20040000.funnel/funnel0 + +And again to ``funnel0``:: + + linaro-developer:~# ls -l /sys/bus/coresight/devices/funnel0/connections + in:0 -> ../../../220c0000.funnel/funnel1 + in:1 -> ../../../230c0000.funnel/funnel2 + nr_links + out:0 -> ../../../20010000.etf/tmc_etf0 + +Finding the first sink ``tmc_etf0``. This can be used to collect data +as a sink, or as a link to propagate further along the chain:: + + linaro-developer:~# ls -l /sys/bus/coresight/devices/tmc_etf0/connections + cti_sys0 -> ../../../20020000.cti/cti_sys0 + in:0 -> ../../../20040000.funnel/funnel0 + nr_links + out:0 -> ../../../20150000.funnel/funnel4 + +via ``funnel4``:: + + linaro-developer:~# ls -l /sys/bus/coresight/devices/funnel4/connections + in:0 -> ../../../20010000.etf/tmc_etf0 + in:1 -> ../../../20140000.etf/tmc_etf1 + nr_links + out:0 -> ../../../20120000.replicator/replicator0 + +and a ``replicator0``:: + + linaro-developer:~# ls -l /sys/bus/coresight/devices/replicator0/connections + in:0 -> ../../../20150000.funnel/funnel4 + nr_links + out:0 -> ../../../20030000.tpiu/tpiu0 + out:1 -> ../../../20070000.etr/tmc_etr0 + +Arriving at the final sink in the chain, ``tmc_etr0``:: + + linaro-developer:~# ls -l /sys/bus/coresight/devices/tmc_etr0/connections + cti_sys0 -> ../../../20020000.cti/cti_sys0 + in:0 -> ../../../20120000.replicator/replicator0 + nr_links + +As described below, when using sysfs it is sufficient to enable a sink and +a source for successful trace. The framework will correctly enable all +intermediate links as required. + +Note: ``cti_sys0`` appears in two of the connections lists above. +CTIs can connect to multiple devices and are arranged in a star topology +via the CTM. See (:doc:`coresight-ect`) [#fourth]_ for further details. +Looking at this device we see 4 connections:: + + linaro-developer:~# ls -l /sys/bus/coresight/devices/cti_sys0/connections + nr_links + stm0 -> ../../../20100000.stm/stm0 + tmc_etf0 -> ../../../20010000.etf/tmc_etf0 + tmc_etr0 -> ../../../20070000.etr/tmc_etr0 + tpiu0 -> ../../../20030000.tpiu/tpiu0 + + How to use the tracer modules -----------------------------