Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp45654imm; Mon, 21 May 2018 01:54:47 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr3YVfdGRJWWsPevyQjkTD9Zv/vznnuV83sKqrPR5uz2loZDzZmEcyPs8xaE8tbvhsKvftO X-Received: by 2002:a17:902:aa8e:: with SMTP id d14-v6mr12060936plr.344.1526892887433; Mon, 21 May 2018 01:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526892887; cv=none; d=google.com; s=arc-20160816; b=NuH80SjbVJ+baQyYAviakCF6/IJe7C9Z4L+zTFJGE7JsMfroGDCL/Uu0hZ+CQQwDlY r2be1RZ4tKXVlVUh/AP67YJOb7emO5pGVMqMFDjXdH6Ku+ubGmJ08rTgJE9nDBJ4h8CA Zw9H2H8vpDCvEwM7lmm64yo0j0QwOIwJirrP52Ux6Ybp864X30TvR6CDPsHjPQw2GCMD 2I//pr3c2x8yDOQdvhbwI2148URN+ah+JTp1qWDJ8htdYlGbrAD5J9dPnDH5+KtNchvs ie1axitSSCD5h7Fo7LdC779fcU/y5CRxQeJXpTqIyqHOfthRwFwStLAs+AxJTSx0ohFq SdQQ== 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=NnN/fhGrSR8SrEds0HmRI/5r4C+zJoMVSRbsuhZ0Y3Y=; b=BvTAUHmr7CTcp9ysGqHpYL0vdz7HSvbm/Upx12KaKL7ZQDOsVxLMCslSotLrxuhnHY glBjrMnaz/fyU2vN1HIREPqH0owJSsGs+FifH+L8ujluWHBvdGxtEXeJrNc2mZZwO/iS dRjLPDxalkzE8vEaj8+kgk0u7J7VNzcBLKJEISBR0yhxKZFkFE88S+wt7CFKvFEXFEz4 8oMsnoQuw5KVKNfDUZF+0wrUL3+sevOPxycmxSf8M33FWwLLft1HSx2aGHUuDzwrMydG AcI3MJdT2jnz55ENBiVXDcOhde+wtRb3QjrB+ZXxZ7CB2/qWbl2ynn47ACnNp4gN5FnV p/EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Myu1ilwl; 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 t2-v6si3246788plj.389.2018.05.21.01.54.33; Mon, 21 May 2018 01:54:47 -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=Myu1ilwl; 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 S1752586AbeEUIyE (ORCPT + 99 others); Mon, 21 May 2018 04:54:04 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:41248 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751073AbeEUIyA (ORCPT ); Mon, 21 May 2018 04:54:00 -0400 Received: by mail-pf0-f193.google.com with SMTP id v63-v6so6755813pfk.8 for ; Mon, 21 May 2018 01:53:59 -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=NnN/fhGrSR8SrEds0HmRI/5r4C+zJoMVSRbsuhZ0Y3Y=; b=Myu1ilwl1cX/e+DgnWHGowuOZYQcc6J3QGoDMvIwz8KULGpSPGEGOAOjk1nTuMV3cD QQfkeldDdwlzhz2PclCVUIhdvyp8CWM1WUyTZ/K4pzsiGXQhOC8nT3PIAgmuwc7FPEwR wR/4tdETaXc15BMZOUuWfTLJDWbYghUMbQqIE= 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=NnN/fhGrSR8SrEds0HmRI/5r4C+zJoMVSRbsuhZ0Y3Y=; b=J4hb+Rj0Hgit9qqhrZ0ZBUfh1bWK0aSbol48HtEC6yN0uHqbDRGdnNMeuWPAw8gbyg OWkOYPHiuWitL2nRCnwmZJf1uA42nw7KGqQOSkicSkBsziPSp1XCf+XD6RHvHjeOlmXC wR2nUHgeLt23FreBO1FReiCiUVdGiVqxYN4S4IIQ9ayRVlaDB5wAb4X26INpsyIThSI/ 4SRSrHGtwTROA03pw1FWPDSB8WJOkdrbBOU/YZ3URe7AdDxDDNelbvS4lIwMHEcN9yFf r86HBgfWPrYPP8kkEAcOAckm+KqC5hqtzV+CfS1lr2N7nBLxZmIhbTSTNmGuQfjsKLTA Wvfw== X-Gm-Message-State: ALKqPweiRS2GKN4XfL2/yPcBLdlHr+pmxVDq5PYiKPMIhfcXIwXnqfEG VNnSlli3478xeniU4fFWnSTKcQ== X-Received: by 2002:a62:9d89:: with SMTP id a9-v6mr19171509pfk.206.1526892839364; Mon, 21 May 2018 01:53:59 -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.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 May 2018 01:53:58 -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 4/4] coresight: Document for CoreSight trace disassembler Date: Mon, 21 May 2018 16:52:28 +0800 Message-Id: <1526892748-326-5-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526892748-326-1-git-send-email-leo.yan@linaro.org> References: <1526892748-326-1-git-send-email-leo.yan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit documents CoreSight trace disassembler usage and gives example for it. Signed-off-by: Leo Yan --- Documentation/trace/coresight.txt | 52 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/Documentation/trace/coresight.txt b/Documentation/trace/coresight.txt index 6f0120c..b8f2359 100644 --- a/Documentation/trace/coresight.txt +++ b/Documentation/trace/coresight.txt @@ -381,3 +381,55 @@ 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 + + +Tracing data disassembler +------------------------- + +'perf script' supports to use script to parse tracing packet and rely on +'objdump' for disassembled lines, this can convert tracing data to readable +program execution flow for easily reviewing tracing data. + +The CoreSight trace disassembler is located in the folder: +tools/perf/scripts/python/arm-cs-trace-disasm.py. This script support below +options: + + -d, --objdump: Set path to objdump executable, this option is + mandatory. + -k, --vmlinux: Set path to vmlinux file. + -v, --verbose: Enable debugging log, after enable this option the + script dumps every event data. + +Below is one example for using python script to dump CoreSight trace +disassembler: + + $ perf script -s arm-cs-trace-disasm.py -i perf.data \ + -F cpu,event,ip,addr,sym -- -d objdump -k ./vmlinux > cs-disasm.log + +Below is one example for the disassembler log: + +ARM CoreSight Trace Data Assembler Dump + ffff000008a5f2dc : + ffff000008a5f2dc: 340000a0 cbz w0, ffff000008a5f2f0 + ffff000008a5f2f0 : + ffff000008a5f2f0: f9400260 ldr x0, [x19] + ffff000008a5f2f4: d5033f9f dsb sy + ffff000008a5f2f8: 913ec000 add x0, x0, #0xfb0 + ffff000008a5f2fc: b900001f str wzr, [x0] + ffff000008a5f300: f9400bf3 ldr x19, [sp, #16] + ffff000008a5f304: a8c27bfd ldp x29, x30, [sp], #32 + ffff000008a5f308: d65f03c0 ret + ffff000008a5fa18 : + ffff000008a5fa18: 14000025 b ffff000008a5faac + ffff000008a5faac : + ffff000008a5faac: b9406261 ldr w1, [x19, #96] + ffff000008a5fab0: 52800015 mov w21, #0x0 // #0 + ffff000008a5fab4: f901ca61 str x1, [x19, #912] + ffff000008a5fab8: 2a1503e0 mov w0, w21 + ffff000008a5fabc: 3940e261 ldrb w1, [x19, #56] + ffff000008a5fac0: f901ce61 str x1, [x19, #920] + ffff000008a5fac4: a94153f3 ldp x19, x20, [sp, #16] + ffff000008a5fac8: a9425bf5 ldp x21, x22, [sp, #32] + ffff000008a5facc: a94363f7 ldp x23, x24, [sp, #48] + ffff000008a5fad0: a8c47bfd ldp x29, x30, [sp], #64 + ffff000008a5fad4: d65f03c0 ret -- 2.7.4