From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DE8F3D3C52B for ; Thu, 17 Oct 2024 18:29:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SAcYZ5pNgWWwPTzMpnUoeBvgcAnygGHRta118hfCipc=; b=LaxLDk/nK9eNHTUXOhawjdYnYy uUBYKpWhW+c6sE/k/847FUE2Xx+ChNKk79CeW8c2Ei4GPOxDFf7IANC6t7EIMfrJqTPZmWPmIsqFH Zq+QEnnm5XcGwRikVRd0WyyzU0bgd6UIO5lsUrFXYnMICX+v6TyeA2+AWTLxE584qeyvOXHoUlTsx BdKK4wCaPUULKmhd6cXOkORD0kuxT+FniDZpAPiqPRPHRPDHLvIY1Ln6PWPhasu+mCdsZm694oH3l 8+0M5rF2ttoyAQeor+j/hS1V0FGwMUPaPsKrzfs308Go5N8Lpm0EEQ+uIOYaZJMvL0wxcpfDRsCoJ 3/81eG5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1VFn-0000000Fsle-2CJX; Thu, 17 Oct 2024 18:29:43 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1VEI-0000000Fsbq-0Trt for linux-arm-kernel@lists.infradead.org; Thu, 17 Oct 2024 18:28:14 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id C41DA5C5AAD; Thu, 17 Oct 2024 18:28:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27E70C4CEC3; Thu, 17 Oct 2024 18:28:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729189688; bh=AoIed/N7k1ZZM3rEVarj8fVcw6zr40hczB+jk7boO+s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OPHcD/CfXX4CRpL87wS+2WR0nF17jQ/wTDtZ+gdJvzxzN7V+dDnfninD0ei4PLq82 J9lNYEaknLYSz2sOTdmgw41BSh+FHOXJieFrrqcWei62sY0B2bK6wRN1vOs33sNCV4 7xpCtnlhLSaZmJD9VKSSbNF/rWBvBIHWguMk9ngfgsxPnjGHOnGOhuZu2h78H5cPuq WXnBCJHcLJ9HIcqeSBEUuQ4vYw/8+HROF9ILPIiOkHIN8JzZ+LFXHoyUgpNpQeDj5w dgrM4/wWzESjiuFcxfb3MvV82rx2WGtzOi3fXiTSXOA2vMU4ijcs1AkEcg/GVHomTF IVjiH+Df00pxg== Date: Thu, 17 Oct 2024 11:28:06 -0700 From: Namhyung Kim To: Leo Yan , Steve Clevenger Cc: james.clark@linaro.org, mike.leach@linaro.org, suzuki.poulose@arm.com, ilkka@os.amperecomputing.com, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH V9 2/2] Adjust objdump start/end range per map pgoff parameter Message-ID: References: <6107521c4fb1d4ba2da57a6d81c17b54f259feac.1728599785.git.scclevenger@os.amperecomputing.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241017_112810_415907_14E4215E X-CRM114-Status: GOOD ( 24.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Leo, On Thu, Oct 17, 2024 at 12:01:28PM +0100, Leo Yan wrote: > On 10/11/24 18:17, Steve Clevenger wrote:> > > Extract map_pgoff parameter from the dictionary, and adjust start/end > > range passed to objdump based on the value. > > > > A zero start_addr is filtered to prevent output of dso address range > > check failures. This script repeatedly sees a zero value passed > > in for > >       start_addr = cpu_data[str(cpu) + 'addr'] > > > > These zero values are not a new problem. The start_addr/stop_addr warning > > clutters the instruction trace output, hence this change. > > > > Signed-off-by: Steve Clevenger > > --- > > tools/perf/scripts/python/arm-cs-trace-disasm.py | 16 +++++++++++----- > > 1 file changed, 11 insertions(+), 5 deletions(-) > > > > diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py > > index 7aff02d84ffb..e29a4035723c 100755 > > --- a/tools/perf/scripts/python/arm-cs-trace-disasm.py > > +++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py > > @@ -187,6 +187,10 @@ def process_event(param_dict): > > dso_start = get_optional(param_dict, "dso_map_start") > > dso_end = get_optional(param_dict, "dso_map_end") > > symbol = get_optional(param_dict, "symbol") > > + map_pgoff = get_optional(param_dict, "map_pgoff") > > + # check for valid map offset > > + if (str(map_pgoff) == '[unknown]'): > > + map_pgoff = 0 > > I tried to apply this patch, it reports warning: > > Applying: Adjust objdump start/end range per map pgoff parameter > .git/rebase-apply/patch:16: space before tab in indent. > map_pgoff = 0 > warning: 1 line applied after fixing whitespace errors. > > This means it has unexpected spaces in above line. > > > When applying patches, I found the prefix is missed in the subject: > > perf scripts python cs-etm: Adjust objdump start/end range per map pgoff parameter It could simply be "perf script cs-etm:" but it's up to you. :) > > With above fixing: > > Reviewed-by: Leo Yan Thanks for your review! Steve, can you please send v10 with the fixes? Thanks, Namhyung > > > cpu = sample["cpu"] > > ip = sample["ip"] > > @@ -243,9 +247,10 @@ def process_event(param_dict): > > # Record for previous sample packet > > cpu_data[str(cpu) + 'addr'] = addr > > > > - # Handle CS_ETM_TRACE_ON packet if start_addr=0 and stop_addr=4 > > - if (start_addr == 0 and stop_addr == 4): > > - print("CPU%d: CS_ETM_TRACE_ON packet is inserted" % cpu) > > + # Filter out zero start_address. Optionally identify CS_ETM_TRACE_ON packet > > + if (start_addr == 0): > > + if ((stop_addr == 4) and (options.verbose == True)): > > + print("CPU%d: CS_ETM_TRACE_ON packet is inserted" % cpu) > > return > > > > if (start_addr < int(dso_start) or start_addr > int(dso_end)): > > @@ -262,13 +267,14 @@ def process_event(param_dict): > > # vm_start to zero. > > if (dso == "[kernel.kallsyms]" or dso_start == 0x400000): > > dso_vm_start = 0 > > + map_pgoff = 0 > > else: > > dso_vm_start = int(dso_start) > > > > dso_fname = get_dso_file_path(dso, dso_bid) > > if path.exists(dso_fname): > > - print_disam(dso_fname, dso_vm_start, start_addr, stop_addr) > > + print_disam(dso_fname, dso_vm_start, start_addr + map_pgoff, stop_addr + map_pgoff) > > else: > > - print("Failed to find dso %s for address range [ 0x%x .. 0x%x ]" % (dso, start_addr, stop_addr)) > > + print("Failed to find dso %s for address range [ 0x%x .. 0x%x ]" % (dso, start_addr + map_pgoff, stop_addr + map_pgoff)) > > > > print_srccode(comm, param_dict, sample, symbol, dso) > > -- > > 2.44.0 > >