Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp994936rdd; Wed, 10 Jan 2024 05:51:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IHCnz/yflk1JQtOj/CH80wQhFxYKt7MQ38GBnK0veIHLO6WSIWEPZEb2ye/LmFB3SuxQEj8 X-Received: by 2002:a25:97c4:0:b0:dbf:109d:eae1 with SMTP id j4-20020a2597c4000000b00dbf109deae1mr802095ybo.65.1704894666372; Wed, 10 Jan 2024 05:51:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704894666; cv=none; d=google.com; s=arc-20160816; b=bgkX4wIwic+tH6X2tPpps6Up9U8S89K0AmETFIWgZrmPi9OXFbbZwNCQNRg0L3k0e8 uyxFjtchYHC3DbX9FZfMIDskhE+GsVrC8bt6+iCDKfCICW3avm/Dkq0d0SqVtnakIEM2 oZrVwVhj/whQL0GH6XmT7sPW/EObbYOafhoInsun9bhj2+roiQa9wFFBYsLlyeP2p5th UZTVepSaN3hJgN+fKnP5oPrqFpOcd6PtZJuPofw5FrMCSVa+W2SJJFF/Voy5pbzGi0// PBqmsxsA4MuFhvUHzP4YEwlK/CMosE7IQdVSyvN/utBBSH4COTE33x5jOCVAUlvwE1/l cseg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=VNSvpwp+XotDbnjrjaira6v/wRi0s+PK2KTYadR4kKs=; fh=uW3LAuahvPtPu6gGfJ/ZquzZuds6egWzW+VjXxBisCU=; b=Tw4Ngs5j1AwkDZ2qtyIbb47eVPsIbkJQyZ//uvdG2rqBbDP3xDI1+MHQN5++fFE4Ri BungLLAMrxtKPuL9N8DGOx4gLuFzMKLcNDowFn6C2lzEB/WhSPE+j+Yig9vMssjKEA0i Tt5JftFz4bdasAI5LM2r2MtwGz5tpN3++1JDxKdzARtkOV/gxRLaKHIiN3Oaa6vS4CPH 84KYzQzb0tt5zgz5Z422OWPj9gMgVlVYKC5NpwIg2L5Iedh0JjoI8GO0kywzR9a9Ik8y JURks34D2syj+UNxY705mPD5402IZTkGSDc0fCspTA5tip0S+unLF2A6R97CviASYBGu 8LFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-22277-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22277-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v10-20020a05622a014a00b004299fbe241dsi4332593qtw.519.2024.01.10.05.51.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 05:51:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22277-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-22277-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22277-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 109831C220D0 for ; Wed, 10 Jan 2024 13:51:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4656148CF2; Wed, 10 Jan 2024 13:49:00 +0000 (UTC) Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 911F04CB21; Wed, 10 Jan 2024 13:48:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=tianruidong@linux.alibaba.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---0W-MODhG_1704894525; Received: from 30.212.171.107(mailfrom:tianruidong@linux.alibaba.com fp:SMTPD_---0W-MODhG_1704894525) by smtp.aliyun-inc.com; Wed, 10 Jan 2024 21:48:47 +0800 Message-ID: Date: Wed, 10 Jan 2024 21:48:44 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/1] perf scripts python: arm-cs-trace-disasm.py: add option to print virtual address To: Leo Yan Cc: linux-kernel@vger.kernel.org, james.clark@arm.com, 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, al.grant@arm.com, mathieu.poirier@linaro.org, tor@ti.com, acme@redhat.com References: <20231214123304.34087-1-tianruidong@linux.alibaba.com> <20240110025617.66646-1-tianruidong@linux.alibaba.com> <20240110025617.66646-2-tianruidong@linux.alibaba.com> <20240110125544.GG44@debian-dev> Content-Language: en-US From: Ruidong Tian In-Reply-To: <20240110125544.GG44@debian-dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Leo: Thank you very much for your advice. I will remove your SoB and add 02 and 03 patch in V3. 在 2024/1/10 20:55, Leo Yan 写道: > Hi Ruidong, > > On Wed, Jan 10, 2024 at 10:56:17AM +0800, 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 >> Signed-off-by: Leo Yan > I only gave suggestion, it's no need to add my SoB and this might break > the SoB chain and rejected by maintainers. > > So with removing my SoB, the patch is fine for me: > > Reviewed-by: Leo Yan > > I would like to suggest you to resend patch set v2 with all patches > - though patches 02 and 03 have no any change, but it would be easier > for maintainers to pick up the whole patches (especially this can save > time with b4 tool). > > Thanks, > Leo > >> --- >> 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): >> -- >> 2.33.1 >>