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 9E79CC35274 for ; Mon, 18 Dec 2023 20:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To: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=aFBXuXu2gAeHuw5ah7iSybQX8REDaXzUSCdJ8ehQMyc=; b=gD4JEhWbMaXsPD h+DcklKrnhDo2qt1Xuh+jhcIggXymOsRTX3B6RLLYQ746m0fL2YMQv7BlivhXs+I7zkZAuUOJtzbW B5ixk+pxEDoioq9agHv7t/XhaUIHpT9X/lbBAGVk5PNCLNk7k7huHiOtxJ4TIpwZRG098Cd2UAE85 bqTAV4RtUCQ9fb1Je3VkZwGWIKpjgEmtFnOBVgF8OYbYDkyHYsqdI3oZ8Q4m520FupC/1y/+28hcS 2Fz02HJEK06WSyI9FVNZftF30eijpxwRiDDQX/Rt3q8G9lp6cLH6dGInbfrdUApnkEbQQ7pE9hHFl dXjzk+lEbKULZfxbpqYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFKE6-00C16R-2E; Mon, 18 Dec 2023 20:28:34 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFKE5-00C15o-20 for linux-arm-kernel@bombadil.infradead.org; Mon, 18 Dec 2023 20:28:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=H0WXZ4eK5rkueP96RmX9eoxp3kKL9sNM0h5vRiPThSs=; b=S6Jh9ixCq12FLv2L55v3o6K5Z5 6vGBqBMKsDXqNG3uEwjKd7U+aBe5p0wWvm1VvngkAJWHlWSqSXTcSzEmPPQMzDYgMmnpdrh9CejeY cfwcQs0Atw0RpY4d68VrOlnsS+cY1oxv83eE4aeaCpyT2gsHrf10LsV6p09qIZwyvDvF7uu1j/r23 h0UAXE4JMLbHSDxEC+DTHUoZUoKn60s9xdzwm29JAxiud9JtFgWpLNJuH+kq+nR4ZG6xO1n70VtFK nIBrwrXkRF97a1MRUGEhlXB4KG0BuZiGBCWtn05E36xL6SvzQJVLEN3cnQkDExset6EkaRdOZzKwp bqosMPug==; Received: from [187.19.173.117] (helo=quaco.ghostprotocols.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rFKE3-00DG1R-17 for linux-arm-kernel@lists.infradead.org; Mon, 18 Dec 2023 20:28:32 +0000 Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 013C5403EF; Mon, 18 Dec 2023 17:28:26 -0300 (-03) Date: Mon, 18 Dec 2023 17:28:26 -0300 From: Arnaldo Carvalho de Melo To: Ruidong Tian , Leo Yan , Al Grant , Mathieu Poirier , Tor Jeremiassen 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, leo.yan@linaro.org Subject: Re: [PATCH 3/3] perf scripts python: arm-cs-trace-disasm.py: do not ignore disam first sample Message-ID: References: <20231214123304.34087-1-tianruidong@linux.alibaba.com> <20231214123304.34087-4-tianruidong@linux.alibaba.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231214123304.34087-4-tianruidong@linux.alibaba.com> X-Url: http://acmel.wordpress.com 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Em Thu, Dec 14, 2023 at 08:33:04PM +0800, Ruidong Tian escreveu: > arm-cs-trace-disasm ignore disam the first branch sample, For example as > follow, the instructions beteween 0x0000ffffae878750 and > 0x0000ffffae878754 is lose: Leo, Mathieu, Tor, Al, can you guys take a look and provide an Acked or Reviewed-by tag? Thanks, - Arnaldo > ARM CoreSight Trace Data Assembler Dump > Event type: branches:uH > Sample = { cpu: 0000 addr: 0x0000ffffae878750 phys_addr: 0x0000000000000000 ip: 0x0000000000000000 pid: 4003489 tid: 4003489 period: 1 time: 26765151766034 } > Event type: branches:uH > Sample = { cpu: 0000 addr: 0x0000000000000000 phys_addr: 0x0000000000000000 ip: 0x0000ffffae878754 pid: 4003489 tid: 4003489 period: 1 time: 26765151766034 } > > Initialize cpu_data earlier to fix it: > > ARM CoreSight Trace Data Assembler Dump > Event type: branches:uH > Sample = { cpu: 0000 addr: 0x0000000000000000 phys_addr: 0x0000000000000000 ip: 0x0000ffffae878754 pid: 4003489 tid: 4003489 period: 1 time: 26765151766034 } > 0000000000028740 : (base address is 0x0000ffffae850000) > 28750: b13ffc1f cmn x0, #4095 > 28754: 54000042 b.hs 0x2875c > test 4003489/4003489 [0000] 26765.151766034 __GI___ioctl+0x14 /usr/lib64/libc-2.32.so > Event type: branches:uH > Sample = { cpu: 0000 addr: 0x0000ffffa67535ac phys_addr: 0x0000000000000000 ip: 0x0000000000000000 pid: 4003489 tid: 4003489 period: 1 time: 26765151766034 } > > Signed-off-by: Ruidong Tian > --- > .../scripts/python/arm-cs-trace-disasm.py | 21 ++++++++++--------- > 1 file changed, 11 insertions(+), 10 deletions(-) > > diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py > index c9e14af5b58c..b1eb4293cbef 100755 > --- a/tools/perf/scripts/python/arm-cs-trace-disasm.py > +++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py > @@ -190,6 +190,17 @@ def process_event(param_dict): > dso_end = get_optional(param_dict, "dso_map_end") > symbol = get_optional(param_dict, "symbol") > > + cpu = sample["cpu"] > + ip = sample["ip"] > + addr = sample["addr"] > + > + # Initialize CPU data if it's empty, and directly return back > + # if this is the first tracing event for this CPU. > + if (cpu_data.get(str(cpu) + 'addr') == None): > + cpu_data[str(cpu) + 'addr'] = addr > + return > + > + > if (options.verbose == True): > print("Event type: %s" % name) > print_sample(sample) > @@ -211,16 +222,6 @@ def process_event(param_dict): > if (name[0:8] != "branches"): > return > > - cpu = sample["cpu"] > - ip = sample["ip"] > - addr = sample["addr"] > - > - # Initialize CPU data if it's empty, and directly return back > - # if this is the first tracing event for this CPU. > - if (cpu_data.get(str(cpu) + 'addr') == None): > - cpu_data[str(cpu) + 'addr'] = addr > - return > - > # The format for packet is: > # > # +------------+------------+------------+ > -- > 2.33.1 > > -- - Arnaldo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel