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) From patchwork Fri Oct 11 17:17:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13832766 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 3205AD0EE12 for ; Fri, 11 Oct 2024 17:19:11 +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=jQnNZ+I3g95NNJ4SUN9rbdBCuCteFSAu09Vh2oyqlZE=; b=PfUgnXmLINqcAa6vQbUdVuYOB7 x5q5W3QhZXZ2euFP+Z1A2qNldCNrbjwreQTNhCE7Mf6gLVOGyPiP3kHPmBKZmIs3g39IPNu6vWpTO s40IYPDvdQKH2rD2hWc5XlmrgRBsPc50HoPZCFcFfUfGgz30PRiaNT5xmH6hzTfQPiaI0K8ChYARu 4Ul0xBYBqcCYv1CIWQwvRL4M3dd0kqDl4XsOxjPPwN8g3xu/GDr1hjZ9DLJGDNcG8QduNNXdGd4dh FKtlFAmzdGOukAF5ZTwxX65hZZybaZvoZaK8tKPKLBJwBV319Ds2wsCtvO7OGzDNNlKjd8r1AlaOy A3AG92Lg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1szJI1-0000000H5TN-177I; Fri, 11 Oct 2024 17:18:57 +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 1szJGe-0000000H5HD-0fcd for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2024 17:17:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Yw8O7kpUYL2e0MHKLoIzkjN4FEAVKjYwCXaeKB2Mjh9BfsSDDk7MYiGOiRTU/c1ZIFFGc/7NPJOhjo+3Nk33eIcOg5liPwDjj1pX7NP/k/69eXKr2oULMLKhThn53eBIzzqF9FNnINViBbjfYKWWJK7nKBRfBXM40N3f7WUucW1xz89U6MTRGl3nV7Uj6moDR59MAeGgfjWIVEnGiLl5h8tocOnHmwyzT7i4bhCn18RZmIColbVnZ8I5ukBuD10ecq5FW2/E+OCOd+tgoLKO8oEuXZSZc9NWsDAHCxnK3wNDiX6s+r+MToB2MDJwh7KCxCgYeszE6S+iWM0Gk9xCJA== 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=jQnNZ+I3g95NNJ4SUN9rbdBCuCteFSAu09Vh2oyqlZE=; b=SCewjhlV8fnlam3UapvKoWeN8+bE/uAjaulxpxLMpytWumL7BQLHfWImQGdqqSjomYnnJ61JogO/bNcFlBxWL5kSFvmbRk8jaSy++MpJmyScwQjXkEftalwRLHNwEKirTph3r0zO40uRk1sGO6evWuHhusadrrq8WmNAoTf0Mb0Z6ms6rnkpZkr2ADosnQMu5MERB/KyOqCDFfX32wiK/6hOfd481TfaDD+AhYoeObFrla8NTDZBd5X4tkR7tltgYNP48Px5QMwU+RB6RvgzQfUY6ZriKKVLTLfFyRgnpRsAk1lH0YAir8C7xpR3nhKgRqzwyk3sgsq2uPuWnWBwag== 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=jQnNZ+I3g95NNJ4SUN9rbdBCuCteFSAu09Vh2oyqlZE=; b=pytecQ6ppqKrogunm6z3f55av7tXWgm18IWztB7r1QnCHNfEW7aKG/ck4huN07KHkASHtpBU3qo5aucXo//cAm7VRh9nwC3zandbHHskFmTOX1HtEYqT1fKCM8wX0oVdD2nubbtnI6hyruhnbBB22/NMwN4wES3dYmwzADPneCk= 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:26 +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:25 +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 2/2] Adjust objdump start/end range per map pgoff parameter Date: Fri, 11 Oct 2024 11:17:08 -0600 Message-Id: <6107521c4fb1d4ba2da57a6d81c17b54f259feac.1728599785.git.scclevenger@os.amperecomputing.com> 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: dcfe851c-621a-47a0-df9c-08dcea189395 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: =?utf-8?q?dmCoRd/gr94qi2eSOU0x1GlFETxz5oM?= =?utf-8?q?BrQP4OB1FIrurMonlsiAybvUUgKs+YzPKeBUWPdauvP06/0KgLzjDgHR8Ro2r4dHV?= =?utf-8?q?to0pYrJ1CcQjZLbiVqt82D8KImS+3F0xNDoxuaiUaTaLRl1NJDAafGvwSUbOfsVp2?= =?utf-8?q?VpaBww3EBtIrfTmjlUnZ3OkrBd3aryZY1j3A2QeRoioSti4d+H/tyneKCfcjb8cv7?= =?utf-8?q?y1ONPcZHGqYDbgG7QpqWATKT0Lq4If0kEO3cD1XC1spt0KNyj9gQ4dgQl9+3PGXAS?= =?utf-8?q?Ixb/wxpCGOwEeA1tx2kxDrGZ7A4KV7Tg7UK5pTM7fJshdL5CulXQ20Tm6+7NQ7BSU?= =?utf-8?q?ZqWIORprSRZUsm+A3nxcg4NPQBpdadHmNAgrc/VazpKimuB1wN2m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= =?utf-8?q?FVLtZWU1uw/8rDBzryLOxFMJ2OepE5u75yA=3D=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)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?CqgYi7ojW2/v+UykFm8rZwT7SFCx?= =?utf-8?q?k2ilOM40dQUBvAAsmbsLDRgqJ7p8eOjfZGlPZJRe3Y9i5uFhAgpQ+ofsEw3a9KdxJ?= =?utf-8?q?0/i0/KSeoa98784UL7pVGUycOkJRdlwtYLYVC+FBSVuz+hfbwaolCnPoerlFEg90C?= =?utf-8?q?4HrYfh+jEjN22Zm25yHszD4LHJwRwU/rUWqdHHRzUojhdjSLTK8CmEBtpK2z2DcuS?= =?utf-8?q?f2Uajg2KD6iITMF2lDV+YHPUjMbRKePqVLmajEbhIPfo+8gA9fg3rWdiAemSR1/dR?= =?utf-8?q?kmP/nIwzufLxISN04Z8JuaaDihh2H+t6oSr3t9bm0DSRr6xqBKhml+uR1TF6NHZXT?= =?utf-8?q?PwG/ulGkijCp38R8OEDkVcOueXFW5tjMQR6+U6BALJBp1QlqfIzaAkmuR0A9oJMVp?= =?utf-8?q?r+6O0F8q7xG0DQ9ardvhzdcYyNWNHApIxiRu4YQldQZoqwC0nIhjlq7fxGXAhWGNN?= =?utf-8?q?yBJTaS7ea+7J5UGAQzRfLrJ3Xbx724/0lcOMh3ZPNzeE1ycopFnWVtnXP6zsDlNlA?= =?utf-8?q?lQRCawbAfK8iQHwlpReioPvW0f4lmOufeVZay4u1UbszB3rM+jzK9/OwFF/Dtw6KH?= =?utf-8?q?9oJKHx3U88LjTX6l1ErrF3WAWj2aaozjSJGKcdw89uc1f9RARp2zBbat9vN+iORS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a1Jk5/ssUHE2?= =?utf-8?q?ZwzW3RLwBwUUWJPwoGbDWHfMJdaC67/YVCi/fNDckjUAY2aAqCQK+o0=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: dcfe851c-621a-47a0-df9c-08dcea189395 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:25.7408 (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: W9tJIim4by3XtK7sjouVZg8djayfsNYeXQZNWRBak8GSoZqNR65JYx6eBYWnFxzdSuB0fN6GAstxiHaeoIVa3B6jn5tfg9e/QBZa5EpA/KrRh/fhW71PN2+kHoO/DgWr X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR01MB8451 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241011_101732_230552_A5A5423F X-CRM114-Status: GOOD ( 11.31 ) 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)