From patchwork Wed Aug 28 01:50:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13780340 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 3603AC5474B for ; Wed, 28 Aug 2024 03:00:47 +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-Type: Content-Transfer-Encoding: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=zkwZ+2zdwZ2vNhcwe9ZZTBO7ZbaQ5vYDrtH5ERwTq94=; b=SG+UFP2I9ku5nX7rfLfI1Uthx2 PkcA3iogg8zp/8V0ouTuC6gT6npw0rW5dZ7fPLPbguR8xwtVAQPk3ynDRjWhADBJ1/HEhzRrZWAZ9 PMl0oT6/Q9ZgC9jVCBrztzfGJJFMczNt4T6K2aPSV8NL7mdOIlmyD6sYpnsL0c4MKNqJmzTsizaMY 0tgWs+NyT1MmH80qBtGKuqOzJnl0M2GUcTts4TdEiLCGcpPagqAh9O8NSc8yjigf+MxUL1XQ1qH6P gGwQ6ZobbmXDzlarhYJHLiqGbosBgEL3Uf8lwoDi9tUkXypGklW/TtsKaqBpCKvyRKFbu4OHLgajv /n1kUECA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sj8vE-0000000DYbW-4BQ1; Wed, 28 Aug 2024 03:00:37 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sj7pi-0000000DPAG-1BKY for linux-arm-kernel@bombadil.infradead.org; Wed, 28 Aug 2024 01:50:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=zkwZ+2zdwZ2vNhcwe9ZZTBO7ZbaQ5vYDrtH5ERwTq94=; b=FsZruIF43muZKU/TourSjRQXJG tcRVdJR2jkoY7Ce3lrD5oD+uRFIrX8PMQfsuBGe0KLqQTVrPtgHdmMBnh0n4jZ9Aw2CvVTNcJ/yKs 9p6631xerDrO/IFwKRF1DQerF4HOEaeriK/oa0TBRWMcAc2I8g1uL9PMFDj0cB+kbWpmYw8JiWGEp gB9WiO8DHUfpEH0xJZTcZSRg8vRHHXKFf5hstcDOAKlZuJwDV+5rRE6u6FOxBk78LilTHL4p3hAf4 QWCvZzz7uYeLxt5+Ld+D5iWPqlGJ0Jg93E2FUvvtq+5CGj0Mwz0z1slQHEI0/3SAxC9bb9Lw3S3xw dH6sEmRw==; Received: from mail-centralusazlp170110009.outbound.protection.outlook.com ([2a01:111:f403:c111::9] helo=DM5PR21CU001.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sj7pe-0000000Azbp-3Xqr for linux-arm-kernel@lists.infradead.org; Wed, 28 Aug 2024 01:50:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eyr7gUO5uIeJsks1+jnvnDsTclxHwtld3VDXaXnDmBsvGNysesdJGL/N9eOj15ToidI42O17jYabYRYnlSdDh6L1MzHb8rz5X83+8TevIGVXIECK58TdayB5YOzuprglUpC8WYcd0qg+v2xV2mKfxzVpIyJl8qCfn8ypi+Qw7FMjsSZnEfyNZTHbm7PpazpooqntTJm1Gx77qWaap/yFSMg8IGEEXTCK/Novto0mYhes4fZkMpROo8glEOJnlR13TKbDEu2acnrEcs+UIRdlWBmdGO0SehtQK0uMEr0K/CQ7uX8TKQULKQQN3hGxqF8INbFQPnQEPvR7c9LyZL14ug== 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=zkwZ+2zdwZ2vNhcwe9ZZTBO7ZbaQ5vYDrtH5ERwTq94=; b=ldZxuNUMuRGsJdSSzl0seRZLJ5FWags8YsfLfzHv/S3n5LIqyEMeOSdjfkfAvVB+/LcP0ubONvM6d/Jy0b7MsNaRoYkdBEoOirfglFC06bf11i+B96Wc1fIdfPh1S+1sqoNeeu/AMN97O07f0dzlFfTvUcRpmjyX3KOo9V6FjkkkBbHfaNe+yfK9cHmXJHO0A8eUHxd9p8CJscMeDN5ObgN/zTqDKvx2cwmlp0lmYZKnliIcm+nDAA2Eg3NNJILOE+dV1ONQM/hWYsR2YnnT5OHhJ0mD/cbkGIwF7FqigcWT8yhyFtQbNATFmfZ6YwCB48/Mhj4wtVf9ggf7B9PBcw== 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=zkwZ+2zdwZ2vNhcwe9ZZTBO7ZbaQ5vYDrtH5ERwTq94=; b=Wpr3yOgrDAqIlfdzsJqxUl7gHa/qKKziNFq5ACDlbmNti/C2Kx4gowoxxCWqVcKaflIf93sbTuvyQbC0nrdNtniPM1kBaEs48e955znIp3ze8gTE7LoOUGgzQadVSnhJfONjSx5rJoE5WKm6lzhMERUXh4mWAcF+QOgZvj7w7Ww= 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 LV2PR01MB7576.prod.exchangelabs.com (2603:10b6:408:17c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Wed, 28 Aug 2024 01:50:35 +0000 Received: from PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4]) by PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4%4]) with mapi id 15.20.7897.021; Wed, 28 Aug 2024 01:50:35 +0000 From: Steve Clevenger To: james.clark@linaro.org, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, leo.yan@arm.com, ilkka@os.amperecomputing.com, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH V3 3/4] Add map pgoff to python dictionary based on MAPPING_TYPE Date: Tue, 27 Aug 2024 19:50:14 -0600 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: BY1P220CA0004.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:59d::15) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|LV2PR01MB7576:EE_ X-MS-Office365-Filtering-Correlation-Id: f2f588c1-cd5c-452e-d542-08dcc703ceef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: qkUuxJZxHXgYMm241vLqILXai7tAPBuwhwewHNmhC55nZHZ7iH6MoAnQPkO45rX4TrwXo/UkBl3DlFqgRNyw4bmS1S9/NNEl4bL8TH9l96+drg4UnyRCmAEx5+2K63Dc80j7zS8R4BT39SuBzq/+NoPylEOV8pEN8DiD4hz50tM6cmR1I9yq9yVm0LArmg4RJv2KSmbKPA2HffaL2z5eZL+bUW8kalY898XwSRoFj1kk+orQI0+IU35mt8YzuxYF8TVs5/EgVTb2nXxTuDrHt8S1BubPYso2Rs2NeMREBcAxCRgSnY3aFTRjHyAfT/BpjOMeEe08mdzCIU0rg+Nt/M9dFl+ViPrx4bq9Eiqv0r48pkfDPNlLt7LFfwECEuichd5iOhqJVzn8bVqBdRAcIJ8BwJc08ta8SLuTiXpAWWBXQyRXbPoGk1oRCBmCXxvcEe/W56NJRXveejQ/7MI5pBQuHCQRAeQIHaqbHDABGeRJ2cGT4RCvERahQMiqHMDvCRzchvC5OX6pAsrsJSnqUHZx1jkWG9ithmFWRGWY3rRZyuqBjTno9R1kNEnv5Rto3X/w20E9RsCWgBYLU62aB2hQGky3qwFau0hopJf9ehJoPgrtoAhiAGqysh2WFhaHVQ80kzeG8gVH/w1UlyKjgcSFb0FVNyXNRy1yzdFH5nBaQ9Pz81/5aJPdsobh3pVZQtB+2OdopvY15TGvCbJsMX7zdY6vB+/CQxdzCmisSNwI6l3/3ku3indJdpQyRzW8c+x4evEdxWTYrTeFj3JxDNfVsdlw6gyUBYG2JaKmeWPGJZypwMqcNwt5uaIyAMDv9D4HEUplOekR6NB6hrcKPjTwLW5pLP9kA2nHf+3KsfAwiCtGwQ+NCtMapkmJ0wTG53mnJB6aFQuqHt9lsJW3ycsWL7JLYv5akKxv7EDzxbGl/lFGrlR3irjl5Vigz52OPUUroq768DGd0+MrLLgktHeqdOxWzhLJit7r4QhJ9P8eiyEd1fEWpbkSNOFQr1QwXeducip2rtgXlXTKqeFkFvg1FAYIWwAlpEdAc53qUXWpP7pEYx1D1DviirMDM0B4Z6PPF+nJ/OMpi95lSdb3iULct0U96KaB0kqJFFK08QYpMtXUfpeLwOdDtXwHaLy4BXaqjKXyskDssQZpa/rTolr6aGWXO/gngcjcFmwtyE4r0XlAHUhO2lprqqQjRb1aDltnYUBpvfj6fMUr3g4BAT51dlyjI1n0o+QWZTzvoef9QtHBfw09oRm0Um/qv+zZw0nzG41mfhGbll3k5YvkZPbTIUuvKe/ev2sreT4Mulry+CpEm7qFMWmgXjtGbDzB0e/mpKjWXbDrub9goutvnrtdyVwBkEfPYwwl1vj/F4vLtYaD2dNqu6tCjhj085b2dBCOw6yO3vvNECtgDHHL5Q== 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)(1800799024)(366016)(376014)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SRN3PpZDGlAHzRUwGWA49S7DRIn1bX80vu+r2FxgshcdTr+Wpaa+EFKI17AbmN19N/D1o+6C+BjqQO96bApL6Y4RrHvEnaqnZtgv9wEJ/txuWgMQDHGlz10M+0b0vX5mCHcW5R87Knm8Z2aNEz8T+E9o+SpRgmyh9f8G1roVS4vMT4Zd1Xl+/90n2aV9+eBr/XBSpQCJdaGSVpN+YnyQ/98NFxfEmpHjbpB0Gw1ksVWOS8/BIIV10NSRv8u1xDcYpUxbrQGIjir2J3M1tSDWw2UTxYDKIr//9DWqEEEOeJKChGDLkTuwWfT/imuK1fdSyJAFkIkoBsvIZqLWZJ8OjRH3UnXCwzh53l4JD6/409klcgPdFhntQx2hYOFheyBA+nSkcwLzRlG8Yh6LS3Lqqyvb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Q7txcUuAKEo4cMwycmLv2DnNcLgyK9k6nH2awj0ww/LQnx0WR05TYOBYtXYiPLMWUBWMf3Q3FxWqUJjfK6s4KRciCEQvqktnhD+HaSoLk76uSI0GhVVvZnrTibsv2uLhPG5x0sTCIitRJI2x70MA72yJYXZ3VbibhdhzTfC/eefmqXwca0nisbzEzl X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2f588c1-cd5c-452e-d542-08dcc703ceef X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2024 01:50:35.1505 (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: aHz8PO2G5lSTgorlvesG81bj69x5eJkDOAlGcx8DO6GOVfs0IPYMfBWgY+9QZOaLjB3GaFHRwl4PSVL7gKT4MlWFtEh7l8I3hMLpI0hajiXzIsMiG0sbdFhXluuMIFCp X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR01MB7576 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240828_025047_072360_55D395EA X-CRM114-Status: GOOD ( 11.00 ) 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 Add map_pgoff parameter to python dictionary so it can be seen by the python script, arm-cs-trace-disasm.py. map_pgoff is forced to zero in the dictionary if file type is MAPPING_TYPE__IDENTITY. Otherwise, the map_pgoff value is directly added to the dictionary. Signed-off-by: Steve Clevenger --- .../util/scripting-engines/trace-event-python.c | 13 ++++++++++--- 1 file changed, 10 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 6971dd6c231f..74b66692e3a3 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -798,7 +798,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]; @@ -814,6 +815,12 @@ 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))); + if (al->map->mapping_type == MAPPING_TYPE__DSO) + pydict_set_item_string_decref(dict, map_pgoff, + PyLong_FromUnsignedLongLong(al->map->pgoff)); + else + pydict_set_item_string_decref(dict, map_pgoff, + PyLong_FromUnsignedLongLong(0)); } if (al->sym) { pydict_set_item_string_decref(dict, sym_field, @@ -900,8 +907,8 @@ 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); brstack = python_process_brstack(sample, al->thread);