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)