From patchwork Tue Apr 17 16:08:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 133550 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp4887197ljb; Tue, 17 Apr 2018 09:08:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx49uanywOSabZZkFIY4gbUeSxMRB9LkecioWQzTliXFjYk4oIohgGNA1MpgqyJDGUs7dWQA6 X-Received: by 10.98.150.75 with SMTP id c72mr2533112pfe.62.1523981299034; Tue, 17 Apr 2018 09:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523981299; cv=none; d=google.com; s=arc-20160816; b=u/Qq++ity8WOPj8LFaqGQU9nB9od5xWgZKhQxae0720yTrdm44/+3KR6G9N1/9c5as dMcsRIImqmQqVntsByOxcpe41GDabKDIjdE6T/QeCTtmnjstTf0ax8w4lR1QgyE1yDog eeYFkfXYEZ3AtnGUGY1b9NK5SCG+Y+yvoRcAJpLvaeHRSY7XIvGh9b1TOh5kwpahtfSf u+KPECroguKPaRAwqW+ZkMuCASK24DSbJOjZxbKh3pGBmdiuhum57Wov1gFzhIhc5d7b BJFUdVmolP4qgt0eFq02IlShQZlGT/1qCkqmIZS/bQk3nwha/k7JUCR1lfydI8wg2MCR Y8dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=tuybmXnIw8o7e0ZlNrxSj711s4fTF2uNswv5BobIx2Y=; b=x/8Kjw8XGsGMV58D9p/hrF5v8+cb6iAGJKEaU3DhPl6BTMm7py6qk63auxl7aL7HEm OxDOO2703PuOECmAIhCiRjoPuSzJwp4HKoU2OZq1csJJTedMqOVplI3eOd89zuoXLtJ+ /pbM/Bgn/OCn6L1UAWt3Ketqxv6K37QoUlr6QDhlwESCd+/bzGpfmehgCynH4XwfdRkc miH6hxKQ9f5pi+u+CgvY4hmdw0ySSBq+M5MVBfOQuWWl8PZpZ/VfRlOW9uPhF/zsllsg 5zFIEaUB+fyi7rRO6AW6Z+RwIiqWT0QGDUgVVmA5M6+JrBPpVlSJFIuYgFP3gtInUYHR 4ibw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TnKmKCya; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m18si13361328pfi.296.2018.04.17.09.08.18; Tue, 17 Apr 2018 09:08:19 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=TnKmKCya; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755090AbeDQQIP (ORCPT + 29 others); Tue, 17 Apr 2018 12:08:15 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:43695 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754763AbeDQQIM (ORCPT ); Tue, 17 Apr 2018 12:08:12 -0400 Received: by mail-pf0-f196.google.com with SMTP id j11so5822321pff.10 for ; Tue, 17 Apr 2018 09:08:11 -0700 (PDT) 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=tuybmXnIw8o7e0ZlNrxSj711s4fTF2uNswv5BobIx2Y=; b=TnKmKCyad/md1QlRGp+G7TsqxgvfjdNiP3MhtxZpoYHCQSLydkBXKa76wBby4nZSs9 XnhbBCZxtuna3GnmJKZVrJPg+2psu/dZnrPfGD/agSoCpNewL7jXmlKnXyJB/1nv3LIX jtm0phRSPB080X13iew5kLfDtDULVJIvW0sV0= 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=tuybmXnIw8o7e0ZlNrxSj711s4fTF2uNswv5BobIx2Y=; b=SRj03h+P/kfVDZD0Y3kQO7L5rFtMr9u4jz0kysewKT94BClpc9OKxaRmxB5JkU/1PU oBe5KbV6KfJIjE3tfdBav2QnAotZ9n30CH8XY0ekwZrLVbr0AP7uPz0ki4NUwPQXKpdk jw6dtZ8ShmkqOQ6ztB2yjEi1T/ziV1NyZisuaAbHNx7QA4LfSVJfDN4pNwV2dCAalFB9 pc6f9xDl12GPnCKZbEkHUuaJtus/JO44G7OkJPWbIVDcqhJZpu3bBgKNcq2gIkc4bAPB c7zoESWRz/llXQ6k94Ka9r5zXCgHGPPiMLT68Ms1lvjeFKODpiPOeMnV8BinXoOSnYex xFQw== X-Gm-Message-State: ALQs6tCEp3Q0TUwiCJo8p8vsslvskPAZu5QeTr9xsLjw1tMOvPd1/GWW l65865ar8iWaRN9Oy6HvluShzA== X-Received: by 10.99.125.75 with SMTP id m11mr2242105pgn.391.1523981291258; Tue, 17 Apr 2018 09:08:11 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id r81sm34829878pfj.79.2018.04.17.09.08.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Apr 2018 09:08:10 -0700 (PDT) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org, corbet@lwn.net Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, rdunlap@infradead.org, Ben.Gainey@arm.com Subject: [PATCH v2 1/3] coresight: Remove obsolete reference to "owner" in CoreSight descriptor Date: Tue, 17 Apr 2018 10:08:05 -0600 Message-Id: <1523981287-15370-2-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523981287-15370-1-git-send-email-mathieu.poirier@linaro.org> References: <1523981287-15370-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 Field "owner" of struct coresight_desc has been removed a while back but the documentation was not updated to reflect the changes. Signed-off-by: Mathieu Poirier --- Documentation/trace/coresight.txt | 3 --- 1 file changed, 3 deletions(-) -- 2.7.4 diff --git a/Documentation/trace/coresight.txt b/Documentation/trace/coresight.txt index 6f0120c3a4f1..710c75b6c73f 100644 --- a/Documentation/trace/coresight.txt +++ b/Documentation/trace/coresight.txt @@ -187,9 +187,6 @@ that can be performed on them (see "struct coresight_ops"). The specific to that component only. "Implementation defined" customisations are expected to be accessed and controlled using those entries. -Last but not least, "struct module *owner" is expected to be set to reflect -the information carried in "THIS_MODULE". - How to use the tracer modules ----------------------------- From patchwork Tue Apr 17 16:08:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 133554 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp4910644ljb; Tue, 17 Apr 2018 09:31:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/fbfD5tR/VajYVHBOCAyaDOXgz71s++62LrxZx4WMziM37MCz78V4fU+PoorVDXiHThil3 X-Received: by 2002:a17:902:8488:: with SMTP id c8-v6mr2655594plo.357.1523982703530; Tue, 17 Apr 2018 09:31:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523982703; cv=none; d=google.com; s=arc-20160816; b=pA/T7dLK6d59Fg8sAAhAbUapIU/oALL4rdZrEl75LOm5Q8uY//4+PKpieAcR1/LZPJ LhOwV20w9qLUTO56Dtw+/pQ82t0HuIC0Rfu/rYnfSo4xWR6N9gk781Tn47ifYx62GKQW IoOpgqHKTm3ZqIKCI9Updn/J3RU95wFrVVZ6RAW7fQq6mPZyAQZWwL6K73Ify/Tq+4+C i/EjfRk1ZlYV31JXMhCjHMBkgWdWLZxRm4M1Gy1/Zk51foLbi5eefH/eXIyyUXEjnBb1 jTYVAzwWYnanmhTl2b7WgiOEFKK5RyAxaysEmp2U5WP2+iJHzzfKTy0AyCPOSH3BACHk DL+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=OKf9MgUVXhdnUuqeLsv7yHsmJKwdChk3S4Z4m3i1Djc=; b=gCwN9rHhS3G5Xj1CZ+oa99CL1rT96M7m/PTPkT50l3Udu8kjuBbPpjY0YR6i7hNlEp 2nDyNUkDOsz8hjxqdbaq2D5yIyH5Fi7yq5P7JMrjgcXKcRLcj1vBe27tY/wAMG/V/zlk a5v6iqc0/lokoMwhfq2SEPCtF0CQL3xT0g0+NL/6dExTMrQaVq4VaNvy3mgBmuv9zNGB mFkPhFa8JMk331ZvFxy9N9JnE/V00Q97cvyrfnL6YKEiLcoHVNrNYZqsADypJuoWMj1t /Vg/D06pbAjb9qk+ZgPkFziqxCfrRFd9FxDkAojGm9jFFz6bMtSeTx2lh96COqn45Iex 6oSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iRTCeOUv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11-v6si5351843plp.221.2018.04.17.09.31.43; Tue, 17 Apr 2018 09:31:43 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=iRTCeOUv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755235AbeDQQbl (ORCPT + 29 others); Tue, 17 Apr 2018 12:31:41 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:38962 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755353AbeDQQIN (ORCPT ); Tue, 17 Apr 2018 12:08:13 -0400 Received: by mail-pg0-f67.google.com with SMTP id b9so5615962pgf.6 for ; Tue, 17 Apr 2018 09:08:13 -0700 (PDT) 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=OKf9MgUVXhdnUuqeLsv7yHsmJKwdChk3S4Z4m3i1Djc=; b=iRTCeOUvPis4sG2UKnjpMbc0K5d94f9iF8dqVtZ0NXCjSRm8K/sfasXwXF2KA+kcf+ NnIvPGEzqOElpaLekAT5LtXnzBAP7371ZU1GMZPCOHjozgWgMizCg2NzncLoThdKt2JO M7271glOmwkk94ByyU60310Wz7lMoG93/rvxY= 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=OKf9MgUVXhdnUuqeLsv7yHsmJKwdChk3S4Z4m3i1Djc=; b=DuRVapD5ABU8KpLzUCCTtxsiSFWgLCZoWHuYcUqGFV3zES9Cswtv+vwW4wpzJSOf0H r/uOC6G+rBS+KVoxdDI2n60RmP1f00ldUf2zRhOhhwFBZjuXdv8eJRXD54jMp9C4V0HI VQE5JB3od7Iwbco9sLgu/hNAJ/7czWWSRFvll4BNv4KLnUP08hwpic/74SmjC+ERyQgQ x8G7MwZkbtJPeSopPXlKBlHA2VP4X5EY1bSeIOGIsb0CRGI1ljp3E8tolUuiRjh2u0YU 4HyDtDaR+DIThnvHQdsesXDLIe97HX6nXy2yKRA72iB0MLnb88gZsGPCrOVBhETP2t8f 0uMQ== X-Gm-Message-State: ALQs6tAOt/0GDUFrLirSLN13N7+zTDGQHJtxhmiAyTbHPruiX0iX7FEN HmuhZbyq3rINHJ/ASGUt8bN9wg== X-Received: by 10.98.155.12 with SMTP id r12mr2492193pfd.15.1523981292698; Tue, 17 Apr 2018 09:08:12 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id r81sm34829878pfj.79.2018.04.17.09.08.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Apr 2018 09:08:11 -0700 (PDT) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org, corbet@lwn.net Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, rdunlap@infradead.org, Ben.Gainey@arm.com Subject: [PATCH v2 2/3] coresight: Add section for integration with the perf tools Date: Tue, 17 Apr 2018 10:08:06 -0600 Message-Id: <1523981287-15370-3-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523981287-15370-1-git-send-email-mathieu.poirier@linaro.org> References: <1523981287-15370-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 Adding a section that document how to use the Coresight framework and drivers from the perf tools. Signed-off-by: Mathieu Poirier --- Documentation/trace/coresight.txt | 52 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) -- 2.7.4 Acked-by: Randy Dunlap diff --git a/Documentation/trace/coresight.txt b/Documentation/trace/coresight.txt index 710c75b6c73f..ab0d0f2d5cec 100644 --- a/Documentation/trace/coresight.txt +++ b/Documentation/trace/coresight.txt @@ -187,10 +187,19 @@ that can be performed on them (see "struct coresight_ops"). The specific to that component only. "Implementation defined" customisations are expected to be accessed and controlled using those entries. + How to use the tracer modules ----------------------------- -Before trace collection can start, a coresight sink needs to be identify. +There are two ways to use the Coresight framework: 1) using the perf cmd line +tools and 2) interacting directly with the Coresight devices using the sysFS +interface. Preference is given to the former as using the sysFS interface +requires a deep understanding of the Coresight HW. The following sections +provide details on using both methods. + +1) Using the sysFS interface: + +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: @@ -295,6 +304,47 @@ Instruction 13570831 0x8026B584 E28DD00C false ADD Instruction 0 0x8026B588 E8BD8000 true LDM sp!,{pc} Timestamp Timestamp: 17107041535 +2) Using perf framework: + +Coresight tracers are represented using the Perf framework's Performance +Monitoring Unit (PMU) abstraction. As such the perf framework takes charge of +controlling when tracing gets enabled based on when the process of interest is +scheduled. When configured in a system, Coresight PMUs will be listed when +queried by the perf command line tool: + + linaro@linaro-nano:~$ ./perf list pmu + + List of pre-defined events (to be used in -e): + + cs_etm// [Kernel PMU event] + + linaro@linaro-nano:~$ + +Regardless of the number of tracers available in a system (usually equal to the +amount of processor cores), the "cs_etm" PMU will be listed only once. + +A Coresight PMU works the same way as any other PMU, i.e the name of the PMU is +listed along with configuration options within forward slashes '/'. Since a +Coresight system will typically have more than one sink, the name of the sink to +work with needs to be specified as an event option. Names for sink to choose +from are listed in sysFS under ($SYSFS)/bus/coresight/devices: + + root@linaro-nano:~# ls /sys/bus/coresight/devices/ + 20010000.etf 20040000.funnel 20100000.stm 22040000.etm + 22140000.etm 230c0000.funnel 23240000.etm 20030000.tpiu + 20070000.etr 20120000.replicator 220c0000.funnel + 23040000.etm 23140000.etm 23340000.etm + + root@linaro-nano:~# perf record -e cs_etm/@20070000.etr/u --per-thread program + +The syntax within the forward slashes '/' is important. The '@' character +tells the parser that a sink is about to be specified and that this is the sink +to use for the trace session. + +More information on the above and other example on how to use Coresight with +the perf tools can be found in the "HOWTO.md" file of the openCSD gitHub +repository [3]. + How to use the STM module ------------------------- From patchwork Tue Apr 17 16:08:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 133553 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp4909811ljb; Tue, 17 Apr 2018 09:30:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/LTIHSVwTmP8bG5u7aa/DXnsY5etdomkkvBJaRY36EerL4inD4b19stxdPIq7WkYILeEeb X-Received: by 2002:a17:902:c24:: with SMTP id 33-v6mr2632238pls.88.1523982654370; Tue, 17 Apr 2018 09:30:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523982654; cv=none; d=google.com; s=arc-20160816; b=ODydnlfBl3VTNf7UVEoIhuamHLCIfu8tCs5eY6nUJYXSJw5IKNeK+3INmxqieIpix8 aHBNGFbQ9N3okfgKXZptDyhnOvJ2YNP7woXI+huBLAifjpbpwDzG9Eg+ck8cMRyjwQ0u iQDsYioudYy2DHdeAcrb7fWKe8PFLAbeEjT+zydnOOTrrzwan0Wm1A1Fe/KKxo4Q6iHQ Al2vcbCCeJncDcuovvdekteY0mzYxl8iAk8WsM36CrrTvnBPwYrjMHdbpa/LEq2DWS3e pYQZTLBFrLiExWtMNSDeNMt1xbEjPXyl99hrs/JSfYRQ+LloCLBbwUG3UEamCzVgTHAP sVFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=NdpJ7gm4XaA4BpLhWls5YswaFM5nZTNzYmH8k31uBng=; b=fuTyU+bWy/uY8s2oqG5Fo6+gtf629wSf09rJbACrJ7ghsCszpYafuoQzBpXRgwON3r 5DuEkOGac8pGtJoTSQzyIswGLyY5SF6MABY7S4LG3P+iPxeZg2wnT/eprF249L5jHaL4 eX2IF75Be8Tc3o7dmRIx5J2+aIT8lA/taT84jlyRbif4HWGrT2a+WoZt898m9iTWCMB5 koeEUw2duCZ5lPgAq4c2LXw7ol9Wajuynz7GEfOgFdfnU30XGd8wrqrYlm4vVBwBO3Yh 1ot5NNdA9OFxLcrFeWMk4bIiPqwGpuNtB4aPte5XXVDgLpSM7k/xVvgfYQiDzm29flJ6 HVFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kWgAsvli; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y72si13290594pfi.46.2018.04.17.09.30.53; Tue, 17 Apr 2018 09:30:54 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=kWgAsvli; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754619AbeDQQav (ORCPT + 29 others); Tue, 17 Apr 2018 12:30:51 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:42179 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753178AbeDQQIO (ORCPT ); Tue, 17 Apr 2018 12:08:14 -0400 Received: by mail-pl0-f67.google.com with SMTP id t20-v6so12243404ply.9 for ; Tue, 17 Apr 2018 09:08:14 -0700 (PDT) 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=NdpJ7gm4XaA4BpLhWls5YswaFM5nZTNzYmH8k31uBng=; b=kWgAsvli9/RhT4SkwGzZZLxrUxhJDgs18nd2lxqBYk1hXQYflyc57niehvCmPZCJG7 Z7J14BVO8Jh9xTasyNd6Ljj8nlPG5CuoP/GoEGmOk0gMtMbIyWPP24Ad9UDTWjnjzE8d PPBn5CeSSHitvM28nUKffcQSCGCu+C6xO3Ub8= 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=NdpJ7gm4XaA4BpLhWls5YswaFM5nZTNzYmH8k31uBng=; b=NSuiCq98xuj20DhT5+G1KSqfLYbslOt1crGPk/s01QJAcn4mWVo9sYYYRm7jrgjpzz lrEj1CAK/cRKil0wStEwb9Vsbdu8NRHYNXegt2BRA+fEy1vxGStLvyfs+raGr12vygKe gR+00JZpF7bXXysO2XtuPFJQDdPUoqHV6yvRIzkbTvK1WOTYWswKaWxZi6zijQFe7Nsk dAbvxg1ZRqinjvxfjj+ae/ITgdrSpRHRHkaRqpCaKSgzvnYFnHley7g5KnEqXpEvNv06 5Wd35wFsqngCdG0B8fqpxJXEs4VVeII8VZWwAOWXtT4I6ZDanTaLq0h416A3OhVLvNw1 t6Zw== X-Gm-Message-State: ALQs6tDnBdBAMjbeVNfHCeN8w/yTVzY6W2pf7Xi0u7AJzxO3UoRF9WhG /9NkPy0HWl2hryeu4g0HZUXUrA== X-Received: by 2002:a17:902:290a:: with SMTP id g10-v6mr1726602plb.155.1523981294268; Tue, 17 Apr 2018 09:08:14 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id r81sm34829878pfj.79.2018.04.17.09.08.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Apr 2018 09:08:13 -0700 (PDT) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org, corbet@lwn.net Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, rdunlap@infradead.org, Ben.Gainey@arm.com Subject: [PATCH v2 3/3] coresight: Grouping all perf tools oriented section together Date: Tue, 17 Apr 2018 10:08:07 -0600 Message-Id: <1523981287-15370-4-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523981287-15370-1-git-send-email-mathieu.poirier@linaro.org> References: <1523981287-15370-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 This patch groups together section pertaining to the perf tools. That way everything is at the same place rather than spread out. Signed-off-by: Mathieu Poirier --- Documentation/trace/coresight.txt | 72 +++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 36 deletions(-) -- 2.7.4 diff --git a/Documentation/trace/coresight.txt b/Documentation/trace/coresight.txt index ab0d0f2d5cec..1d74ad0202b6 100644 --- a/Documentation/trace/coresight.txt +++ b/Documentation/trace/coresight.txt @@ -345,42 +345,7 @@ More information on the above and other example on how to use Coresight with the perf tools can be found in the "HOWTO.md" file of the openCSD gitHub repository [3]. -How to use the STM module -------------------------- - -Using the System Trace Macrocell module is the same as the tracers - the only -difference is that clients are driving the trace capture rather -than the program flow through the code. - -As with any other CoreSight component, specifics about the STM tracer can be -found in sysfs with more information on each entry being found in [1]: - -root@genericarmv8:~# ls /sys/bus/coresight/devices/20100000.stm -enable_source hwevent_select port_enable subsystem uevent -hwevent_enable mgmt port_select traceid -root@genericarmv8:~# - -Like any other source a sink needs to be identified and the STM enabled before -being used: - -root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/20010000.etf/enable_sink -root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/20100000.stm/enable_source - -From there user space applications can request and use channels using the devfs -interface provided for that purpose by the generic STM API: - -root@genericarmv8:~# ls -l /dev/20100000.stm -crw------- 1 root root 10, 61 Jan 3 18:11 /dev/20100000.stm -root@genericarmv8:~# - -Details on how to use the generic STM API can be found here [2]. - -[1]. Documentation/ABI/testing/sysfs-bus-coresight-devices-stm -[2]. Documentation/trace/stm.txt - - -Using perf tools ----------------- +2.1) AutoFDO analysis using the perf tools: perf can be used to record and analyze trace of programs. @@ -428,3 +393,38 @@ sort example is from the AutoFDO tutorial (https://gcc.gnu.org/wiki/AutoFDO/Tuto $ taskset -c 2 ./sort_autofdo Bubble sorting array of 30000 elements 5806 ms + + +How to use the STM module +------------------------- + +Using the System Trace Macrocell module is the same as the tracers - the only +difference is that clients are driving the trace capture rather +than the program flow through the code. + +As with any other CoreSight component, specifics about the STM tracer can be +found in sysfs with more information on each entry being found in [1]: + +root@genericarmv8:~# ls /sys/bus/coresight/devices/20100000.stm +enable_source hwevent_select port_enable subsystem uevent +hwevent_enable mgmt port_select traceid +root@genericarmv8:~# + +Like any other source a sink needs to be identified and the STM enabled before +being used: + +root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/20010000.etf/enable_sink +root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/20100000.stm/enable_source + +From there user space applications can request and use channels using the devfs +interface provided for that purpose by the generic STM API: + +root@genericarmv8:~# ls -l /dev/20100000.stm +crw------- 1 root root 10, 61 Jan 3 18:11 /dev/20100000.stm +root@genericarmv8:~# + +Details on how to use the generic STM API can be found here [2]. + +[1]. Documentation/ABI/testing/sysfs-bus-coresight-devices-stm +[2]. Documentation/trace/stm.txt +[3]. https://github.com/Linaro/perf-opencsd