From patchwork Wed Aug 28 01:50:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13780457 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 D5C94C54749 for ; Wed, 28 Aug 2024 03:30:45 +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=czhYmkK9bQySdWek7NVuIDE0j/g2H8moMSE7Bg+fmkc=; b=As6b9ohcPCxuolaEIWigzqj0gj zs3YaCwK+z5ZqYJfGykEQpGevkJdwJdelglPf4ZxmoNu2DB/U4kmdJKr+dTv4zeb3z6GZxyLMzCn6 nzAE8dCh9GRsw4ILvY74XyB4LZx4qMoSJ8wNfV57xSMmPgUhtg9cVgxMLFJUqd3179rIN6jm/chxC beqf4yzvpFhAdNYV6dINEZkZRFspCRhOAxsL6sYWh5Jlj15uCwn1wISoA3A0V/29/LY/lf/MDFjFI bGpoRy0MIgN4cW7edGm21MkpIDe2Jx1CTOuFHwqZdIHxpeEwTQJuO/NOFKddBIWh7VokVfBbzaDTH 4xgICddw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sj9OF-0000000DeZK-2z9y; Wed, 28 Aug 2024 03:30:35 +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 1sj8KP-0000000DTCQ-1iBj for linux-arm-kernel@bombadil.infradead.org; Wed, 28 Aug 2024 02:22:33 +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=czhYmkK9bQySdWek7NVuIDE0j/g2H8moMSE7Bg+fmkc=; b=D4vhggZdh1ovp13WPpgSsekFIl T+SOrQmykuWJciaO5+FPkPbyIwRcXkQWVG06I8na8zOs467cL1n1yqkCAlgJu0sv7xIjCr0zhf55W ehUFo/kurI1c8pohGdLe5PORyZp08PYtp1eRzx01q3FLLxqjxT4yOUsvO/VZQmMHvtS2atPqYtEUj 9zaU4zlBOIdK3CvUj38ZtiNMeHccKMYVUTp4FzJGEsiHJHoECzPj41FyaRBNrFbfnu2umbzKuz1b1 RTSV8DS+ZnSW2reXYmKl4hcvlnJHjkjMZ3p3poZG8DmYtfVs1BXvnGRtZjwj7TuYSDnEZmTpm5oyR ay14d1iA==; 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 1sj7pn-0000000Azbp-003E for linux-arm-kernel@lists.infradead.org; Wed, 28 Aug 2024 01:51:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qp4+gXUWRFk6KuywfLz8ul1lcrdnbplXbwdCLsDxDJJYdr09f4EuFMa15RZJ5nwID48DkrW/2sZ8oVmeeM4H/IxRQ++OTnqlVyDCzieI1Gn/xrzByvQMyQiuM8j+IAuqAXRQ8tvaoqyM3O7/8GdWehuCJlK2S2Jpqc5pVmHtvzwNcK1GEpQx0Qa7sV9YLHdz1H/+9XUtIwYr2km/BCK8l5rEADrLa9QYx9UNzNnncKCQBwAuETk5l5n7ogstd+XvnYgQ0Hmgo6Ry3VHfUo5mTW7drCk6TFObxn5og5J7TBk3yQwIyRhdKjrYULbSWI509ilR2Pna0YM7laTM22l3Ww== 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=czhYmkK9bQySdWek7NVuIDE0j/g2H8moMSE7Bg+fmkc=; b=rmKifujpSujBBGACfbMUOCijwBbHQI3cS64QT/RBhwYEshDwUY0h7q2+qtbeO2lXXTy3BrKYwVwjOpg6GxDnWgG4lQV73jTk2B05rUY3qWuLKhVk+yWg8G8HOhixD+c5aZ/LvaOEh5sFpAab+8bThZ7SV40SwZJdTyo5tdAmIbRH4jNSnMF2KPZwxn3pH4U8ALxbbsdNFpr/FeLEdcorP4qxWK2SBUVhY/c/CS6uKcn+5rDH7BWEdJ9dWUe30/kXkDy3X02oWoT5/h8wjZ8Ad2Vrqooxp/3tz1pXWTsQhPidDTi5DuOGJVuFG8aRhMMGni4waM4O0qO9tNmuUaNtTg== 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=czhYmkK9bQySdWek7NVuIDE0j/g2H8moMSE7Bg+fmkc=; b=Q9AU+2AcsfkGrqsU4PYY0WmThG48/sEOLWtFXzJQGGj/W0WzOjJ3nf80GJtUfil1X6JKShyrQnxVGqmvmOZBbn3JRIstVOPugBuVKxT4iBudIm4ko5ktTs5m1QmzIWsnhMtsG0VUepxVTaxL3kAymlWG2c/OcqqpB20KxZ/EHoQ= 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:40 +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:40 +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 0/4] arm-cs-trace-disasm.py/perf must accommodate non-zero DSO text offset Date: Tue, 27 Aug 2024 19:50:17 -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: ce8c25d8-cfb2-448e-551f-08dcc703d1ef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Micro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UF6JpiRrmTG/ryaPw0T+VboxdFHJmA61HHwNWBIreAt0eucrhj9nxoZGgFfHYRf2PHQvQNjy5YdPgPh9vitugq5AFamY8a58qxfM0CFbFat5Mok1vQUpODTFpA0iALIkr906UrKwVCH7zgrYgaBDQc3BTOTxdh7fpz8ctlERyHv3zOMfMwBIFNttAzeuTJW1N47YeqWyYDVUYHsnZbJbWaJJg/vq/ClBc1ox9oULN1S2MlMKL+c35jqsHL3yTu2akPbN4Y7fjIH4PY6m/37ajDCIcUJdRl7D5KasQTvp6fz5Rt/xs0h3qqAQi4k/uhuPGuRgLiOv0ARoceVizIj5J4sO9fcj3S90KX+iR2H9KS3UDY1Fu+DRZnx2Lk= 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: fFhLYw6wLBiK43AmPUxQWiRlutUWf1cQFq3bpJDJCmxezt5rkWiHMEas8e7TzxTEax9OHsBvZM53QnUBNgRyxwrsFbYsxkfRq+lG4KTyYp923MU65WWzTYIGliygFL/67u/3xAfrZge797rRkYZ78Zgxak/sF0Mn1WHzxKr3xc4DQQn8uP4XKbyThyfkWinnZl/gYzZ/PV31Z23ewdGlEHhSeM6cm3bwUUBeQCRvoOQdjCWIko00y7nWZjXhfS/3rRNNGTc1CJolnh0Jr8bne4Vy91WvbKUDxm8XyLZy3IxFGCyaPs+g66r+pKQ0Krinmlg74cus8RVYrVgzVqtuc81yQglTbDW8eVwyhcHMEgWc9aLSxX/JsBEZhjq4C/ztxxW2LUUTxuSw1xBl/UilR9RffsErgkexjViV88ge2jDuNbHcAIW/tp9wCkkz07xiQAmFrdoA///fl/bcSbgb4tFGb0faCQZ1RRPikqiMb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NdgrP0ydK00gCECfoaER9eds5OSblRt8FlUAt8CEZDGuMl8l2DyBPpMWsT/DlbnBS25Pb1ViQyfIAaxjHmmK4sXmluMlpg X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce8c25d8-cfb2-448e-551f-08dcc703d1ef 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:40.1750 (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: 9DyTE0zNwRZZs6o2CWIFd6WQSzkVZtunMdqKFLQlr077kCu3MPNMqoxj2JcR7PSof/Pi/VhNgcfOl7UAw3k5yBsDu6IXW0WIEE7ygYgV2fnJzNGfBlPe4ii/bu0/3izo X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR01MB7576 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240828_025059_986025_B2168771 X-CRM114-Status: GOOD ( 10.18 ) 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 Changes in V3: - Rebased to linux-perf-tools branch. - Squash symbol-elf.c and symbol.h into same commit. - In map.c, merge dso__is_pie() call into existing if statement. - In arm-cs-trace-disasm.py, remove debug artifacts. Changes in V2: - In dso__is_pie() (symbol-elf.c), Decrease indentation, add null pointer checks per Leo Yan review. - Updated mailing list distribution Fedora 37 distributed shared binary and executable mapped files show a zero text section offset. Starting with the Fedora 38 distribution, the shared binary and executable mapped files show a non-zero text section offset for some binaries. The text offset parameter is never passed into the arm-cs-trace-disasm.py script to allow the script to adjust the start/end address range passed to objdump. This adjustment is required to correctly offset into the dso text section. Not doing so results in an incorrect user instruction trace display for Fedora 38 (and later) user trace output. Steve Clevenger (4): Add dso__is_pie call to identify ELF PIE Force MAPPING_TYPE__IDENTIY for PIE Add map pgoff to python dictionary based on MAPPING_TYPE Adjust objdump start/end range per map pgoff parameter .../scripts/python/arm-cs-trace-disasm.py | 9 ++- tools/perf/util/map.c | 4 +- .../scripting-engines/trace-event-python.c | 13 +++- tools/perf/util/symbol-elf.c | 60 +++++++++++++++++++ tools/perf/util/symbol.h | 1 + 5 files changed, 79 insertions(+), 8 deletions(-)