From patchwork Thu Sep 5 00:11:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13791563 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 E53FBCD4F22 for ; Thu, 5 Sep 2024 00:17:20 +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=E92Z8axw+PF/hw8s7yBM5yMtbfWmL0E3tdVe3o1qOO0=; b=u6Eof3oIitQKKnR9cvumNIl9at uMGlpYE76ZPZPU9R3f0pXorra8kVDsebdg5E5evn8UtJlHTJPaDwH3RRKNUcOrXEIzJpjLtJWC0lm LP4nQIA2kEE8fc2JCbw3GnQQaKsH9UXSMpfcAZZLEPwfqDbhep8fMvICEb9B+6vae1sHJrThqoRxX p/eRDrDH14kvzzADObPGrD77jpywcek6WIAif+hzLsPsAbVTsFrdQ19XZ/HZs0WtAtydvXSQHZSTK mBlQZPumNrZyYfIQX1cFIkn92GCHwjf9IQA+7XsgdkAmxd1UpTIgp/LaoNThL7w3IqucpYnoYDGl7 RtW2DujA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm0BR-00000006TCm-09W1; Thu, 05 Sep 2024 00:17:09 +0000 Received: from mail-centralusazlp170110009.outbound.protection.outlook.com ([2a01:111:f403:c111::9] helo=DM5PR21CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm06t-00000006SFz-0hdM for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 00:12:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wHKmMstH547ba8qMupac/IWIdKmRLawROfPC717l3Tg/c7HA+TTPdnyjvZ3UUCb6lwpuqG/3nSK9jODRwELM2IgNR9xTKD1t+yoH9pbwPO2mQk0b13yYywQW4VaJV1tVLtllyIehp2quFba28FilFiCEzbTZ1RhXRUkIGfxKV0E5BBkJBL8z4VkYOULkNejH53metslydyp2vVqJPNhEqUdza7ybtGdpBxE1XAQKk7wAJd4kvd2diD8mrCYOpOkmgZ69uY2DERJCIOzSaodV1p0VetAYrE6v1/4oC3te5y0KqIJ5GYD9FqsW9sLt89r2Gc5V4XaLZPkrKP+vZy1DpA== 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=E92Z8axw+PF/hw8s7yBM5yMtbfWmL0E3tdVe3o1qOO0=; b=SFMe9Mz8awjV5JT+jjfMgwXCYNO1petYXf+vb0LUkDNTbM0W+XHSZb2mSX7wRdifIITtwYPSNjDxRBwASClj/JNvp4sHKSssg8Ei5aiN3YKaBUVTVgI0ikkWB2msnYsEdR3JUow8IiyjRyQFlAWXcEER8xVI5GuOf6EjXTzh8cVAI8V/jf5sft8gJ/lBI+bwfbenU4iG/2ogQ0QoeGhZZaSAqFlk/6yWAR/aGIO5DCrcS+YLYdE3IpTE8e4LobCLTX1l2B9rp1yv8X4dZHRKRnmNij2v6eNSEK1BLX/YeOLb0ArKz/pjsK8C2YSdqjk0ms3qCM89mwDNHorrASKUzw== 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=E92Z8axw+PF/hw8s7yBM5yMtbfWmL0E3tdVe3o1qOO0=; b=eNWWAFp2/HFsWFXr4dnrn72dbipdyM8+gh2wppauChvIHHByeW5XfuTpjFcfDJNu4gKTOmJOb3+65xW5wpLRWXHX7Bl0hpuzly1bnHbe9O/6PwImfg6Uyv7kq8wyA36M9MxhUj2Yjfo55/TMILXmsS9KCubOzBLfaZ2JZEPXcvc= 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 MW6PR01MB8365.prod.exchangelabs.com (2603:10b6:303:248::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.28; Thu, 5 Sep 2024 00:12:16 +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.7918.024; Thu, 5 Sep 2024 00:12:16 +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 V6 0/4] arm-cs-trace-disasm.py/perf must accommodate non-zero DSO text offset Date: Wed, 4 Sep 2024 18:11:33 -0600 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: CH2PR07CA0050.namprd07.prod.outlook.com (2603:10b6:610:5b::24) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|MW6PR01MB8365:EE_ X-MS-Office365-Filtering-Correlation-Id: 9199cfb7-ee34-42e1-74a7-08dccd3f6662 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: D1gPYh316hNitbw9rZPTDVwaC7cvbNjROFwSehlRNhW1kFHS5uGxv5UfIMfAAVbPCh/8Zqu61OhjqL9awA3bEFyvxGuhKvgYskvxJxfuDpX5qx1ZvZ3BWrzQzWF4nhLrxI3OQq2XHKtGQsOXmiH6D1k5+1liVrQkXF4XuBHZAkmZY3SMmOhmEoafWPGPVvemIyF0dgaMrNbhdFrxXSBVZH01MPXCdgZCPJDxK5c/3OdDT2vyn9yJ+leZ6iqX90+HrtYRKH9rU9uqvz2ZbfW0dkIemD0phgRvQHb4pL/bRMHJRWNX9TFBopEHF3b/6i8UvY8Dt9AaFu9EDMCGCCYJMQVSra2Eh5YjecxF6P/+VoCLfyuPYh26w85klvd9tk3E4vww32BsRkpYz4aI3cO3kVqy/ksVtE5iPiYK8L7k+6+T1DKbJZ1U3bASytqy4zL7jWFyD8H+fvqAj0U/yW6GIWeKMMJ26Nco0lsmJT2D1jfSW1mvwTXoZrKJhdPfqAKGxzshOMJyXjYzp82rQcizjuof+EJhTxwRrGJGfeFFYptQzpmqMkZ8lNZhYkxiv5vPDZIeyPq39f1yE7QxLy+CvdrCBZG7u3nVBpvfTjtAOvIABrCu3GRmq0LVCZb/2MlgFZ6Ksbhqybbm/vYJ1UbJ4akRn8UQgnSvvPM9OXkHnV9TU6wD6jk5wuYO5Ru0uuqx6WSjFpW8QtY46CGQya/TkFIyS35Ole/FTtendc2WCG9zyIBt4Tn4DDt01jbNYxWpry4DoGkP5vQE59QpOJzgBa5d8NXjsJuJ+KjyIR/DTzZk1QQosvccK/rioGFY0mKFayil8UyiaRe7Gkq2CL+c9B68LyLJ8e2K4uHK7hwf0ikY2RZYddsEH5ykdzoR4fA3UCV1VfNRw/YKqw8wrdmpS5xWv5+zzYjQDTAtt01QPE5FC2z7rpEmD03puokhIt+8z5DoGNiJU6g6G9c7FLNEpoKda05JyFMj7UmtGOYqu7uT5Fr8hkIiN7yI3DI5/TkNCG3axY43J5DEBc7HGxhWIR/8k701UENRBMSG8UTrCJ4nxqp5jmzZdOMGdLvbeWi0rqi30iqZLfm3DhTcj3WgB6IvAA26ObNuR8RJVbhWWnhcWr/+ob6F90nG9WEOhY/O6J2WwYLVDo4Nl7iy8RKHmVb4ltQeVW/Z/ywCuCBwUsDo9e0X0VUCcyaR8R3nnhbdPS5aIuu8xJ4pcCfJSWBzbCmG+B3KTpDoF2R3eSRqNFKuiaHOPg98V/T/XGS4ZMNmYCxIg/3J6F65n+8iMChntKHUPbEZEcRy5KRJeqHiCyGxsesU93n3yVykJEMfidQH3XzwJ7HtnqMpFwgOyAeOkvq0pXtvaSfDhwzpoiYsCqM= 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)(366016)(52116014)(376014)(1800799024)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1PhycOyRyE2WVUoOb75bEkDN3uCT8B8TVjnb3Yw3tWDaafbGwKcIo6BgL0BiIugiRb6PC/7BL8rVL2A8l6XY5qPk+V3IIeoQrgvL5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c9dVn1p4TTWv3SLnAOjsLGaCS6yy4+eXuvH1IfVNGEfCtvn4AlNXiqTxRV8jC+pdhGGDQqwDZPz3kOAXeEDwX4cSgoh0ROxvF0GyVzA738J/BNxo8XPEQE37F0Oe9l9+8d06sv8xDO81kkSZUxkkdikI2Ho4/G/EOtXdPYa3T8i9xf4YuXUSVFW8dQTwJKMyLFXk/zKo3xZdbt4rDjZpv5Lxh3brm0/zQ3fbiGgdW1/xxWCXBnR55ouVTAkB3WzqG9REGLIbPbgth7XdxTWY10T1kaghyQxx9kLDCOvM8rmxxmbcSr7AyXreeoGFmfPjObz277BrN/ptE9su6V0VSLk8o3PTDC1Cr9Q7WqvS5cudHpzbhPevUgRaJ4vj7eIIKBEv65qkzJ8j0Ez7uwbm8vlW3DDzGUfPwPuNH+Vwsv0otVdoLvsR+SoTuWm5vRIcR6KP6h3v+xgEj8FUNRwNXTL3pgKvhIUWWwynfs6 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9199cfb7-ee34-42e1-74a7-08dccd3f6662 X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 00:12:16.5032 (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: 65mQ6kLIy4ybdzckR/6QNWDR0gWCJLEVN0qNAWurOvr74DkZf88J/InJ4ckd6wlZ9dJ1lXCsGcP1j/kCYW7SAaJ+qqR00rg74fn+wqCJK0zcK/dV8k0GB5wHZVHoG+oY X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR01MB8365 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240904_171227_232986_0EF71C32 X-CRM114-Status: UNSURE ( 9.07 ) 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 Changes in V6: - In arm-cs-trace-disasm.py, zero map_pgoff for kernel files. Add map_pgoff to start/end address for dso not found message. - Added "Reviewed-by" trailer for patches 1-3 previously reviewed by Leo Yan in V4 and V5. Changes in V5: - In symbol-elf.c, branch to exit_close label if open file. - In trace_event_python.c, correct indentation. set_sym_in_dict call parameter "map_pgoff" renamed as "addr_map_pgoff" to match local naming. Changes in V4: - In trace-event-python.c, fixed perf-tools-next merge problem. 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. 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 | 12 ++-- tools/perf/util/map.c | 4 +- .../scripting-engines/trace-event-python.c | 13 +++- tools/perf/util/symbol-elf.c | 61 +++++++++++++++++++ tools/perf/util/symbol.h | 1 + 5 files changed, 82 insertions(+), 9 deletions(-)