Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp303830rdb; Wed, 17 Jan 2024 02:26:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHr2g0e/ttlfWqfVRY9epALa5MqhORW/+UCT+//mKaeyLaLDjOM/2OJNvRV10gznXT7+lAd X-Received: by 2002:a05:6402:38c:b0:559:391e:51d2 with SMTP id o12-20020a056402038c00b00559391e51d2mr1278171edv.128.1705487171843; Wed, 17 Jan 2024 02:26:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705487171; cv=pass; d=google.com; s=arc-20160816; b=xxlUjYwDSGDyCbt1Gm7H6BY7SlEgVE7WGcwGrr4Xwc4QZML+0Rq+qL9IjcL+KPpOE2 Y+B7PHF6E6z9ptODPIh54+34AJzFuqcP0oXf1LlgBznq2XZ7cAUfG+x5fH0nt4DEN4Nh aBp4gJ8UVnMdA/VVw8yiTIde+cuqhKI5C1IX1NefkQ+1NjeHFHkSF3sYCdJLOU9xs7rU bnMFA1/Umy4jeg1r0uSkr8E5Ff2PFw9ZMcyIwZYzCb4nzyTmOHO1f3VcQz4dRW4/Z7Bj 9UvY5MOsXiXFyASeAMBkd+BmPsH/O35okCY/IUgiTKm74udp7X4ZNBYN1SI7NxjamwIe fwCQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=Opo3UYJAzARwkzQDlHbrMrW7gxoDW7th3hBvYj72VRo=; fh=ZFKVi2es5n47ouapEVqO1zmV1KHdoZ676SFGRdbsYmk=; b=0hGiDR+R96kSh6aGqgIdDemrjP3fd/+zBrJSdsH7upvwwx1E+cp9qCc+kGwl88C3vm +yTHj1FP4k6KQG3kAq4djN2ah4B0DtxSjDTCsqSQjQhaZF3XCOWMqd2MidW3Ntp14jBi Ktb6cTFb5AuTUNDMyFDIlDTVCwbETHG7tfAxWwnBmONJlDfJS/TL28vlRq9jGF4cbsvJ 6lyiwooaq38kRKRz67dnv2WHOVjodvuZPWjapfJ0wnYUQ5tsNo37y1BS2tr7FjlRbFyf 6yReWDk3jf5tnnJQyoEz+usS5daU3JDPeehYK7ppmb8N2YbU1Azjpyb4gxP6YoXhgIrz 2jZw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-28817-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28817-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h2-20020a0564020e8200b0055791e14d25si5923128eda.615.2024.01.17.02.26.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 02:26:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-28817-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-28817-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28817-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B2C831F27127 for ; Wed, 17 Jan 2024 10:16:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 28D3814A83; Wed, 17 Jan 2024 10:16:09 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A64F14266; Wed, 17 Jan 2024 10:16:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705486568; cv=none; b=a7oGdEVzethumJe6sBDQJueB3sNHE3kFheaGjNECDT+eEe0U1hLI8r0Rwf57Wl4WCH17j6dEKG/N7OOBc70EqDws8U3JI9M+n2UA7ja257ulbroN/EGTtyHvSQzazONF7K+oB56LkZnITq+E4hI4DBH12xxIG3WhEhWSXY/wY2o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705486568; c=relaxed/simple; bh=iPYbxrB9RyA+DzLuG6LUAcCcNNcI6mgcuERiNUVMUEk=; h=Received:Received:Message-ID:Date:MIME-Version:User-Agent:Subject: Content-Language:To:Cc:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; b=LFSAiPG+oMAb2LzQpHwMtdjyjbDo/Gq0BDFG/P+QQwP94Q+Cb/Lq5VBFQZ6EskUFak6KITRYVuHxEm4dS6XcBNGurWNS+ymG4uoJ68wBIcQiIOcI4/0cZ2+gjAZLxlQxVR6WBHXW2UFJSUGQU7CMtjGlGOt2fptjfl7RlYgMJMs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 17F2D11FB; Wed, 17 Jan 2024 02:16:52 -0800 (PST) Received: from [192.168.1.100] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3484E3F5A1; Wed, 17 Jan 2024 02:16:04 -0800 (PST) Message-ID: <7861aef3-8c0f-8ab3-6bd5-243eba3200b8@arm.com> Date: Wed, 17 Jan 2024 10:16:03 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v3 1/1] perf scripts python: arm-cs-trace-disasm.py: add option to print virtual address Content-Language: en-US To: Ruidong Tian , linux-kernel@vger.kernel.org Cc: coresight@lists.linaro.org, suzuki.poulose@arm.com, mike.leach@linaro.org, alexander.shishkin@linux.intel.com, linux-arm-kernel@lists.infradead.org, adrian.hunter@intel.com, linux-perf-users@vger.kernel.org, leo.yan@linaro.org, al.grant@arm.com, mathieu.poirier@linaro.org, tor@ti.com, acme@redhat.com References: <20231214123304.34087-1-tianruidong@linux.alibaba.com> <20240116020854.56030-1-tianruidong@linux.alibaba.com> <20240116020854.56030-2-tianruidong@linux.alibaba.com> From: James Clark In-Reply-To: <20240116020854.56030-2-tianruidong@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 16/01/2024 02:08, Ruidong Tian wrote: > arm-cs-trace-disasm just print offset for library dso now: > > 0000000000002200 : > 2200: d503201f nop > 2204: 8b020024 add x4, x1, x2 > 2208: 8b020005 add x5, x0, x2 > > Add a option `-a` to print virtual offset other than offset: > > # perf script -s scripts/python/arm-cs-trace-disasm.py -- -d llvm-objdump -a > ... > ffffb4c23200 : > ffffb4c23200: d503201f nop > ffffb4c23204: 8b020024 add x4, x1, x2 > ffffb4c23208: 8b020005 add x5, x0, x2 > ... > > Signed-off-by: Ruidong Tian > Reviewed-by: Leo Yan I think your s-o-b should always come last, so these should be the other way around. Also patch 3 is missing on v3 for some reason so you might want to resend. No need to send it as a reply to the thread, you can just send it as a complete new one. Thanks James > --- > tools/perf/scripts/python/arm-cs-trace-disasm.py | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py > index d973c2baed1c..78419498237e 100755 > --- a/tools/perf/scripts/python/arm-cs-trace-disasm.py > +++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py > @@ -36,7 +36,10 @@ option_list = [ > help="Set path to objdump executable file"), > make_option("-v", "--verbose", dest="verbose", > action="store_true", default=False, > - help="Enable debugging log") > + help="Enable debugging log"), > + make_option("-a", "--vaddr", dest="vaddr", > + action="store_true", default=False, > + help="Enable virtual address") > ] > > parser = OptionParser(option_list=option_list) > @@ -108,6 +111,14 @@ def print_disam(dso_fname, dso_start, start_addr, stop_addr): > m = disasm_re.search(line) > if m is None: > continue > + > + # Replace offset with virtual address > + if (options.vaddr == True): > + offset = re.search(r"^\s*([0-9a-fA-F]+)", line).group() > + if offset: > + virt_addr = dso_start + int(offset, 16) > + line = line.replace(offset.lstrip(), "%x" % virt_addr) > + > print("\t" + line) > > def print_sample(sample):