Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp46324imm; Mon, 21 May 2018 01:55:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrh7lwcI1gpOF1JSx5X24iNVgWKSOxgBCydWtuH8eTV6AY++QR++rJJ3VBuAlrne5KFtC9M X-Received: by 2002:a17:902:284b:: with SMTP id e69-v6mr19049373plb.240.1526892942718; Mon, 21 May 2018 01:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526892942; cv=none; d=google.com; s=arc-20160816; b=y7CSox8TRkuixu+GZvfMZUXC7BjzO7BFR1XqkAMGI4WFuMGAzEKZieVKooh99l9EWL CzkjWs3np5L5pCsPo96dUqnqnVzsxCvkZKdg2lSW4XXmHbGPvMp2yPykkZcoUnRKgsyz DoXMEchNdEncJoavHA//irOIJtyxSlQXi4znfH21I6XL+z49P0kcUIHe1UdcM7xhkabS tSOfZZP2ZUF/kVPnA1FUmpPGW0UflszZXFdkEz/3P6rhqn5LAQGmm/IvIdScpuYf/tmf sCF9433b5ARsp7nqJNY8cN5E9SuM5uvU59aKLJEqkp92maPOKIGpHOg5JgaMaQJlOvIE /9cw== 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=7HNfZFmkg7H2Dsk1KDP61dJ//0n7TfGIrRFVLHVIUGw=; b=o1NDVRKhMkiMddVncv+V0tJ8STtOTmJady71pPMz2VMp+RT/wNwT9OH50Os141USsM EOOkQvzO+9Izgam4VuWCbBHEO2ZWw2BZwbVz4cPxdFB9ar4ASuAZMdYkn5bytnKGCFI5 AgtRUbXIzpknjCwQPKLP/VQQzQQteN62bZu24S4gFBFj4ghQDFqKLNJAH8BfxlRbnBNk KgAMN5CQU9Dy8qfLVpZN7K+5KBx+0XaEfTS/mw1ZHtGFqmakDLEwfHROMf0xSBh4sCgX 6NktGWFlEH0tPbMfb4V4r50uo4oo/9Qk0Mw2CbYHM8O6ub5Fz4g6KTZnSeI4/4pdKxNK 892Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BMk7NoVH; 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 t17-v6si12966172plo.266.2018.05.21.01.55.28; Mon, 21 May 2018 01:55:42 -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=BMk7NoVH; 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 S1751624AbeEUIxj (ORCPT + 99 others); Mon, 21 May 2018 04:53:39 -0400 Received: from mail-pg0-f54.google.com ([74.125.83.54]:43887 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750970AbeEUIxg (ORCPT ); Mon, 21 May 2018 04:53:36 -0400 Received: by mail-pg0-f54.google.com with SMTP id p8-v6so6068228pgq.10 for ; Mon, 21 May 2018 01:53:36 -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; bh=7HNfZFmkg7H2Dsk1KDP61dJ//0n7TfGIrRFVLHVIUGw=; b=BMk7NoVHQzrpmWA45Ejw3uTfudT6ayf1MAKS0W/pgmRFdHbHvNvEL2Mc40nG4VbfYW n0OmTOYxHvAe+e67JWUi0/xoz1UDTc/4OffOZlBb1pTZlxHrPLgXcPAUDFvUxVuC4eol LhKIqLWJYTSBXERSiw6V3MEpYrOV9CJCw6dPQ= 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=7HNfZFmkg7H2Dsk1KDP61dJ//0n7TfGIrRFVLHVIUGw=; b=mWPfzY/m6GxdA3GECsij+6hPlT5uS5yOPycPGlTeCzaFKkKywSSFhZQiz/aASnr1lr fOMWdZMjjTFXLJisqjBkbG9TxNlgeJHoS1fgajmOa/1rfmfZfOtcbVULhy5adprcO/Nu sI4RZcxkPu6/Rv2pyIjQ16VfEy8RJ2oIwmsV4IjNeE0T/vYELSYZbk2EGOwC09Kq8RH/ pZsKIXFq9WXVS8N56PLBS1WxrCKvvFw8yVi1r0tlhrZbZbxp5lFr60txYnhCfTBRTKyU lVpmIMUfJkYld6WfoR1NLjA1n1TQNrnuE0DBHiP4DsfoNX25DkQpQMPppgoz05XpzCJb QZjA== X-Gm-Message-State: ALKqPwfVky6PJqvnQeECQeCHl7UXBPYqUVck7xtVCg+45+UnFLM7BSPT XIrxldQ2BMxNAW5zlNlOpt1dUQ== X-Received: by 2002:a62:e107:: with SMTP id q7-v6mr19105268pfh.226.1526892815536; Mon, 21 May 2018 01:53:35 -0700 (PDT) Received: from localhost.localdomain (li1209-69.members.linode.com. [45.79.110.69]) by smtp.gmail.com with ESMTPSA id 16-v6sm28553918pfq.115.2018.05.21.01.53.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 May 2018 01:53:34 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Mathieu Poirier , Jonathan Corbet , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Tor Jeremiassen , mike.leach@linaro.org, kim.phillips@arm.com, Robert Walker , coresight@lists.linaro.org Cc: Leo Yan Subject: [RFT v2 0/4] Perf script: Add python script for CoreSight trace disassembler Date: Mon, 21 May 2018 16:52:24 +0800 Message-Id: <1526892748-326-1-git-send-email-leo.yan@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 This patch series is to support for using 'perf script' for CoreSight trace disassembler, for this purpose this patch series adds a new python script to parse CoreSight tracing event and use command 'objdump' for disassembled lines, finally this can generate readable program execution flow for reviewing tracing data. Patch 0001 is one fixing patch to generate samples for the start packet and exception packets. Patch 0002 is the prerequisite to add addr into sample dict, so this value can be used by python script to analyze instruction range. Patch 0003 is to add python script for trace disassembler. Patch 0004 is to add doc to explain python script usage and give example for it. This patch series has been rebased on acme git tree [1] with the last commit 19422a9f2a3b ("perf tools: Fix kernel_start for PTI on x86") and tested on Hikey (ARM64 octa CA53 cores). In this version the script has no dependency on ARM64 platform and is expected to support ARM32 platform, but I am lacking ARM32 platform for testing on it, so firstly upstream to support ARM64 platform. This patch series is firstly to support 'per-thread' recording tracing data, but we also need to verify the script can dump trace disassembler CPU wide tracing and kernel panic kdump tracing data. I also verified this patch series which can work with kernel panic kdump tracing data, because Mathieu is working on CPU wide tracing related work, so after this we need to retest for CPU wide tracing and kdump tracing to ensure the python script can handle well for all cases. You are very welcome to test the script in this patch series, your testing result and suggestion are very valuable to perfect this script to cover more cases. Changes from v1: * According to Mike and Rob suggestion, add the fixing to generate samples for the start packet and exception packets. * Simplify the python script to remove the exception prediction algorithm, we can rely on the sane exception packets for disassembler. [1] https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git Leo Yan (4): perf cs-etm: Generate sample for missed packets perf script python: Add addr into perf sample dict perf script python: Add script for CoreSight trace disassembler coresight: Document for CoreSight trace disassembler Documentation/trace/coresight.txt | 52 +++++ tools/perf/scripts/python/arm-cs-trace-disasm.py | 234 +++++++++++++++++++++ tools/perf/util/cs-etm.c | 35 ++- .../util/scripting-engines/trace-event-python.c | 2 + 4 files changed, 316 insertions(+), 7 deletions(-) create mode 100644 tools/perf/scripts/python/arm-cs-trace-disasm.py -- 2.7.4