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