From patchwork Fri Sep 20 08:18:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Brennan X-Patchwork-Id: 13808242 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7CD4487BF; Fri, 20 Sep 2024 08:19:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726820357; cv=fail; b=dR3e/tfxZV/1FcVZ1aTtjTrm+uBqT+FWirrpu1/Uv1kvXUB8xdNyKbgLCzyIAVKCSyynPhRAmmxN15y4ChPu6PljpSIeVk+WiTIRvb76EKhtMKK8libUBV6wZ8NqTByUnHzy8RT1fCxXKBT+OAZD75e4tJJjUkaMrWyqDB9lWEM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726820357; c=relaxed/simple; bh=avs3G9Dv2J5iF5l1n9x21JdKk74/bGSyOSsm9F8DxyA=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=fzLpSp5iQn9NaGnC9ma9GAa079iiChX3bt9amadNLSiLd+0WKP6KEv29yrTiGCNkrYL4jyvIEbepuhL/IK0XJ85betnAsB53mfFICt+9hBxC3URNK/SNBoaOuJ3H+nSXlGhhCDf0qXo2BlT8oI+6qEIwLFg6J1ltftcKyjG+6LA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=HFscIqC1; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=zNJAtQ61; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="HFscIqC1"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="zNJAtQ61" Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48K7tXEs027904; Fri, 20 Sep 2024 08:19:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:content-transfer-encoding :content-type:mime-version; s=corp-2023-11-20; bh=wqk7SAbKnY/inv SffrLGsMdOcexyjVbqJCASDXZrx78=; b=HFscIqC1pGaIHl3NTrSlHbSJeC0vV7 Tcq+n+h16+j+xRdPWGzzfU8lo7qxnBnepay0fAQgAJjbv15qAHw4MoNQMZ2Ga8fe vlEvNCrgWBzLHrwxsHRrBIUoFzqk+RBraR8bTCpxu4tZ00naW/00wGEvYABl8BkN LppO0GpREuXHnoK73813bOXJBFGYTQkjKVJV+uuRZRTen8Mdw88e0816bsuYrxYi v9XRYGzl1NNOFkSFLD1et8NVI0PCsYecKlfdkVS7DSfAx3QVyiizbxzZAMayJGV5 aOxINaFIDmQQKOjyiuLepup42M2P5tyc3LZy6YreBng3nAFF4LUDTIqg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41n3rx62j5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Sep 2024 08:19:12 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48K5mrbM018222; Fri, 20 Sep 2024 08:19:11 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2171.outbound.protection.outlook.com [104.47.56.171]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 41nyd1jmya-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Sep 2024 08:19:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CFwbtVo4xp8e/LWsCFIVf9BIw2Eh+86Ncd2nyyQLSAZ0RFKrJYeg7BImwI1B6r9oI+WMDYLNkVbk7wCQApzAHZUNPUplwSaYJWeRkAXh7QursAMn7YrnbPh66xaCJc+LFNktjk/kJOk5ZsCDt/Gu3w5SodqOba0Se3+zLgLA/sVve/TdZXJgTXe3ObsFFsBYkeG63b0PFN/DaiA2XWUEPOzdHTnhBdWSLx78aRKCHrMyCbul3oRnGBHvzjZf4oGxWT7HyaF09tTPkJG/C+zerUqczuWh2C6lACYHrzp9+7QzUJY9L1ewO3vcmxW+JCGZpD/uGk2ID6h4Zorn/7JPqQ== 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=wqk7SAbKnY/invSffrLGsMdOcexyjVbqJCASDXZrx78=; b=WFgYNfnEAEu2MHFMi4/xkthfUonwrAP/yhMtYfK6tyKGoLLLiUXGkSKhX6HmgrEy1olQ+CeRkwMcBETxHwMc2TV7yI+DHMk7oXkLdkn/6sQDqFAyGBZjJP8PS2oCbSUNxEU68/xBbJhVOS+lUnEtRU+pHsH4dWN8WfByqDgqi3H2aXfY2T97hwJJt4agSvI5eTe5EHfPLnEkDBn98bUgOJn4sXMcC1G+DN2goBpstuD5gcjV/CNJH00vnjWXEzyK9gmr5GeZqG6FIxWAS8dZt23E1fkBnHf+xAnRZk9VBq/+M4L8upI/fu0oOCRCmR5EPCzx9A0Kb6FG0iuNWxK/cg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wqk7SAbKnY/invSffrLGsMdOcexyjVbqJCASDXZrx78=; b=zNJAtQ61kl04SOZaQZtetDCeHM1xY+Hb2IuAYC4poL5m/ddjrEDUHomVJG3Znx+mLyH1GlGieQZbOOFgpMnZkQUMIy4/VmTVDb/Wb6etX5rsuhrUMX7f8OXkenGYFi3XXIl9+xi5QrQjmu8UJtEJ/n/DO/xdeppiEzlMa0JYvf4= Received: from PH8PR10MB6597.namprd10.prod.outlook.com (2603:10b6:510:226::20) by DM4PR10MB6037.namprd10.prod.outlook.com (2603:10b6:8:bb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.9; Fri, 20 Sep 2024 08:19:07 +0000 Received: from PH8PR10MB6597.namprd10.prod.outlook.com ([fe80::6874:4af6:bf0a:6ca]) by PH8PR10MB6597.namprd10.prod.outlook.com ([fe80::6874:4af6:bf0a:6ca%3]) with mapi id 15.20.8005.006; Fri, 20 Sep 2024 08:19:07 +0000 From: Stephen Brennan To: Arnaldo Carvalho de Melo Cc: bpf@vger.kernel.org, dwarves@vger.kernel.org, linux-debuggers@vger.kernel.org, Stephen Brennan , Alan Maguire Subject: [PATCH dwarves v2 0/4] Emit global variables in BTF Date: Fri, 20 Sep 2024 01:18:57 -0700 Message-ID: <20240920081903.13473-1-stephen.s.brennan@oracle.com> X-Mailer: git-send-email 2.43.5 X-ClientProxiedBy: VI1PR07CA0160.eurprd07.prod.outlook.com (2603:10a6:802:16::47) To PH8PR10MB6597.namprd10.prod.outlook.com (2603:10b6:510:226::20) Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH8PR10MB6597:EE_|DM4PR10MB6037:EE_ X-MS-Office365-Filtering-Correlation-Id: f787c6f2-28a6-4670-6f4a-08dcd94ce55f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: Wnmen940nw2RCFtbwcqnoYz7g6l1yJCzVuRjHt17PPrKVlLLH1RU/YcycWRn+/eWr7UCcpZ8aBz6FPo8k+lYaHpKEtZNwupubsOlx0EddEzk0Q3AsGAxRCvwCfZVFNT3RDq8HmVOE4QFQef6a7oy5oML2+m1a37zaxMkTpISudlCYZ9TOzjGDMZvkVuYrG08RvKgjLo97eOEs3gZWfgfokNebZruP7Bi4tJJLhxd9q/eziSGsnlT30ALLCPEVkrQFJtz/2lsoEOtSGTj6XNt081VVC6DHHo1XXIbdZ3F3Pu2Yu3rHkLUGHoaHkFaLDjXoR3W+uzLaSbaCXjkeqrQ2ivzhnBJ311FHKyX3lx2jOoOfzxkVGnQLfRiqzkd3jC5HMvdq0BhmfQwYcfyWBXTwpVNGqx9PEj63yxq+tT3ZYnvnO6t4raYlZItw6MXTpE8vmYanZjKdUoMgs/wNs5kQjrqBNB9++cBQZUFko4g6wrx2A1pHWmDCWndCAMO01V04dfwbOa1633PtoFOeI7I6FVtlCtUW7UxAzA4rQfw6A5bunFSNSpojWM9h8a9d9BAnLOULjpl2Fp0Jf3y4oFlUGnnIYQnWG4sO+83p5aycXsBlOa+o5TtDwDJ+j8d+TPQV4HUSCrvK3U88HZ1eEJgm7d6oNz2bCrTpM2D1uoO3lCOYjCN2eaXtjZ5MHS2wJWKWNpcJ2PUewxVCAvAbuIeXTHnhMLW4R4qAXzrtX6GVFS3OzldjlaLpU0UHQ0w/CpiMkA6TS3hSCI3nopiiyxIcnW08HFu2r6uGO5ZaTaSS9k+horwaJhPrudVyuuv2hlnQeim/huwNKZlcJBJ3l4NguWOx1y/QrVKTdY64sGsu51XrsZKc95zIETpvpAjgdr3B6ENKEDvmUZ42l97d4GTnn4bzjCWRxAMOC8Ik2CxVG4SWVgLqVwZ7V0rbSU5CXVD/SGm69j+zvJyDvXM01NQ8cwAQ8BAVbJnZPgl1eVMOgfrUcOcvtkKfYe4APWEEFWh4vIwFTJYIFsZ8NK3d8kqbq+4EYcEs06Iqp+WGLLMF5i4OShnuwvz5GN8e7v23iK1tujoLsYd+lj/99ltBWUs5iKqPRPePMFHeSdo1pHhp2JBQXd/OX2Na6jlv1pvK5/O/6EIFjMw/KjoIVhUyUag+BWtjTInKpSqHV2mlJRErqsogom2Z8gpk5VDGjmVmdYK1dl3cdrqNCdSpR8tMNW8ZYO2mDkDSBFuYwKyNeMC7qoMV/CX9Xi70KiATMGKbb3qcupj7cyNolZahbs9hgF9uQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR10MB6597.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jIcbFu7Uh8T/siU/2G5itixG+PfcitcGn1x/FuM0oj4SNmla5l9FeB7L3xF4X8ALTGFX1WmMRqt0B/HETLMPUczVkxT/M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9pjeFNJBp5J6XSYZRPLAWlcXBcI8BkYW4YSwp8LtwZ6ZV0uG0qcMpTHEutJKy4dvYDCHnXwlBFj7UAl8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f787c6f2-28a6-4670-6f4a-08dcd94ce55f X-MS-Exchange-CrossTenant-AuthSource: PH8PR10MB6597.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2024 08:19:06.9535 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xl3pMOUUVTfZvIzWX7z0UKU1E8pP42BnO/4mntGkvDxFqiE7LlWjkvfnqYZ28z5fQcSPxP4voVcCpt6s6Xgc6yIv4xqUxMz0X+DALn7h/Sw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6037 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-20_03,2024-09-19_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 spamscore=0 mlxscore=0 phishscore=0 malwarescore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409200058 X-Proofpoint-GUID: lsIHuohGZUWUcl19PqcxB9R56Bo79Hns X-Proofpoint-ORIG-GUID: lsIHuohGZUWUcl19PqcxB9R56Bo79Hns Hello all, This is v2 of the series to add global variables to pahole's generated BTF. Please see v1's cover letter for more justification and background. I've incorporated Alan's feedback and added a forgotten Cc for the bpf list. Thanks, Stephen v1: https://lore.kernel.org/dwarves/20240912190827.230176-1-stephen.s.brennan@oracle.com/ Stephen Brennan (4): dutil: return ELF section name when looked up by index dwarf_loader: add "artificial" and "top_level" variable flags btf_encoder: cache all ELF section info btf_encoder: add global_var feature to encode globals btf_encoder.c | 373 ++++++++++++++++++++++----------------------- btf_encoder.h | 8 + dutil.c | 14 +- dutil.h | 2 +- dwarf_loader.c | 12 +- dwarves.h | 3 + man-pages/pahole.1 | 8 +- pahole.c | 11 +- 8 files changed, 228 insertions(+), 203 deletions(-)