From patchwork Fri Nov 8 19:11:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13868857 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 8EA54D64079 for ; Fri, 8 Nov 2024 19:15:36 +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:MIME-Version: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CU7Y0g0VF+ONxHWmu6ThGdzotKxiOmnMyZ1I0Kb3GRA=; b=fwugMr5XTDFJLIUP7oizVgYvbe owmtu3SN8AmHCV4CLCwE+nlaIp+wMrG2/F6ZJBI8xQkodXhirG6LPWUNTJbkxK2R9cedgVda0Q8zi API/Pf8RLQ54h/XP5rsl21CECUtanE3q3C0D6Ki/aBqh3fbltGpz/R4kp6yPY5E6Yx47Zk55fLYnX tbPyHJIlh/hilzrm6UkDOkcVYDWfRVvQEOdFbZbVKiy0zL01U6lxECcu50tWEeAsdJsOZfBiPgv3m CigRN+bYAVt5fMWZu6mlgxTCfvsx6fwSV/41oDTjy+tzebClD3pwR/6ytt9QKpuH1XNzpZodBB85E 0vjBM4XA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t9US3-0000000BiPD-1mFs; Fri, 08 Nov 2024 19:15:23 +0000 Received: from mail-mw2nam10on2071f.outbound.protection.outlook.com ([2a01:111:f403:2412::71f] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t9UOa-0000000Bhs4-03J8 for linux-arm-kernel@lists.infradead.org; Fri, 08 Nov 2024 19:11:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xid2UnOyOXOOcVw3fbrKq0LssndYXeHUPFGe6UhVOCvTjsPuPtVSKthZTvrFzrYk2st/GZjSeWMCViRfxX0pt5VHhmK3n7G7H0azzztceJPLG8+/qiPYxNER19oqxdXmyy5fqTYRf5x7RgArWxVGJbxUoSlAMskM7K1E2CU593OKl/ICM2fMVxy0LdT2ivK1KbJyHWuKO8i/2z58hsqPCJIKoPEiw33BMj6o7DWDG3d6t8G4JGlgS9bWut+qnPvcAEQyzI6LWdqxtBAEiyK09q0UtLkYZs8oeXmzKsoBgEB+JYHX9l6Xd+1SC0W99gZ8+2kepJxms5HW+P5krA66XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CU7Y0g0VF+ONxHWmu6ThGdzotKxiOmnMyZ1I0Kb3GRA=; b=hwvtNWYQ/m0ueD/RW4ing76YuOMwgYzKmb0KYp6iL+Sw1X4ysY+v0hJEq0Gh4dA9tKph8w/RCNhzrrFsI7IWlcqaAF2Y99W85xdjqMmrJ6KSWv6BzY6FwWcGXKsNPwQEcTJWeud1Q04fscY1Qh7f/LLCaGmWtwB++syuP3NPLpKPLOPzI0YfTUs+6zMYyACaw5jZcirwy7F8+O5aY44ZQoa0TsFdhTqcrAYVOdrfJnO/nB4EgKiq3gO28uWpnYw/bzNa3nHy0UrWpnu4yYplyayqrSs2tm2EiUZWASVhmfEHd1EyuA3l9LoKYcSIi3ZsNkqap94Pg10MZBU09Z1eog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CU7Y0g0VF+ONxHWmu6ThGdzotKxiOmnMyZ1I0Kb3GRA=; b=OArtzoVK8M7S5vymseF3B/J/Y4fsaA0y/g/8F9cQDAFKOA1FMxoS19qwUhYda1MWDS9NWix60UTQQba4AgxSHTMtOJ+bQcofrQPwCyKUU+NPGjuQahr1yloPzB6gCecYnoFmQzqHtrVzhmbHeo5Xy+7Np24YTvQ2hbEdr4qwscE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) by BY1PR01MB9089.prod.exchangelabs.com (2603:10b6:a03:5b5::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.11; Fri, 8 Nov 2024 19:11:35 +0000 Received: from PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4]) by PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4%5]) with mapi id 15.20.8158.007; Fri, 8 Nov 2024 19:11:35 +0000 From: Steve Clevenger To: leo.yan@arm.com, namhyung@kernel.org, james.clark@linaro.org, mike.leach@linaro.org Cc: 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: [PATCH V11 1/2] perf script cs_etm: Add map_pgoff to python dictionary Date: Fri, 8 Nov 2024 12:11:18 -0700 Message-Id: <8d9a1142dc58ffa34a000cb7b7a26055df0a37ec.1731027120.git.scclevenger@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: CH0P221CA0036.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:11d::14) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|BY1PR01MB9089:EE_ X-MS-Office365-Filtering-Correlation-Id: cbb4ab84-6e6e-4180-5bff-08dd00292a0c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?VHDNb407UWKQpwf/pvD45x6fseWm8MR?= =?utf-8?q?oEsCWM2biJRfppPHAiTaSqDoZYGwwZkFNs1nuHXI1EMIwaN2/87NgpT/o15NsjmxU?= =?utf-8?q?C0uf3/GhOpqk4WNhcO5GVXZs65MUIU9zxzC1c5BqCr2Z9iCEZKFRJAKFH0zHZeID9?= =?utf-8?q?+9CuwKo8yCEELoP5FAaMSt4Q/jHdpqc57jPRGGWoAjIgKaq78Z3jcW7JY6rwFufsT?= =?utf-8?q?oNRCZhvmOyWiP7NlktIDbHsv2c++X5qawhVGp9jfI/nMZxdv/qu3jwjBfzYNIWCjJ?= =?utf-8?q?BtQxIVykpYsNtQtx33BrV+eHZFiW9XTETLbWJyYEHENqAyV3FKGlZlrnjrMdXq5NV?= =?utf-8?q?LJJiXZB2pUWvpCc/xEYRzM8qZ2TKmKFA7PaXCX7kn0cFl9XzLDYjA4I47/byakZ/R?= =?utf-8?q?CvrqSNCIaqFuiaOI8hS6GUBuH2apMaLGmceu5Vc3ig0qHltdl0x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71XAJUk=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR01MB8146.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?trRBORh/cq5WmIua+M51cYdidR6s?= =?utf-8?q?ZH4pf1FEb9cJavuRZ82bxwGZ/s3pnafkO5VKC21ZxI01H/1b59JXZdfHWTLwXyvg3?= =?utf-8?q?/ncYRhx7X16jK2SAkxccDZb5NKOEBFFhvrNbRFFUJze9a6HCtyv4pMgPGbzEYjQjZ?= =?utf-8?q?ItFJdzq+JllTF7/mbgVnRit+pXRlPxMQTVWHmxyr5cVjtUfIj/hgP4ecihNnLtYaA?= =?utf-8?q?3VL7hEGlZ8CLR6EFXI4uQ4nlV79N6KVl8j9a9v4icsylqe7CQNiDwXVCACPyqlEf0?= =?utf-8?q?1gDU3GoV9Wk4TA+Yv2s8RBsZbFFKpMClQEBZRmpTIaxv/U0PLb6v0NImKOCxrKlpv?= =?utf-8?q?+XfJd3cJzCwoaBT9bC8S+Wz5MMg1dNLCWs+/mmw2osjPVee7KZ4TBecyrPj/pH0wh?= =?utf-8?q?SaFmbXbPqHzEmJblzeJxntEwh0VXihUMx/nIGX/fDkb7fD2LWzmsxI6LqnSd66/EE?= =?utf-8?q?C9THqt8lb4rZH/I6n8YB9oatCPqnWYFePqgXMfSdcjBgIJ2mZSsBsvqaXIen1JTUV?= =?utf-8?q?kMEPmmGsOOOeOSv1J9Tb2dVo4s+yykCq5+3NcJjJ5ctCzTqArSZdqyIGIExkPKYAB?= =?utf-8?q?if8rJn31t8Ia9MdATxFpn/fyvnc13Zfx0zuTPKICEVOVIwyJlZW8OzyLVeJChGcNG?= =?utf-8?q?iM6HUrP3URy6ndGPg/YQwg0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qZZQs5NI8pB/ohQoG1P+irXVDg9VNXbMSZ4KWBYs0KGwX?= =?utf-8?q?s3iFMn1AIwu?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: cbb4ab84-6e6e-4180-5bff-08dd00292a0c X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2024 19:11:35.6895 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sCLksHzbBIq7QKCWldkxyu8xVfxHc2jl3FKw9UDm+ed1vGFRUggRqCPPjKe5VzdCltIxC7+v9h7YPLe9C9UJLnoeQ5hBvgyFmgcLOv7IuGHnpX1de0JnU5WnrSfSjfpU X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR01MB9089 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241108_111148_093656_F03D209B X-CRM114-Status: GOOD ( 10.47 ) 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 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 Reviewed-by: Leo Yan --- tools/perf/util/scripting-engines/trace-event-python.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index d7183134b669..e6d4711a7d69 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -793,7 +793,8 @@ static int set_regs_in_dict(PyObject *dict, static void set_sym_in_dict(PyObject *dict, struct addr_location *al, const char *dso_field, const char *dso_bid_field, const char *dso_map_start, const char *dso_map_end, - const char *sym_field, const char *symoff_field) + const char *sym_field, const char *symoff_field, + const char *map_pgoff) { char sbuild_id[SBUILD_ID_SIZE]; @@ -809,6 +810,8 @@ static void set_sym_in_dict(PyObject *dict, struct addr_location *al, PyLong_FromUnsignedLong(map__start(al->map))); pydict_set_item_string_decref(dict, dso_map_end, PyLong_FromUnsignedLong(map__end(al->map))); + pydict_set_item_string_decref(dict, map_pgoff, + PyLong_FromUnsignedLongLong(map__pgoff(al->map))); } if (al->sym) { pydict_set_item_string_decref(dict, sym_field, @@ -895,7 +898,7 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample, pydict_set_item_string_decref(dict, "comm", _PyUnicode_FromString(thread__comm_str(al->thread))); set_sym_in_dict(dict, al, "dso", "dso_bid", "dso_map_start", "dso_map_end", - "symbol", "symoff"); + "symbol", "symoff", "map_pgoff"); pydict_set_item_string_decref(dict, "callchain", callchain); @@ -920,7 +923,7 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample, PyBool_FromLong(1)); set_sym_in_dict(dict_sample, addr_al, "addr_dso", "addr_dso_bid", "addr_dso_map_start", "addr_dso_map_end", - "addr_symbol", "addr_symoff"); + "addr_symbol", "addr_symoff", "addr_map_pgoff"); } if (sample->flags) From patchwork Fri Nov 8 19:11:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13868943 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 EC74DD64085 for ; Fri, 8 Nov 2024 20:17:07 +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:MIME-Version: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uOO1qVYCues0e8+cZFU+gLopZinUMHkaTDINMMJjlRQ=; b=XxeskdDh41s0LZTM8k2JiYBvQv dduiK/qCi1nIzmBMycROoVQYzkD6JHu2YjGBjoikWViCLjE/ZCLDazWApDw0SwqY8eGlyVrzUhN+I eoEqM8jzSDJSBDQ/V39zZoDBppV/+kKY08ndjQ2BRF/a5bF55d8MImn6jVrdGpA+/di3/z/PBrcgH nvJFVjpZawtthcY6Wbn1r03oYFzHvDIGqOL1FmuIlAcKgErdPWSVJcPT1gFJA/bS6BNBtBusgEq5B 1HEBs/osZLSXqhqSRFzhuS/qIX8feUiqVxYOiRHGJ92nRZsNKHTeg2fX6ci5Mj6SjjPAX7Kcsmmry 8K7UMGWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t9VPd-0000000BrMT-1xAI; Fri, 08 Nov 2024 20:16:57 +0000 Received: from mail-mw2nam10on2071f.outbound.protection.outlook.com ([2a01:111:f403:2412::71f] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t9UOY-0000000Bhs4-246v for linux-arm-kernel@lists.infradead.org; Fri, 08 Nov 2024 19:11:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Olg1NCjfJJnErTC5Q+0d+bFHUXUrX4ONb9y7GzvS+AqSw/qqVSZJYhMNjVUs0MNxkAP7EXIHrepthhqBuwpzzA9lGuKTUbu9fjgoS7XaPvu6gXEv4QlSlHkojsRp1TKa9wm18ZHthLJG+41keD+3DsWiociIMPtAq7piHwzInVK/5e+vU9917NarVulbctKmH+13jIvSlG/5ZBPHm4b878EWcC6B+JsU/DpR+ULcLWjm278oGOvGw3ftJm/NGfJwCTCXJszZVRQCHG0w8G8C4OJYXPmgN9Tg3y1eqo6t3mzc5xCOHkQqrXf5zt1sJP7hbOKNjl1YUjn77eZ1aXdDMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uOO1qVYCues0e8+cZFU+gLopZinUMHkaTDINMMJjlRQ=; b=X6VP1sLu32trx6D7bKzMNe3XvwnQqCJL5Tf1/b0fS3t+LYN70UlL18NOVvHjVKkm5MiVKvpt2VOWoRJ2RzhnPZU+ipBc+DBwuyYnHPObaGCN4JDb9lFJp/xcs05rlYFWHpAyLDk7CayNJuMsB0opBOU4YfWU7q2ccPHs7zXD+5NFK8Prmd/W4206fDVgHJI51BRMISrygqTn/0iAxYOH1wFbQB4f1/bzSfZEuBGafK0CSOm3gVu4vmGhjLoswKVAkXwzAb7uXnEsAaaQevIbTaz/Xwh1/bUiDrXxoYVPx29RS7VOKvRWZjU8wqNaw4r0L0eFcyFABqCYFLJI4uqVMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uOO1qVYCues0e8+cZFU+gLopZinUMHkaTDINMMJjlRQ=; b=u9n3T1kcFK2/dcuc4VD7PMHE0CJ4Uf7ar11rHGmOEMmR+JhSgZh3sDFKIynl6ZLdWKAe/8qBz+OA2LalG5HK7uAO1oUhOrNi0QjZf7bdPw5GeDaIktvEEI3sGocyIglMwKjgqX2O/eIuRWbB7e/zyHnDjA8PVIlM4+z+G9D03Dw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) by BY1PR01MB9089.prod.exchangelabs.com (2603:10b6:a03:5b5::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.11; Fri, 8 Nov 2024 19:11:33 +0000 Received: from PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4]) by PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4%5]) with mapi id 15.20.8158.007; Fri, 8 Nov 2024 19:11:33 +0000 From: Steve Clevenger To: leo.yan@arm.com, namhyung@kernel.org, james.clark@linaro.org, mike.leach@linaro.org Cc: 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: [PATCH V11 2/2] perf script python: Adjust objdump start/end per map pgoff parameter Date: Fri, 8 Nov 2024 12:11:17 -0700 Message-Id: <21ccdd22e664bdeccb878672d4b2c0518873c1e5.1731027120.git.scclevenger@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: CH0P221CA0036.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:11d::14) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|BY1PR01MB9089:EE_ X-MS-Office365-Filtering-Correlation-Id: 6c0edd92-bed4-4ba4-f316-08dd0029289a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?ynDbhR5pEMqOVjaHRByog3mjccL9WqQ?= =?utf-8?q?mPe2ppdCHa03dglhV8yr+mkmOTYL8YPLtKj08cjJS9IiQhzBhZv6zXCUXw+/CnU11?= =?utf-8?q?JEzpFhSNjzeTWSIv8WQgGWTc9Ub7DndpmMzkOCTDGHsxPARopfH2R5t+oXQ1gq7wk?= =?utf-8?q?7sqxqcInW9ohnKfuK/sWKEnJKDbsfYLwYyPnhUaa6zyWYRiM4th5r25WCLjgPKMth?= =?utf-8?q?STa7GCAY+R7UZNELy9cQJBqOPRjpELInLsAEFtljcdVSwlhxXxOQF1jfosp82QEi8?= =?utf-8?q?mO98mhWFzMNE+qg7ILBqZE74l2zJM1VazkCV5tgq+LCqxlsuVrnKF84WtjeJ+BUjQ?= =?utf-8?q?9Bw6RUBDfOv2NcPMGTgDOcSHrXd9ghIUQ9wJe0ap4wi7/ieRfJtXT842QkuiYu5Z+?= =?utf-8?q?VOrY++QKJvU2cihQFYyrygekoDuGLVnPBxa0NKKqRIZ+dzi22f2rv002secEfx6b+?= =?utf-8?q?c+0X8xmz45ZxTNCTIHegl8lriESrVqhYdKrwo351JURVylHqfglZB82ucViGZa1tK?= =?utf-8?q?62ZzlnAwhjO5TFrH8zjdsLK2MnTVRI9ElEoEtYSfxLT+p22wXojU0d+6m7EUjVBL8?= =?utf-8?q?5pUwfhZW3HVQZGIooFg2jB8NjUpMqBv2dAPNYtroTjI1nnfV/1zXUKWzq7lJX4Fxs?= =?utf-8?q?K14STwIzCvl7AD9rc178zATHg3seB5F+KUtjeJwxBDfnIQN3MzzI5rCYGv4mXMBxl?= =?utf-8?q?cfj4pce/RWkfFgXLLuHFLFwAxABN3NT02waxU25LooaZ+puFZMa3E+Wuzpxgkt+re?= =?utf-8?q?/pXviqB9jxVWYIhpkj966uKCJkBXM9BO9Rs/4a2jteNlR4Cn7Mz5N/6mn+h6XNzUz?= =?utf-8?q?a4M1vJCY2GETHqOtKz/NpoOjgiYFwLRM1M1LwowAQD5y7LE3Vb80g/9nBIbEuSiUf?= =?utf-8?q?519U3MAjQJlZO5f+iTMpeE8D5LIbG0GnVUGmulRRXC25b5dMyrmAJz0meOw3u9ZoH?= =?utf-8?q?D+rB0YwBX75huz08VTedlSCZ9fJRF1hrTAVdJTox+IjR4lssUYV4VW5RHU4PrpVqB?= =?utf-8?q?96pihP6W5OhqEXD2pJX90LQrABXlPeHu441kKpBvkeacz3v/fvgPpuURCve6ZJcwj?= =?utf-8?q?tMydU1NWXK+cpSc/48YMGwlC2Gag6TXrt3y7q0jgnf0xLGTeq5OEzfOPtPxDaTw20?= =?utf-8?q?acUOVL9WhSeRDRR2f7pdc+YnA5G4yMrA69lJJJ2zYGBmVqzi+wsF7VCdAYyA84829?= =?utf-8?q?yZrVPlEbgZiQJ+e6VPBUYRdcjpnjQn7KHNo+tRa0WTShyzUw20IDBjg4WM//IrNCt?= =?utf-8?q?FDKsmBVc/KO81Z//1EAVGWjHYtUPzAM/vcjepIhWBvn18pUBiYjYbkVg=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR01MB8146.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?pOPLaF++v/H5+PKMsZGjSdEPAXgi?= =?utf-8?q?exGqwCu2qlM4m1kz9D1Q6CZDhbRtHoFN4rhyvzeGy1ZQFE+WUL69rJ9jtbx6m9nTe?= =?utf-8?q?IDXbiLa+sRRmZnBrLvn78qKvgewswbGcYkbGAE2W4k/uZ7Nb+Xu4Ax8GY0566avBs?= =?utf-8?q?6p5yCMaf4rqTu4lpFsOpaEv5kjq78N2r2ZLHhmrPG8tBBNFITrMw/70H1/kPugmkv?= =?utf-8?q?8zni54HYvRUxvXTM4zg4ZFU48fSIuhHB73u7UkkpdW7DjQFZU961qHqOo2biVsw1G?= =?utf-8?q?FOoS/I4CvK8n8/LuThZ8+qt4VoKuaoMhh89HwWqV4xj0n8kDXMvoDR995JnnVIQNX?= =?utf-8?q?AGH/4czbZELSEd0AB/gV9MJ9nWIYxz3RyQ753E1V6+RBehsyTHKNTjeKBLqmIleVD?= =?utf-8?q?VfYyPegJypbkBWXWAepC3yr+dRk8Yj92PgS3JePd94u0AtEFS89dSCjgQppINkX16?= =?utf-8?q?7Ve11ImZCYRkz2qe0SjkSyyxow+Mli1LAcKiTcfIurkrQgj5d6uS8zbnjRCG882GW?= =?utf-8?q?M9N6m1w8pjTW+SLNh4XHu57JsutruoikXtFRtlbTeSSvpASUt47PnTbEUaxThy8CA?= =?utf-8?q?IXLtdbpIAIpMdPTYNsc3xH4SgqIn9Wgh5+VeESyBwa2Lab3a5vr1jQuUDulEjv9g1?= =?utf-8?q?ISvd2d6Toc1heue7rYJddtqj84TwPsGJtYaQPqz8ghG8fWnG2aX0Fci35U6Flf/L5?= =?utf-8?q?qWlRKm7h0wU2zGyFrqeZWvgwn7PQqcO/CNc8WYW64YRydLY0rGX+qAcKA6jUBIHh9?= =?utf-8?q?2xFZDrmw9SUqwQk3dK/JW7AwtYHtpGMRgBeBvh3XNt+7aVBp/sYUAnvlJ5r6sue3M?= =?utf-8?q?GigMN84a1Wu3VvsQ/C+GmsdXzxK3mqZQ96O+C+wqmTIobQevpfdAoXNoD49TIxo1V?= =?utf-8?q?mIgLnaS7EozxDKGqmLsIOjy9I/Bs8DluA9sXLh4iMZxHF1WIdr13Rh7zAqLe84zAC?= =?utf-8?q?92iBdhY43Bn0WAGNCAp+FPIpgnj4A+eI4SHG4oZF7G2pbrq89XfkzFBRs5309Ug6p?= =?utf-8?q?u5l9WbxV67VgfbQLfDF40Papade0Ug756SEQlUaGMco3RslZazU+iNf7XbPRRDbet?= =?utf-8?q?o9k/8Pg6UIdEjBDYwNtjwLrYa5KN+322Ew4TtxoSNn6ebXegJcOYrvv69IJYtO/3U?= =?utf-8?q?3SdbwzWgXUR4Hf+m+PojmJAqibVlgPDqV2IY6g6atDsuND4JCF7ctS8SfvKZn0gav?= =?utf-8?q?XbnwzveoMG+SKdsgIS9MEO76pTdaVY/VykCiKCBEgh7Wj6vuLCrq27PaJ0ZY1oO0I?= =?utf-8?q?Fq0CsaN+30QS6UBGfEEGS421prfAIHB4AVioIiAzPbthfdx4Pr9o7qf3GRwUMJDZy?= =?utf-8?q?DsETpsioQ4Pov5lDr2zDcMWZe18/1qHz0TrxI8yx4IBo2aDz6E9augudv9+UBrQuo?= =?utf-8?q?E2MSMB8TpFSXoixGRF558gY+3AINABrAPCiaCUWZR/UeivgzWeXPP+p1oS7gMrSCE?= =?utf-8?q?mP6D93sje7j1pBI1NgkyYNreJLjkgtFLLZML+Vb02U8Oq/pvy1ppQNnKNyj/4WcQy?= =?utf-8?q?GQLAJ5FIu8T3V+veVVDj2HK+kBEisubB7JHpI3/tb4La/G91Xy2eV1TYj/fT7KY1Q?= =?utf-8?q?M00k17+DiAo?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6c0edd92-bed4-4ba4-f316-08dd0029289a X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2024 19:11:33.3631 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RiSAmFGd5IuzuYhCSXMGxBM4VbhuB4lcC0t7AK0PyPphj5doTFmu2zjgCgQEpO9cPUgVJiDLMEGa3LrP8r1YI7T4UWwXVaTrR1VmvdvYJla6Fklet2TFd5fEPS1qni2l X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR01MB9089 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241108_111146_706964_33F8A5F5 X-CRM114-Status: GOOD ( 11.14 ) 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 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 Reviewed-by: Leo Yan --- 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 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)