From patchwork Tue Aug 20 22:11:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13770609 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 6C9ADC3DA4A for ; Tue, 20 Aug 2024 22:14: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-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=Pf3ErGzbj/xReXHB5DO1lBmCdUC2OrZTBiWWMTBwIS8=; b=IpDY2W4mMPlIHpm8SqZ7q58fmx osgTjmBu9JQOlgvsyeudUvMc3lYgV9WYGt90Bh+rL8tD8D1SqVDD/U+Q04w+DZJ/C7+vfc4eE8n3h ND0sG15dReyZZpo7KcETiKWbgIZ0YQOJbMlS/OL1LtXswv/7w82NEZI9dhDB8n+LEjwvuv79Mp7Qr uvFip8PNb/0lM7Cg19Y2IY+j2pIw/4UVUDE/udTY6NNFnDo2mw514Knxg3VyukfE6zr/q5YgEhPsW oltAdqqXd2dizNwgrkrhfKWUl+zWaKjeDNf3TC/n2gUIw7przIsVVwrj1QGvARmeMVp/MsfIcTJOW sj3I95GA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgX7P-00000006mYv-3mCG; Tue, 20 Aug 2024 22:14:23 +0000 Received: from mail-westusazlp170100001.outbound.protection.outlook.com ([2a01:111:f403:c000::1] helo=BYAPR05CU005.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgX63-00000006mCF-1Yr2 for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2024 22:13:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=b26b5FRy7zCcVZ1IEo07sXQ+Tau5gg9J6Nr81g5cnanB+TsWlegTRtyB9V1a9RsnKY+XJoD6MxQq101ofbsCAUFzmCNt9wwqzqNP3/3B+2KyE3XDICLx86fu/fLGBG+ZcPrzqnzekBKhwDUzh1abXQkBmtNj8Poo72dtlpDnKsdRJqAaXmTV2gub2tU6ALs1cM++l1+1cYolM7zu3zAtMyxH0rSmUhC4CoEnJh5lX6JdsjppBBeC+7DwdRk3cLZtSGGatMSS0Q1QuZkOjiudsb9sbk+RiGZhY4vJeNu5sGc3OAmWXdIxOshUDBp+NAbZXXEtwOXncg0S75MzCaC7TQ== 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=Pf3ErGzbj/xReXHB5DO1lBmCdUC2OrZTBiWWMTBwIS8=; b=D+Fb9cvmHORj7L9brgZPyoO+1SNmIgccACQNJy/F/7vBc2ILOji+yKmvVJ6q8CVova9tWr0+OD/eVk+wpf01JfbV2zT0Vx1crr3962V7r+SCrRUDDF67IHCKau/maNWvsVus0zYMtnkC6ZV/21EEZEElx9WccNNLdI8rk4kC/1lM5E90lVYyLa5IfSZNTy958z+ZtwkDLDIAH/f+/fdqly/+uLSgY2n5kmSa7WiWb+F1YaO7tjyxsq8szATsh4Faf0rhNk4XWGWZ8NXSM6CfpY8Yxndr2i9AK3huTY7ArhWWuY/g5JMGNQJstsbgofe4UIpZlye8ox5t1W2koAgyzA== 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=Pf3ErGzbj/xReXHB5DO1lBmCdUC2OrZTBiWWMTBwIS8=; b=b/RaYsxE9MNxPrqc2Cml/IeAIM7WgC9O9xe+cYVIA7FxsguKJuSEH+dy7LqoSOHN6fQLP5pIRUArEUPY/zjlTWpd0Z2uT2PiQ4j0+eic0T8SI1sizCEL82ZRbUCdAAhExAXtgb+/B39wWy17Kn2UJSjKdXCKSdelHWBAuVpIgKw= 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 CYYPR01MB8601.prod.exchangelabs.com (2603:10b6:930:c5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug 2024 22:12:45 +0000 Received: from PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4]) by PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4%6]) with mapi id 15.20.7897.014; Tue, 20 Aug 2024 22:12:45 +0000 From: Steve Clevenger To: james.clark@arm.com, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, leo.yan@linaro.org, ilkka@os.ampercomputing.com, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "steve.c.clevenger.ampere" Subject: [PATCH 4/5] Add map pgoff to python dictionary based on MAPPING_TYPE Date: Tue, 20 Aug 2024 16:11:32 -0600 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: YQXP288CA0033.CANP288.PROD.OUTLOOK.COM (2603:10b6:c00:41::30) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|CYYPR01MB8601:EE_ X-MS-Office365-Filtering-Correlation-Id: dfcb3e25-66d3-4ce0-bfae-08dcc1653803 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: JnDJm4b5wfQP5xcWamW2KycDlxZ/HJ0NoBf/3Jyi+2vfbWOYc+3ATIYCk6j9gWIlUM0PbiFH/e/iCZmSw+YE3911bLImQEnqzJcckKJuF2lNv+rmUk8JsU0rjxVlfWOFptfzCPmquvI/l0VFOREHc/OkEsGT+sYItLQcbfgpx8tobx+PJJyoRl7CdGq+ll6iPm7LYUoB9KIcMKAjgBLhaXqgNq+xzgLS0G3cMuisSc2kT3Y7njFdbSrBiWE5cjUeJgd0Flf29GFg0JWj7Qe0P1xrJzeXHerbVvlCn+kAEv/qJFK5eYPVp+1/wPWYVKF6yUaRFdZppOJi67IXCMd2qgL1D3wjYDucnAgVMVlz+HoYKv6Y+nnJV2Top7IaAg+VVelLhgw/gDh8TiH0XIvlJEptR7NgFyNEmdFe3QIU4iYZQXYdFbER4meX3n84WcF1N66NMnMI+1sD/G87/Z8wCEDUEPcwuxZvtitq1cYWT2sbhxd7Fz+LmPsGmsGLSp8lCJ+fIZnxkFrductsoIa6Tlz86ofAHkLXVpmZgoivpzJR7snbRTd4DLNGQiPJA3/xDsL9E9n5AYHWtj4UvYlTy7uJLjEPeeMKQf5dQJqNV4DTO+Y6iTjMdDldCiLZyhvmoY2fzB6J/fszi7MYzWwHo0Uoxl2QifDuU4KvWJu2p7Hs81x/IqEJfeNc+bOxB28cCVHAIm0Wk4ai1kkKV3lonvkEiIBXwqD1QTpNi569s/q74H3od3AfuyOWOWq0MuHWv0pRwyjODAPdvgC5t+MBxuwFy3rVkhSull9RSRooxji0eTxmDdRpG+4E9Xh6Rekz4NXp6ckN/bu8FBDqTRVR8oYnqshAWUXsazuXTLx3jCN3R0JqQ9SGLV3CVyxwVfP046l2lAua+XLxBAMPbtZZdX51mID2eDbWgxll1o9gCIWREuXLdHg43EZOJn9Y5FCeVkZW7ehByF02anTahcFyvtzoQEHOZfn3wyXvaOFq0RpTI/ZRPhh09Rl7hI3IPepsNPo9eCh7xIUWWgQwD+yKnuGOftG1gjMew8Q1ukgwMOCA14AkUY1Y8AW/Im/zVkMsZJt0wz4CX/ZxVSiBmYUn0fXex/igfeZUCt2QAyyzKfZOwwrbhqzJBlxHN1dDXhbNSoEOgQK9DN0tFm05WHjQOiV7zfMKPvXK9qqY8cxOgTP29aG5nlMGcelzE0+i4nE/2WvU/E8vmiM4k4zIDlAaTPlAq0DX8SgiTBJsBl3lOA1DCvXVLA+ZzrfMTY6kq0nA+Vi6eukwByoa+W6XsyKhj/wN9/b3WtkHHGJo46Kaz0YBmpKJFSTOH/km+sNWVsIYSOk8b1lSkSbQjoArawoTL/a4pUNKLp50Afhv9/yh5DjgEnp1jySqDyjWwyh5EfHgzhlfvUw127tkXVm24boOGA== 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)(366016)(1800799024)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qYhOdPBviZXJc3Lr0/vdbV58dFbRW+cnuF6r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pDjM0AKNCi1PLJRW5+l+xdtHTo4kI8uWVf1PGroR4YsUChcIiLA52np7O8rDMbutsfRJfNjB17X2hnApAe/xhwXBO6i14LOy8CbN6UGNpX0aChLxlwa9LLwyr0muYL3ufAeo+oR5BfhEM7NiEQMW1gr+oWl2eC5qBkCRe1mK4xAWdhvhseHya07jaAEg2tOrxf01SrBH6LiycVVO5o9JdHdR+G4ohALva7VeX00DQH5QIgf2hkhrRdnZoRSfgHVW5WwQwaXfu9kg03+UlNGGswyx0pTzSdeyo9TOrkpjLmHD4+CnH91RAdQytN3ltcFlD8vjz10/uUfpYWdMktl8iI9ivunpflTLoB+vxInYDZQAZcpd6v71laoRSMBmxXcDzlxjF43i4fmMY16xcoetcpRq6fDaPtBVAOlcdk5Mz39SI5VpgMsMMR5E5BlG2XbJ6BxKLZ7mTSk8raps7RfR5tJjJiONsgsUYMWcZw8qYHIgxUxLp8uIB5tueP3sakKuUHMBtbzBYFqlhsD16dvCpr0CuiT7dWETzlElMQr X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: dfcb3e25-66d3-4ce0-bfae-08dcc1653803 X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 22:12:45.6792 (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: j0Mz7L2AXNTeZxOV+DG/Y844JVsEZ898HHZ29USoQztxtP/pGp0EnBxV/3YhtVQszaTqQlgCK13FMa8ghwjbqranb8YMmP6X103huID3ylvrTqhttNvgWUb1yJmDy1p2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR01MB8601 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240820_151259_455620_2383CC74 X-CRM114-Status: GOOD ( 10.71 ) 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 From: "steve.c.clevenger.ampere" 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.c.clevenger.ampere --- .../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 fb00f3ad6815..8a056c3574ec 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, @@ -898,7 +905,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); @@ -923,7 +930,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", "map_pgoff"); } if (sample->flags)