Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5949242rdb; Thu, 14 Dec 2023 04:33:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEbua3PdgquwGh9DIr3N02WIUbb6i9GLNy2+19l7VhTmiOs95ebO/ubbPmfQkoTGz0R4K/k X-Received: by 2002:aa7:88c3:0:b0:6d0:d6f7:853b with SMTP id k3-20020aa788c3000000b006d0d6f7853bmr1544311pff.1.1702557227585; Thu, 14 Dec 2023 04:33:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702557227; cv=none; d=google.com; s=arc-20160816; b=kSOfEgnrPohD3e/G7VIZypNZLqWmdy4bZK5pKuiKbYZ3c0acX8WVxJVHA/L6NObFDP 0r4/mAYW71DVF/8YMtm/TKE4BDw1UGSfMb0fG57hRyQZ6BsLzTtaynz70EdUoxlBRPg/ gX89Kunmrv6mWBcCz0MrtTrSEqKk50LxBcwvLevEgJBqsitph+3zClLWFo2vvnx7JiCm xXDUqsTncpEu6ymB7univ7KzBtxByq0C4vJBoWB/EKrZuRlC9ntKVpWsMMPtdlr9//hK Dozu8z7bQ/IduKqXmNsrOx9cPBvn7Mw4M3spxM5Vt3hQUKZGbMYiLkbKE4xlDcShObdy OdjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=8aJ2YrOG+eFK2YK8clHoBBgwPHhC0BnzWnzziuEMjdA=; fh=2C1f0j/nzSygmX2ABc+8OQYD53hkUy28AVWbjAwc8E0=; b=RcZvSIIs8jej6oNIxESU/IzAjnuZAV6EfIMOaGyCE/MnzoLsKToGaogxTZkL5xVLxg QeJVBNZWXWgh9WZI6V/PC2Iku1vIQFE+hUDyoUcy12Rvljcd+Va+fL8WrjdchXplgy4l yj6g2UwDsUg1cYwOESd+RfqbBSHnpNJw8cf8EzxmFOv84srZu9E1HlhLD3gafzsIOnyV oycbrmkiM1MUuJAFmHi52XU0fQM9nxADUObTT5GbIaudsejydEnZTpAgEU75zdlNVtJQ su4l3w5WAWkY5Ex0qP3cfJgQDVYu/6BH4rVNeboT204nTK4Pt0g8VPjDzJqdbKFDI1jj tu9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id k24-20020a6568d8000000b005c66616240bsi11253453pgt.567.2023.12.14.04.33.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 04:33:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 0A62784AA9EC; Thu, 14 Dec 2023 04:33:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573088AbjLNMdZ (ORCPT + 99 others); Thu, 14 Dec 2023 07:33:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573081AbjLNMdX (ORCPT ); Thu, 14 Dec 2023 07:33:23 -0500 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88344116; Thu, 14 Dec 2023 04:33:28 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046060;MF=tianruidong@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0VyUMJ2Z_1702557203; Received: from localhost(mailfrom:tianruidong@linux.alibaba.com fp:SMTPD_---0VyUMJ2Z_1702557203) by smtp.aliyun-inc.com; Thu, 14 Dec 2023 20:33:26 +0800 From: Ruidong Tian To: linux-kernel@vger.kernel.org Cc: 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, al.grant@arm.com, mathieu.poirier@linaro.org, tor@ti.com, acme@redhat.com, Ruidong Tian Subject: [PATCH 3/3] perf scripts python: arm-cs-trace-disasm.py: do not ignore disam first sample Date: Thu, 14 Dec 2023 20:33:04 +0800 Message-Id: <20231214123304.34087-4-tianruidong@linux.alibaba.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20231214123304.34087-1-tianruidong@linux.alibaba.com> References: <20231214123304.34087-1-tianruidong@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 14 Dec 2023 04:33:45 -0800 (PST) arm-cs-trace-disasm ignore disam the first branch sample, For example as follow, the instructions beteween 0x0000ffffae878750 and 0x0000ffffae878754 is lose: 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