From patchwork Fri Oct 11 17:17:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13832782 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 AE866D0EE12 for ; Fri, 11 Oct 2024 17:20:30 +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=YfdQOlG8n96DGGWV95lXWurrB8AofvWa9oPn9hBbCVg=; b=33KjmCbSgW4/Av9RO9+tLvZCxF ylb4yVsL4ZM2lneHof1AqYzYEpdhcRf+NVnNxNrheAvjkQVi6/9toyBPsueZpGlZJVt1LMS4BHItp tsC0cq/+PWR8QNWeq/4q8ysLQju4n8XGuqoGJgQkVtLsC7O5OIUFJbl11BXEHExnD0Q7qz+T1TzQu 3OEG5t4K62SUNxnJo9CridvZSFbt1xHq+6C1yG1uHkBwfnu2AdsE2rxMJgLs4ZYiSf6dSF6pvR7tE Kg9MMJ1uwq8+AHDqNi5+UJjMTQRUOg/CLDWxwq9T48NSjFcfKzX+EeC04jcN6ayY7gGbRk8+VMfwP iZAKBw+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1szJJM-0000000H5gd-0zkz; Fri, 11 Oct 2024 17:20:20 +0000 Received: from mail-dm3nam02on20704.outbound.protection.outlook.com ([2a01:111:f403:2405::704] helo=NAM02-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1szJGf-0000000H5HD-2kIO for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2024 17:17:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nGig83UGtkM2EnXOThyxy5feD/K0MqyrAgNXoVAbCr/w+w9yXI3EPwF4S1go3697H4RrgaWPTnuyqp/jkqkRxhgKMXjfsp4cRphONx2D0nMobQGtl5FEsJICC1rI7Gc38oWlNJyoGbEFs9Lv1f70fOopSNu4ylwEc4Vm64+NnUHlkVYP7/LMgkp/zXGF14kYLcOQxhz5/Athd56WcLwF8ib1h9V4lxBuxYGmAWbu2S3nzBjhiTdJMExNmOrnAtyJLcIL1cntyBRvppyNbvqAEK/ncqaA73aFspL4Ow2tOf38aeHnTsIu4//UjQzCU6r5FkPBUDH+AqNt7wsVVT8+rw== 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=YfdQOlG8n96DGGWV95lXWurrB8AofvWa9oPn9hBbCVg=; b=igt4AYxxMQlQfdLTbHCyuAiO3xJy+u2z6L7dNDeM9UqczVI6e0FFyQ5QqS1H9dfJgFi785gFlv4N8by6eGPNRr9BbG95yqGDYAjq36HD0maVKHNlRgfOKGnvJ0tQiDp0g2r1qQ4J6OsKbdkEdXLwbzoxn7/BpayoshWQLO6E5CJBmFdbGkUyNqonupLDvytAp/jrFIWp53Y/A1QYmfInItAo/PtmNexlJ7Ex4B1D6h5HIrQnMYomUMMjarOLTBGLOanmIfIWNFT7Q3V1++8pBxlc3ZJtYl9eBAD08ZbPPIO3QdhqkIXSB97X8IzN0tcWfjUN0cuWiE80GXmrQ2wONA== 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=YfdQOlG8n96DGGWV95lXWurrB8AofvWa9oPn9hBbCVg=; b=JX9Zt8HO83NZfyta7BbZ1RkrZEFs56899nyquqUlaM5alVzh2omqB5iie9HXvokI1QI7u+8ePl5qJYKMHi1ZsG/tqxQ4HwdQhjKCppc66um5+gZhQJdZDBaaIwWO497sSGiF1wAh2lH0fwr1oQ8IAigrJ3MOgWToHxypf+9kUFk= 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 SA3PR01MB8451.prod.exchangelabs.com (2603:10b6:806:394::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.34; Fri, 11 Oct 2024 17:17:28 +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.7982.031; Fri, 11 Oct 2024 17:17:28 +0000 From: Steve Clevenger To: leo.yan@arm.com, 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 V9 1/2] Add map_pgoff to python dictionary Date: Fri, 11 Oct 2024 11:17:09 -0600 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: CH0PR03CA0311.namprd03.prod.outlook.com (2603:10b6:610:118::13) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|SA3PR01MB8451:EE_ X-MS-Office365-Filtering-Correlation-Id: d28e9b9d-5d23-42dd-9720-08dcea189573 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: yNYVOyy3uVqx58zbX4HEtUmk2V57m/suJqmAa9w3N7Ru528g9TD9mIU1Mbzh8uzueJ7EF+W44vSwJVocWnvqhcXe9/XciWI+b+4mjwjGjE/cBj/4/dbGzh0SaNNfDhy6Xp8jwrc8PsN94W4OsJg+QbtyLIR9rN/5gNuB7IhOaHElxJUKvyLrqbQxybHJzAbUDB5b91VXTgOI2t4ROCUe05HZ32rPIbFjq4tMYLZTKkp/Pw254/+vzVENeaJZNoTXBB90cq7+Ibiq2BVctYo4NwBIEGEJLofBKNoW7zpq8NSd5JEl9sbyPrr2W7Ul4ZKn3InF+i7ukkHUXidOr+zcPtq5SN/rGJh8twHIr51eh2Yv4mbVqp0jL3vKP2AVbh5CFUmClfg2MrkiDrundXL5zf9VkZ7104oVeW35MpMJKjOUOyweNbPYdSFusksrSLfN3Xi9VdrdbLdWGY+kZLAUOuDkmIKXkqx6qJXa8Lj3DkMy0brkCM78j2ok9erizaqay7qpD2lI+4IfJRf+KZIqBm6vKxscvZQqwBEcJ3GWW5dZGAWSk9JtKnqpYZOmA5AY4osp1bakKk8NchkN4Fz7r0JN+RsGTOo10QBrEd0Q5FHMZ80JNXe8vNffNzAIcxvII2N1f3hGmeGqtd5W84Ej9bUbaJ/H99W8XIVmvb1JqQ2DdxuNSaw2KzRnXZyDLG1hKFlgiauoiG3e+jlASKkf5xQz+SYicFG7BGfm9NctXZ9P8Gcp3UvxPcBwAM8uZfK5GBUy4mwKWmZ9Qpn1rvXdWKA8gi7bf83+bgF/b0zXxhCgHV1iGN/Bx0nc3tZT4q9JRLgMlbMmScLcmJT6YSozD1HD0H3ZnSggcVgEb3EFqkgui2ftVjq/u4w5X0u4EvDXmcFtAgUxyDKqxAZP1jxK2NPKKqkEqjyPyOcTbmRR6JWhNZ6QdS92QmtlPH/UeM89XLFWtBO4W/dWKtwSk8Un1zfn4bmDucOgs4zdJNOtN5zqD3U9skJaWW6OKdonQ0eceNmnTa/swASCuFdJ9B02Bp3M03K9PzYnP2mElyxUvrik5DE6KGtUI6uEQbWt3HiKCCwpacR1Zr3S2HVhUqTK9aWl93UTbRnPgLi7SDauJXcpTF+VGCimbPs1zZzQKYDub1+/MZk+4MSEmRmb8e03EiynzSzjCu+5CxmNxJgX9lbPh/KbyHEnLWcSZ6rN82qRt+vQ88zNm4eruWVrFlFMuZUcdX6FfAimNfjHGwvO3b+aKPdjPmltFst+bflzAD3PG/bb5ks+x5t9EhIM8tQxZJcRxvT4ekqlIYDK47tGS75P/W6O0WagYMMUgXhLz4rmU4pCjuLNXQS0HhvfW2hAyw== 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)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Xtk91a/W6nvG+OHa5Hf+ibiYJz4lCJGA186inhwBu0gWtAcucmmOCJ2uF/GSyo92i6HCpKa5oGnYlFoHI3zUIyL10Oz3zm19HZ3QTDIWOBpRO6XoxykaEkTp4dhw/777LTkAvPFmuAyR2r0Voj5HsuQ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zS6V8IBKJaiShz+/9iYFmuWGwGcHhBAWUajmd2pdHbTi6QtRLGq0Q6hsl4PoU2WY2/b772Xr3uGUuJXHvUBs0/i3qDa9LUkwQZvNlzVa6sIZwO92rOgXFcg5B/ZFrFuYJw6efSRS44YAkH9+jSnZj2e6unCtUBVxIfpLI8Fs7Dp38I8bSvHK2xK9aDY4+Y7RhpNlyyFElD5sfqZHA9suptFX0m4U61jvuDDoEH0+QRr0r2EP2i+KNTDdqbyrKtOTeO+UlwYRl+NrrW9rNyGTaxtusbxWeqrit7xGoy5/vsuNZt5nG0lz6sBevFXy+LjZupriJJiD6P8BcKd1NG5Oq84zDNccyKAuECJdgIXri9nMO4p/sDR9QDkUKaqw1Rh2yNNZ6xpmP5Eh5h56LBmtrkHmfHCCHqYdoRVjryBZvymJkwnm536s6uC X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: d28e9b9d-5d23-42dd-9720-08dcea189573 X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2024 17:17:28.8246 (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: 1z31VxFm+0c2+h8hN12h6WjZPhkjOob/K0G0XfmoxgOYvdhAO8bRGtyN81Z2V9oWvNM1WVCAZK8SDHvEpmTtWug2uT+1rjYYlOsFqKTDoADii9OfZBkxRM15eCwR6INN X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR01MB8451 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241011_101733_727163_F13E250C X-CRM114-Status: UNSURE ( 9.80 ) X-CRM114-Notice: Please train this message. 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. 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..367132b3a51a 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(al->map->pgoff)); } 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)