Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp90263rdh; Mon, 18 Dec 2023 12:28:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGrpG8nFc8zxvTBvvxhB1Ziq+RY1OvGIAZSvqFdTETg8CqzmwNXSVyTzNmn2sc+yo9a5t6y X-Received: by 2002:a05:6808:1185:b0:3b8:b063:505d with SMTP id j5-20020a056808118500b003b8b063505dmr19369237oil.94.1702931335174; Mon, 18 Dec 2023 12:28:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702931335; cv=none; d=google.com; s=arc-20160816; b=kUn0xA14HxzTs7ixj4i+PlvqerdglKh69P11Pu3QiwsmPiYlR8J8sdFgMuio2jNkEP W7cZW2cieroo1mPM15ZNn3TrYOflJWzPed7rVN2JlqBz0BL7oOCtz3BcnQeRWw2XZkmt 1DMS6e2+m8npDVfDusAIz0otW6TVr7JXuwz7OSqojHWTW5+B3O0VzrXG5LhRFpnYe7iX CV+x9bTwqCPSRi4k6jp/Ts/3hYSaQiMhRzdTqdR+WVeWkH6+VBKkPuTLFgbZFKrSv1VR asLKguCHo+9Xgk54iUpP26SD7tK0DPMTdUNazNd/SF+FPPxBH58RFEAA7tPfDE6p8ASa I3uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=H0WXZ4eK5rkueP96RmX9eoxp3kKL9sNM0h5vRiPThSs=; fh=iHTV9Dhfiu3jRfgPyAPcwDLh1+EOz5pEyWN9Y2uX42A=; b=yLFlcYjx9JxMHS5k6EwEjNsn3FLsw8Tb3soDW/q57EI9vepHF2DsF2owLQrrfa3KFi 3DhyWvHJEJJZWsi3u7ND/qoZ/PZRH/LsE59MlYyS9bZMuFAZvMPKOCqHCOPiD0dHVOae CUZRyeiMpxuiY8XCW9DY3mkhhjyD1+2cvpCqBMDDZgXe+KtpZ0QJ+Owpgec0zkQqWbYP VwFw+SPc78d5ZZLiSJ9vQnuHiRJFw6W4fxyW7Ly9d9u6CkQh/mHQWmKZGfi8CC6b7Ds/ M2JZ/RKC/RLOW6fgftZ1U4Fj7nXclEMTFWabeh0LuUAsZ6cXFLV0BwoZnk/m9lG319ER eAeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZVXLP8iN; spf=pass (google.com: domain of linux-kernel+bounces-4349-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4349-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y10-20020a0cf14a000000b0067f2cb79298si5782596qvl.479.2023.12.18.12.28.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 12:28:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4349-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZVXLP8iN; spf=pass (google.com: domain of linux-kernel+bounces-4349-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4349-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 D59D81C21C37 for ; Mon, 18 Dec 2023 20:28:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A804274095; Mon, 18 Dec 2023 20:28:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZVXLP8iN" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D3D9674087; Mon, 18 Dec 2023 20:28:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AF75C433C7; Mon, 18 Dec 2023 20:28:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702931311; bh=kpXVz9PvRV+yBmv+nia5KSt6ZJ4jUse2LKadXu0V02A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZVXLP8iNFWufEbY2HI3n0/mtxhbcgCKJZpodg8x1LWUzhXUG+iVuFf7JAYfWrdiCo xLYOOwjwGZQFSfTZYtkZpcNARwl88o1B9tmvYiSgLjXwEqJFGLdVPsNbtizrHTmjW1 O8S7KJnEapCIW29DsOmoZJhPZs0jhnDwTYwweOaGajV/thyLCnMifmIXCWtxbpb4Kz +1RjXp0GCSMs7CEXaNeIB9kJOB+ZC3ZgfqMZ9xV9e5E2PwwwW+V+w3doufDh/gQnBk 4yv6OmAzs3ZB1gBZxZad7obdk7E+D2Cn6OO3vy9qyV45xSKlbjFdDPj8Ryt6+5SzYV HQrCx3wTFcbzA== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231214123304.34087-4-tianruidong@linux.alibaba.com> X-Url: http://acmel.wordpress.com 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