From patchwork Mon Jan 15 18:13:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 124546 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp751791lje; Mon, 15 Jan 2018 10:13:25 -0800 (PST) X-Google-Smtp-Source: ACJfBosnJ9mkVVA1Opu3ytPyxt5Vhw7d++mY50qnRcYhNKKoSW75IbtH1QdSacBwQ0w6+gNNcHwd X-Received: by 10.99.94.69 with SMTP id s66mr28306958pgb.145.1516040004919; Mon, 15 Jan 2018 10:13:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516040004; cv=none; d=google.com; s=arc-20160816; b=WGW1r6xI9qgzm852V2BnOtUMfEYDzy6+iDAVrKAgSNz9QSTcIxyszMrIKaTeNwGyqn hjAEDyuvTuPmqDCXnVZKWLNXaYmsLDhnZKV46K38lIFl9R26mNFPIaklArAD9wWrj7iD DqBfnm1gf/k9UFU946HdpPlpFxcLntu5FuPdhTh8MDWXXx4xAoNsFkpc7eD/i5vsDDOj LpTSmzZ3QEJi7fOUwmR6T3N05YydnkJjWUs5TztJwIRL5KJ8sNwG3Ag+U13JRBRKLfW8 aCGIZkc0/iyYE5T+kHmnaTgp1lrHCiA+xC/V3QS1KqC8Rr+hLS0Q15tp/hgxAyjnjijF So6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=1M67rgg5UgvXiP4UTL2dSMbNXbwGqHqfPcgPVNRnzDg=; b=y0Jkdkzf/hiWcheIUThcCqzfBbMiBwgYazPuAkHQ4KEr8pkKPROnowbBgOwgt1xtDO DV/MiksWCcVsyYuoZXuWyr24qzrOFHGkakPZfqkL9VjZ85GDigXh4iZmnlFci0Bfso9P sjzVqWP9z1aurb+BtSpOhCy6418EMJQTuJsxK27Zgr4cihLn3QyAMNNqTRcJsT0z+744 wiEa+sIhtHZaBilnyH2GZf79gLTNorkSpL4HBkWy2eANLK6maGwEYzpUHiX7Fg8wGxtA zb6ShdNN3bxuvrTiBNSEdtxGtAtwsYT9GXn1Bf9LhqUIDuBUnhuPsKw1u+7rlJl7MJwG vtbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TYTXEBgh; 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 20si148468pfp.408.2018.01.15.10.13.24; Mon, 15 Jan 2018 10:13:24 -0800 (PST) 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=TYTXEBgh; 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 S1751175AbeAOSNW (ORCPT + 28 others); Mon, 15 Jan 2018 13:13:22 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:45332 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750999AbeAOSNS (ORCPT ); Mon, 15 Jan 2018 13:13:18 -0500 Received: by mail-it0-f65.google.com with SMTP id x42so1845493ita.4 for ; Mon, 15 Jan 2018 10:13:18 -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; bh=1M67rgg5UgvXiP4UTL2dSMbNXbwGqHqfPcgPVNRnzDg=; b=TYTXEBghF4KalgXStQ9Kiu3F54bwLw8wRuLsCezRRgJDQ3GyNTpU9ISssbyvywb4SL FlA5emyJs8NACKROl27jBKGwDhMvobvhfhqApmzcFDIY2cvj/gaiFiveRNzOF71zRZpM 9AYqrk01p0uGYeHysUrN5XLUAZYEqoOiRk3U8= 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; bh=1M67rgg5UgvXiP4UTL2dSMbNXbwGqHqfPcgPVNRnzDg=; b=TxUMIoU+BVbBqGnEXUxA+14MznqmCJcJVtFFi+q1JROlzaGazJio19vk7PPXsGXUK+ v4vjCvv9yDEnLKqM2rhSkn7q6x13392m5zHwOAQ6BOWpxLNPwaOjN/1Lcm/pdpnnBUeB BN8PoLofVK7M0Or2r7IqWx+qwKITrzvOabx5AiTmp0NXQab5mijUW+eDwzOiTq1J7xBK t4VLJqjc67Kxfi0EF0849dBBmrWJgsI+fJpDP/Nos/bLOgSVRXZy79qCWpZPfCgcpnCX AFvQRwJCcgMDB7RXYiF/O7IAUyZTGlHYFcTygD0peMwqwpgYrKu1W+RVMQzKWOdd5WcJ betA== X-Gm-Message-State: AKwxyteUk0qnjog6q5popEtFJpquZ8kZzr57dEz5sTVTLoUukUfgwnTN FZtwhF+GBrsqZJGLzeaao7FX5g== X-Received: by 10.36.120.211 with SMTP id p202mr16477620itc.28.1516039997886; Mon, 15 Jan 2018 10:13:17 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id w142sm231480ita.25.2018.01.15.10.13.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Jan 2018 10:13:16 -0800 (PST) From: Mathieu Poirier To: acme@kernel.org Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, namhyung@kernel.org, adrian.hunter@intel.com, mike.leach@arm.com, suzuki.poulosi@arm.com, jolsa@redhat.com, kim.phillips@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 00/10] perf tools: Add support for CoreSight trace decoding Date: Mon, 15 Jan 2018 11:13:04 -0700 Message-Id: <1516039994-314-1-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnaldo, This patchset adds support for per-thread CoreSight trace decoding from the "perf report" interface. It is largely modelled on what has been done for intelPT traces and currently targets the ETMv4 architecture. Support for cpu-wide scenarios and ETMv3/PTMv1.1 will follow shortly. The trace decoding support is done using the Open CoreSight Decoding Library (openCSD), a stand alone open source project available here [1]. Integration of the openCSD library with the perf tools follow what has been done for other support libraries. If the library has been installed on a system the build scripts will include support for CoreSight trace decoding: ... zlib: [ on ] ... lzma: [ OFF ] ... get_cpuid: [ on ] ... bpf: [ on ] ... libopencsd: [ on ] <------ Instructions on how to build and install the openCSD library are provided in the HOWTO.md of the project repository. We elected to keep the decoder library independent of the kernel tree as it is also used outside of the perf toolset and various non-linux projects. The work applies cleanly to [2] and depend on the following patches [3, 4]. Lastly there is a divergence of opinions on whether the decoding library should be part of the kernel tree or live on its own as we chose to do - your point of view on the matter would be greatly appreciated. Regards, Mathieu [1]. https://github.com/Linaro/OpenCSD [2]. git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git perf/core [3]. https://marc.info/?l=linux-kernel&m=151561673423088&w=2 [4]. https://marc.info/?l=linux-kernel&m=151579875721440&w=2 Changes for V2: . Rebased to Acme's latest (321e85e9458a) . Following what has been done for libdw and libbabeltrace and added the possibililty to use alternate header/library for development purposes. Mathieu Poirier (8): perf tools: Integrating the CoreSight decoding library perf tools: Add initial entry point for decoder CoreSight traces perf tools: Add decoder mechanic to support dumping trace data perf tools: Add support for decoding CoreSight trace data perf tools: Add functionality to communicate with the openCSD decoder pert tools: Add queue management functionality perf tools: Add full support for CoreSight trace decoding perf tools: Add mechanic to synthesise CoreSight trace packets Tor Jeremiassen (2): perf tools: Add processing of coresight metadata MAINTAINERS: Adding entry for CoreSight trace decoding MAINTAINERS | 3 +- tools/build/Makefile.feature | 6 +- tools/build/feature/Makefile | 7 +- tools/build/feature/test-all.c | 5 + tools/build/feature/test-libopencsd.c | 8 + tools/perf/Makefile.config | 25 + tools/perf/Makefile.perf | 2 + tools/perf/util/Build | 6 + tools/perf/util/auxtrace.c | 2 + tools/perf/util/cs-etm-decoder/Build | 1 + tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 513 ++++++++++++ tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 105 +++ tools/perf/util/cs-etm.c | 1023 +++++++++++++++++++++++ tools/perf/util/cs-etm.h | 18 + 14 files changed, 1720 insertions(+), 4 deletions(-) create mode 100644 tools/build/feature/test-libopencsd.c create mode 100644 tools/perf/util/cs-etm-decoder/Build create mode 100644 tools/perf/util/cs-etm-decoder/cs-etm-decoder.c create mode 100644 tools/perf/util/cs-etm-decoder/cs-etm-decoder.h create mode 100644 tools/perf/util/cs-etm.c -- 2.7.4