From patchwork Tue Feb 20 10:24:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cupertino Miranda X-Patchwork-Id: 86023 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6F3033858403 for ; Tue, 20 Feb 2024 10:25:28 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id E93263858D28 for ; Tue, 20 Feb 2024 10:24:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E93263858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E93263858D28 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1708424693; cv=pass; b=lhizrPjjlhmL5KBuaS0K0t0MprMQs1/G9l3bBI1smE046UddHXAkOtNBkPB5E/aGE7jsdLYQNm60x6D7pgOxD7/FzBQTfgGf3te3bxTRCUMNHfI1w/8w6BlXkPuvkrcKW5OO8euF7jZR1u+jNLAfLP8xr4J2nRq9/N0w8I597BI= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1708424693; c=relaxed/simple; bh=NMYWPot1FA4HKmfEading/nIVwgMd8iB/tTFyeT0ViE=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=dIj9BeIUoM936Uu/Uw9SQ7dwFsYspogJMzsSecfB/9UeT3JCgAwr+Q+wJqtYShz5IG/5jpW5RjNZVAerF5+dl7/zinLBgijK1FkZKb+aAyHM4PuvUHvNTM54r+fkEC2m8ACbffrWlizguunvkyS4azmIHMirhMFopYGTOl3VCNA= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41K8xQ1r024929 for ; Tue, 20 Feb 2024 10:24:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=YNzkK/tD8TCHJZI43h/ikzP2eDbcQzm/nVjzU100IC4=; b=N0j8qcYpbU4vXUm0ECY00RVU3V5DXNf17YzjvoogCF/+M9Fh8PmOuCv1R9+uv0E5L1Mm cTJ9gidPaTRBkSBae7QyH2Coctxn7VF8Oe3y1XUwzm/gd5KGO1qML4DAyr7Mm763Q1f4 XiasmhBFw4VWR7W+u3i3m+3AeHmWCnzCRLsnueBucOet7Q1n52KdOFChdqYABBJhw2uH be+BiRlYWj5Z7ERSxGjhOKB4eLQ5PrjuwacuyqYidSJykwR3RUr7h1YJ4OHJfUUhIQg8 k93NnhTU/W4alp2FTZEsYyOydzmI/pbFJMn0wpcKuGfn+oLufmexaFwqoDemu8/fx1nR VQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wakqc6d2t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 Feb 2024 10:24:48 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41KA2C9M032636 for ; Tue, 20 Feb 2024 10:24:46 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wak8722pe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 Feb 2024 10:24:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I5Rw805XDvHtknFkWEP9lcUgmA1WRZv0f/7QfqsKHZ6LL7adG5vaPaashEoXYMwCp/D6dnHKY7NwB4PRPGya35BcT7vsOJAADxRcSQJKhBgRJZMrRnMa3qnEZef5Zehv1icztHBMATgBTLEQ3bXc/zqrkiYFcFV5Uoz+68KZPo4HWf/vgvsIv3QaZj4NpfSUkc6de/THVMourswXqYSbLHAqbOvgGQsumMGr+cmmH+9LxKs+bec2888V8Bs4UcyRvseIbAOFVJWOv4mUpD6uVYQqoG6CuM3Ma9/Gc+2j/Dfh+C+ItEuG7pU7x4F6PA+t3oTCm2OTKTMDWXjF9imQkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=YNzkK/tD8TCHJZI43h/ikzP2eDbcQzm/nVjzU100IC4=; b=NXGgT/9z63sZy7I/PUmiP2Pd9Bg9dwCfqoqSAO+iDkNteKYU5DNMzHSKG9oJDBHAiOqX5HcLs+yfQ12g9xbBOBd28UzFc1XO0soI3fVQSyAubUA+dxLCAuDY0H+XQzlrHonZrWOqS9/q3vFBooZQGwzUp4Rfqs7NQzfvOmmx0sskUY11qwCIhDMZudxzgjwhLvDv933cKaL7xePvnY4MiF9wu+whVA9Ot5MMuQjopuPkDOmiY1eDtG0lrGnfpWxqwWqM6gdChFVglaWnB0UYTdarYPjTA7qoABhgV8le5Muw1eI+5lChvZEcNJRFj5f+J06+92mnM86DPfOJkeddng== 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=YNzkK/tD8TCHJZI43h/ikzP2eDbcQzm/nVjzU100IC4=; b=gUqf73JDTnY8nsziOSW8WCqUtukAKYUTg0UJefarQInhoI9eqTLP6KM28+sqYy307K5oSis9qEICOkoKb5C7hxSBn3xeniRZSb/IhOkuuGPOx4H12OE+GIMFeye9elDosTKk8UCOHeC2z8G8+O+2retfS9AZnTvZeSOPAwHSyuA= Received: from MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) by IA0PR10MB7624.namprd10.prod.outlook.com (2603:10b6:208:491::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.39; Tue, 20 Feb 2024 10:24:44 +0000 Received: from MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8de3:eccb:9288:95d0]) by MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8de3:eccb:9288:95d0%6]) with mapi id 15.20.7292.036; Tue, 20 Feb 2024 10:24:44 +0000 From: Cupertino Miranda To: gcc-patches@gcc.gnu.org Cc: jose.marchesi@oracle.com, david.faust@oracle.com, elena.zannoni@oracle.com, indu.bhagat@oracle.com, Cupertino Miranda Subject: [PATCH 1/5] btf: fixed type id in BTF_KIND_FUNC struct data. Date: Tue, 20 Feb 2024 10:24:23 +0000 Message-Id: <20240220102427.1512739-2-cupertino.miranda@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240220102427.1512739-1-cupertino.miranda@oracle.com> References: <20240220102427.1512739-1-cupertino.miranda@oracle.com> X-ClientProxiedBy: LO4P123CA0668.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:316::14) To MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR10MB4382:EE_|IA0PR10MB7624:EE_ X-MS-Office365-Filtering-Correlation-Id: ac92dc75-9cbd-4e70-d0e3-08dc31fe2832 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /SAJCADdry2fiE5zFKa46+Ht0JibcO/qP8js38j4R+1J47WmvKkt5N9YOD2gGsaIHH6YVcTX4DRY7LjzcK3kQzR2TbRTcju8u6p6ntEWIxnopnSrijaaQH+MNEqERWZmaT1nQFVYTC7Y2+OaKSK9A+CgjczVHJKNQZv1yOcZOsHcB6+G6+k0QEhcxVm97QZE1pOLDfQEMn6Kez/wKawZnwfJgRA72bi1/KthGRhOdMLszJH8Ng6BFZWFiNdPKoxLbkJebef6I8p/XimymPJl5c/8vdquLbWq7s5ZYgW5gtqKV2DA5zbAmJ07YYl24LNSylz/YzpZeUJ6Hefd0ELpHha45EXPC2dYWAq7KP60iJHfRIP7ngNJiR9rU7ols5gcrpGtJDDGI1FnCVuotbWcs5sNIihZaqAeq7OQh3WCKBIK4Fw3EsBtZd4+tjg4hNNw6RCgWx8QJH1IamoBNcfaJoDu3h0yLyehzCGQlldp01dBqT4SHBf4V66o0wgxtO5JVhtCst5LYqTzA/8XOf2DVyW96GiCQgmItFr8b47H/qU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR10MB4382.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031); DIR:OUT; SFP:1101; X-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wbxnjFlt7AYK3t8DwSbCAnF4T9IjJxlJU2uIQCn68nhUqJqCgjGSXYikWF2XdS91tUraZh/IxiNr3vQTXf1iJRv74sptCvREYdCXFhicQ0qVzkzRHVie06e3RsWaupRS0uA0JHfJkvTBwcqYHm19cV79cFhjYeDKO08FvCmq2XNWuS2B5KjS0CrSICIGML5WfSJf8CgTu8cEUJIjatjeNYEvFtFQmCDqu4AtpUa3piyIZ3QTlK5k0cjCnG/BS6TdzIsXwE4wdUQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac92dc75-9cbd-4e70-d0e3-08dc31fe2832 X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4382.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2024 10:24:44.7711 (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: qlMfVY8bQjxP716c4J8p271KNtB2+m41P12S4+NLCrFanbo/P0Nu8MA0UyFeVmFcRhsxmTqXfxRaFJxhx8Qf9MO5khfGMIiV6DT9ju3vTP8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7624 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-20_06,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 malwarescore=0 bulkscore=0 adultscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402200074 X-Proofpoint-GUID: gN_bSD2nNnggzHaroVs-w2OTbT1tFomj X-Proofpoint-ORIG-GUID: gN_bSD2nNnggzHaroVs-w2OTbT1tFomj X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org This patch correct the aditition of +1 on the type id, which originally was done in the wrong location and leaded to func_sts->dtd_type for BTF_KIND_FUNCS struct data to contain the type id of the previous entry. gcc/ChangeLog: * btfout.cc (btf_collect_dataset): Corrected BTF type id. --- gcc/btfout.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/btfout.cc b/gcc/btfout.cc index dcf751f8fe0d..7e114e224449 100644 --- a/gcc/btfout.cc +++ b/gcc/btfout.cc @@ -457,7 +457,8 @@ btf_collect_datasec (ctf_container_ref ctfc) func_dtd->dtd_data.ctti_type = dtd->dtd_type; func_dtd->linkage = dtd->linkage; func_dtd->dtd_name = dtd->dtd_name; - func_dtd->dtd_type = num_types_added + num_types_created; + /* +1 for the sentinel type not in the types map. */ + func_dtd->dtd_type = num_types_added + num_types_created + 1; /* Only the BTF_KIND_FUNC type actually references the name. The BTF_KIND_FUNC_PROTO is always anonymous. */ @@ -480,8 +481,7 @@ btf_collect_datasec (ctf_container_ref ctfc) struct btf_var_secinfo info; - /* +1 for the sentinel type not in the types map. */ - info.type = func_dtd->dtd_type + 1; + info.type = func_dtd->dtd_type; /* Both zero at compile time. */ info.size = 0; From patchwork Tue Feb 20 10:24:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cupertino Miranda X-Patchwork-Id: 86024 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B424A3858415 for ; Tue, 20 Feb 2024 10:25:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 113473858C29 for ; Tue, 20 Feb 2024 10:24:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 113473858C29 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 113473858C29 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1708424697; cv=pass; b=WXkM9vRVjhm+E6YcfOd4YT7Zms1WQL1eSgwMTDBMTvW0RISiB7ZWwbW5w/rJhcCeisaZRa0iFbsb7Ym5qLOAMlvUtMi4nQaV/mBIiJAvYkfEQBKoBh7snzH1tpTpJKjK9npA90BEATtAtWlw7dz3XY1OCGBzpd6wh4cCY5gu+mU= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1708424697; c=relaxed/simple; bh=PcHZeX6ndbmz30LsyUUqArwyJnZ1GlY+AEFW4MN69eY=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=bqnOGQM3Ey0dovjqOqjg3nbNuVe5KyCe1X8fGfKFuhdxX0i6FvXA80X4EnG1cQuyGueWY/YdCI1DdHEcF1KhnLaK9jZzuH/2Hyx5nWEx9FP9OR4Eqx/X6nKx4MHEE9Wx5oSH1w5Y0yphyyGVSXbqs8Y9ZBnndJ3CqYBqjLrAgrY= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41K8xRvj024949 for ; Tue, 20 Feb 2024 10:24:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=HiSz3NJYnmgk/9dgFzYgud44AvjSs6Lu2gv97Dx27OU=; b=ECRTIRm9Eaauw/WHK/MMapNm3rtwZk8+HBc7V6hpPry3DwoD4zRVIqOA6WyAAbTs3Efa 0Y6+No+xuRcrY3C4OLZhdq62+DEGpZaRd4ERWjVCkMKYy/Dx3pnI4u4IJjwcsC2Liemr NtwysXfVkqDNQTy0heviUGTW5mtP88dKnCT+RpaKQYkNSIj3oSyxtJE6oytQeld15QxQ R2rLtOYkr2LvrOahZq9gOh6XwJcxQRby3grUf619BLhfBnvEzX0TkgsxXqPibiFa++28 sgxfgZ4YeBOTV1cEmaa7kCHLUvAQCRvFVaCJkWd/Mbx9T2sKVsACkYzAgmW019PwKGJT UA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wakqc6d2y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 Feb 2024 10:24:52 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41K9qV9S038568 for ; Tue, 20 Feb 2024 10:24:51 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3wak871dn3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 Feb 2024 10:24:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SGZPz7nwjXrYsDMhOHJJIoOrxXBCBHHq7w8Xkb6RaCLHOebIwC3As5oC5sWdsvKTN31wUWD8oG3KO4Geprxuv+U0oWmZBISnuM6MSmthNTJHz+nxGpgulBKPZ6fyLoEaNmDYn6EIbHzD/CfWp61pxgml/3AHQmRa/bP1IoxXhIJzPOCUPzvjcevNF8QjSPUVM3MzST5aWTcuwhCQK1hzNsA/K+vTmcXgAeXfcxuAS6FS3Pa7iszV/DrEl9yi9F8B46HfLhat1XMFxdh9E5bVBVZEk6zWhzdpUReEmOevAqjBuEVKHhYX448ybS6T+CNQUDGm2ehnkkbRmEqFQJPdfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=HiSz3NJYnmgk/9dgFzYgud44AvjSs6Lu2gv97Dx27OU=; b=Eowa+Z1uEfaTFpDyN7KZcwG4JyjhwFyILoYf8TeVb+Yw5BdI1IK7Zic1hcho5F7b5Pmb46cDHBAD/Xk6sn2suQxYpXPanyHqIQC/pMvXk1Hg2dwO1lYY5bDgL+y2MRXaS/zQkRMAOO6ABTWdX3f8Tg+sDl4bW3bzbvm6beU2sq0nX97QrUmqjmrX/IPI+q4BLefYdF3RTh/F3yK2Y1SGQFUjPi4nU2y9Kwrm3+5emOFzDarMCCmQ9oiEC01rfp1EFIzD3tPIyIQroDJeO8gdydeLWtm6mL2Jz6L8AJoFHEqaj6mOxakWNmwTmyd8I4/eDa+rwGiMbkTFXtwcGW/VRg== 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=HiSz3NJYnmgk/9dgFzYgud44AvjSs6Lu2gv97Dx27OU=; b=N8esJTuEEbKw3K1dCGSKOlmbjuNZQQ9sTRHwL+mzc6B96vY2L08in37NaK8LkSu0KknrDC4A3yvPwyBOasy5kwM7xh4eKfDJFgERQIGiJbPSmvSWi5r1eng2L5DW27ysdrKEbdNyKpvVWV8N0uOTKyrVRIOUSrTaikBlbcoQH/s= Received: from MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) by IA0PR10MB7624.namprd10.prod.outlook.com (2603:10b6:208:491::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.39; Tue, 20 Feb 2024 10:24:49 +0000 Received: from MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8de3:eccb:9288:95d0]) by MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8de3:eccb:9288:95d0%6]) with mapi id 15.20.7292.036; Tue, 20 Feb 2024 10:24:49 +0000 From: Cupertino Miranda To: gcc-patches@gcc.gnu.org Cc: jose.marchesi@oracle.com, david.faust@oracle.com, elena.zannoni@oracle.com, indu.bhagat@oracle.com, Cupertino Miranda Subject: [PATCH 2/5] btf: added KIND_FUNC traversal function. Date: Tue, 20 Feb 2024 10:24:24 +0000 Message-Id: <20240220102427.1512739-3-cupertino.miranda@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240220102427.1512739-1-cupertino.miranda@oracle.com> References: <20240220102427.1512739-1-cupertino.miranda@oracle.com> X-ClientProxiedBy: LO6P123CA0037.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:2fe::9) To MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR10MB4382:EE_|IA0PR10MB7624:EE_ X-MS-Office365-Filtering-Correlation-Id: 563c1d58-1064-4548-1eba-08dc31fe2b3b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: agHGRic4YGlsyKJh+4Wsvs7frv9wPo5FvG71qXQvFlkyanpqIhUmbfqjPl/NYY4Q9rKl2XuZ8l4mW21f9+Ko7jo0Oh2EYHiGAhMxhRx89imV2LhLTL4dbybLnVgz+UB6GaKM7+wikhZZRDP9qcDRN7lUfJUMOVAHn35vmHW7s7uYLtPA44FVD+M4WbsWIh6Ju7DP8XhTfFFWTV6ec54o67vH/robR7mhSeZ285xIwJMEDYtqhBZZOwAiNz8NL+z0G0/E06NOxe4Sr97Eita9nMJ0RyR7u2MlhpPcrrgt51hcK3wP7FOD4Fwr3vSoP9QPxg9XGqY0M9K/pyEv+ED4tlLMEiBFOISY1KvRqYxd9xmCUWeD6iwzklfOXLLojKkmzQjDvsb7PWU+q8OvOeMfBAvfEClBspbzxZ++d3B/YEckBR9y+0tIihrTt/KgoPj0cAyllKJ/Hfkg7CmKhphZdAV2GjakU7KluwfYH/5a0vcYPrQms9lk7jEaNcvpGgOdmHD8WLCWcgw5rPosuMw1gJt4ZjFd7SP9yqLNS2PFuGc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR10MB4382.namprd10.prod.outlook.com;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qOpL5oVhFQHTiqqvj7C7MfNLNxc9bFsE/pusDHUAVmUpWvGonloZ/cP/U40xZ8wf7kiMtfSnbgLc1VnBNwoijnODs/pA7JCsEHZPLfsXL5linSn8KOX9OeGMuZy0/tXASS635g3WZX4x1ORCVxx8CcjIEnuLdlguncSxDVJr5eqGBW3F+FraM2kLDb1hTyq+6Y/JpSywpHCwPIJqyWBfjwZ0qsSHqasL43cABxHzi7YJ15Iwz8ntSfUotFQHM8391Yw6T4kkZG4xjiJ4xSmCMk9blWu3+PYU7o= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 563c1d58-1064-4548-1eba-08dc31fe2b3b X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4382.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2024 10:24:49.7894 (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: 3ZgYia0vjvyvGQzwqkWXkA7RbzdrF/Z/rWho2SoKm0hVFAOYU1aXLd9hIqOnPu8k9tf6CK4xQ3S23ugPbqiR3mHuZsR+TnzjWeSL5ByGxq4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7624 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-20_06,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=976 mlxscore=0 bulkscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402200074 X-Proofpoint-GUID: 7DBBYKpqmCMszWFJbbWgSDful1i_ZgPR X-Proofpoint-ORIG-GUID: 7DBBYKpqmCMszWFJbbWgSDful1i_ZgPR X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Added a traversal function to traverse all BTF_KIND_FUNC nodes with a callback function. Used for .BTF.ext section content creation. gcc/ChangeLog * btfout.cc (output_btf_func_types): use FOR_EACH_VEC_ELT. (traverse_btf_func_types): Defined function. * ctfc.h (funcs_traverse_callback): typedef for function prototype. (traverse_btf_func_types): Added prototype. --- gcc/btfout.cc | 22 ++++++++++++++++++++-- gcc/ctfc.h | 3 +++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/gcc/btfout.cc b/gcc/btfout.cc index 7e114e224449..7aabd99f3e7c 100644 --- a/gcc/btfout.cc +++ b/gcc/btfout.cc @@ -1276,8 +1276,10 @@ output_btf_types (ctf_container_ref ctfc) static void output_btf_func_types (ctf_container_ref ctfc) { - for (size_t i = 0; i < vec_safe_length (funcs); i++) - btf_asm_func_type (ctfc, (*funcs)[i], i); + ctf_dtdef_ref ref; + unsigned i; + FOR_EACH_VEC_ELT (*funcs, i, ref) + btf_asm_func_type (ctfc, ref, i); } /* Output all BTF_KIND_DATASEC records. */ @@ -1452,4 +1454,20 @@ btf_finalize (void) tu_ctfc = NULL; } +/* Traversal function for all BTF_KIND_FUNC type records. */ + +bool +traverse_btf_func_types (funcs_traverse_callback callback, void *data) +{ + ctf_dtdef_ref ref; + unsigned i; + FOR_EACH_VEC_ELT (*funcs, i, ref) + { + bool stop = callback (ref, data); + if (stop == true) + return true; + } + return false; +} + #include "gt-btfout.h" diff --git a/gcc/ctfc.h b/gcc/ctfc.h index 7aac57edac55..fa188bf2f5a4 100644 --- a/gcc/ctfc.h +++ b/gcc/ctfc.h @@ -441,6 +441,9 @@ extern int ctf_add_variable (ctf_container_ref, const char *, ctf_id_t, extern ctf_id_t ctf_lookup_tree_type (ctf_container_ref, const tree); extern ctf_id_t get_btf_id (ctf_id_t); +typedef bool (*funcs_traverse_callback) (ctf_dtdef_ref, void *); +bool traverse_btf_func_types (funcs_traverse_callback, void *); + /* CTF section does not emit location information; at this time, location information is needed for BTF CO-RE use-cases. */ From patchwork Tue Feb 20 10:24:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cupertino Miranda X-Patchwork-Id: 86025 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 98A5A3858431 for ; Tue, 20 Feb 2024 10:25:48 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 14D383858404 for ; Tue, 20 Feb 2024 10:24:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 14D383858404 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 14D383858404 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1708424709; cv=pass; b=BepdGOzcJbJwRxegtv1lvzm1Zx2nBOnaEZRpLYNzZkbGsjC+Egf0O7XTIzHuT/VnwF1QZaNYg52uKhHGwGfha5LxODUjEMlS0BFvFNxhk6c5BgX6OrkbFk2KAJy1quKTBTNANg9oJOfsVWfCaBKxElAeo7WDtf4zmJFQBFq9GBU= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1708424709; c=relaxed/simple; bh=3izTT9fnmSKZ6Kd/+ag0JiwXFWKJZs6/3sRb4Hqec4g=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=eZridtXLTXDK+UvOpP+Dx9pKoy8kC9nWLiblSmLaMnuMDhB7tQxLvXj+4STe+F+xOLcGyFbeajJF8hd6+w6R4reJry8rfRZfuJd+Mvmg33lN51CkvjCi8dmQA6FU77LSl+CNc1+SQcZhYOVDyfc3MpbPeYh3Q6Q6YZaB30K7Iak= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41K8xRNF024950 for ; Tue, 20 Feb 2024 10:24:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=JCuJ0MSFqcUCMZ6boEXJEYX5QIMRKQsvYs60iTHmiUA=; b=HnwFHtDeHCVmCVtVrWIFN4DsxC7R9K55C39+9M4sVCdsZDUcd3R3i82BrVwUAX1GWYE4 xeZmES0PEJRi1S4CyfKe1A6ytuS1d6CzP0lOdTKYaKLgTOltzo+0fNtN3sAa7cS/Jmh+ dCfQDbh8S0gY4UOL2ClEUILsGoyfXJH4AAahrAq1GWQ2UDQwJeXMSuaob3xa/8Z9ZYLb YMDAuAqHVgoc7BucWXGwa0gvKKWfS4vVg/ciFfr6+PAU43HEzhSqBSDqrFwDqPRRqLtw ah4IqjfEJgB8BbThYqKTbo37h2RwFcCxUoRE5h9Atw/D+JOczeAIc5T8PJ/pcfJl9h8o nQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wakqc6d33-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 Feb 2024 10:24:57 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41KAJ3cp021019 for ; Tue, 20 Feb 2024 10:24:56 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3wak878fud-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 Feb 2024 10:24:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jx4A7ce75ZvVbsA8UJNalv86ep9LTz6EIPPhyl/poVNzIEphdawheNMos42UIeQ1FLpjNc+5t4hfw+hdA+MizzLtcCg9Hb2JTaKZoXueBBJ9hwWo7qnNGxbtMugHDffceqxJM5bKn5fTfzLa4hZdvDH/UdRtRLB18rwOiMd+iGavnL4KEqfIxkhf8zfDXCJtxqsQYb8rQ/vIwkwcApelQBkanmfJnh7Zlk7zP3Z2mBKiuYg+3Hp9exLs51yWjzAXBedLF7ZuRXhBjsSL/W84nyU4tA9EhOr55lJdex++C3e/U2Xz5kUcgYhh8n3NLMOziPCv5DH+JB035uC9b10BJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=JCuJ0MSFqcUCMZ6boEXJEYX5QIMRKQsvYs60iTHmiUA=; b=IMRH72c/SDtG6HJwxbh57xxBCqQUXfDxI5KXbgnyvPkoqqoI5BIZ56wCj2iW6HYirB94lz3CbrdmgaRfldwts1LiO1DNRXjw1+vasbUX5WceYURcy0bltitXZw0ip+Yc2Kab7KdgNginDsptA5HuGDA6Gbt3iZ6GWmqQJVwu0+TQNOIB/KiD1tkrU7NOB0Xro8VM6+0ZWEnWYljhmmpuRyB9VBnpTxJ1vpsFAOK9hJzPI+W+Ozvo1JkeM83yO46CpcT7wjzAWYa2dhTlkC/Cj9vnp8nrd25lge48WezFoc0j83kgoBn1k9z9EHGtYFHYYXTi80e41HVLgz0Ral7D0A== 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=JCuJ0MSFqcUCMZ6boEXJEYX5QIMRKQsvYs60iTHmiUA=; b=HbcWw+h6hZEQBaIcP2Xbo+4qCGeeIrkBYahe9EDypqbTqQ+GrXdPutf/ChQANshYvoM1ovMEZT9ILk2l2tIV/hpbrZOKIBJ4XyciocwRcCMB0nupCB0CXhg7YwKga2NcS9Yh4eORWnk60IxX+vyCTw57l7b3JX1O1S9NpGqPnYk= Received: from MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) by IA0PR10MB7624.namprd10.prod.outlook.com (2603:10b6:208:491::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.39; Tue, 20 Feb 2024 10:24:54 +0000 Received: from MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8de3:eccb:9288:95d0]) by MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8de3:eccb:9288:95d0%6]) with mapi id 15.20.7292.036; Tue, 20 Feb 2024 10:24:54 +0000 From: Cupertino Miranda To: gcc-patches@gcc.gnu.org Cc: jose.marchesi@oracle.com, david.faust@oracle.com, elena.zannoni@oracle.com, indu.bhagat@oracle.com, Cupertino Miranda Subject: [PATCH 3/5] btf: moved btf deallocation to final. Date: Tue, 20 Feb 2024 10:24:25 +0000 Message-Id: <20240220102427.1512739-4-cupertino.miranda@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240220102427.1512739-1-cupertino.miranda@oracle.com> References: <20240220102427.1512739-1-cupertino.miranda@oracle.com> X-ClientProxiedBy: LO3P265CA0022.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:387::13) To MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR10MB4382:EE_|IA0PR10MB7624:EE_ X-MS-Office365-Filtering-Correlation-Id: 43c036d3-0416-41ee-fbea-08dc31fe2dae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V7PAKOh1fiZYMk/cbFC0ulshLpx8UgC3kOCQ02cYxkgLZSxkpNVT5I90yKj+ul/sFAlGQEmyMn9SBV+spBw0DgArQ16pzv/QteH8O0DSYs6r0QypZtxzv+NP6m71nVVucw1scpLbK43VqrU5jj2rkEe9VREK5/ZNFxNnOjdA912tijiOQKFBFJMdhuuejJz1qH70x4KCmBDO3rJXDw6Pkt91iXdiPFUZ8GvNssG9ok1Qwg31Rsqw1jX7DbddY5yfNqVx+if3MnOk3nSwaBib1D+JxZk+8m4e8wnSMbBKFHVx6rxyc5axmJJKIYT9M7UQx26NbqcMhHp+lVMIOcssSwXbNvfj1bWq+H8ZIuThtq53+3/Jz/nz1uKeDL+M3Ik7Vdo+bz6Nj0NPjyyVlJJQvhrc3Z0BhN22nSbJYzU6bQ7I/lBvRgUt14yJ3x0j0Ha8rAYhLOJfSbDgcao0H7jJiDCz/cE2KzNGQJ408Njq/nABJhUxST3+vL0QgNKgpePdI6U213zhpLc4g1t/E6K7N4kDLA0x35MlRCIOnN/P2+g= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR10MB4382.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: o9ikkO+tsnpL68ThzLBcHD1cs91Cl/sSSsj5V7pf8c/lQIOsVESf9Ew+EtbZYYzIP+Be7HQQohziZNJMHPqiGUbQ6AcqsrlIqPkC+rs6apyPCCm6ebCL+2iVA0zI9KheDh7BqAWZf/qF1R0ndI3H9RT2vyWka2DrS0c5BsRSVoFCJWGr1tygO2rtktZlqDDnTuJv6NJHZJFsPjFz9rjGg6hu/jBSx7/rRc3DX+4vxWkH9pqYS9DNgH/uxVGvJzUU+ZDqruqe2tPwyzTz8DSPayQ3OmR75awH97Fme4AGD+sObgvqFhnEHIaWXbH3kYUo8kSuE0DBl6nEAvFv5E9XeJwgrhAUJ7MGekSRQNMo43KC9KhMQV6vuTtpYB9xoaSFy88e0+450RIUSz42ePb/H3+/XufW4Q0sD6rHz2q+ysK1z9KbDLq1uKwwDoqP7QMLdz57Cgagk4K8OkBenus5j4QhI41R0LcEkH2bmVXfAGORXLYNq9xzhK94n5GE5Fdy3t59O0/lY6+5nG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wZs7zGNM7NeF0rMlpCdUXHOLz2s1c7+FBA= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 6XgLuz1RYVIqCwlM4xZZlzlydF1Zb8SSOcLNcd3G8J6gtYSsLSWt7vYrSnbDdbkSr6gLiyH/unD6t/tMjSNxqbI79hiZDcTxl0nikZKHSE7vJgswlIzRb9YzLo+spqQJsSet+FxAzh8rPvRnLjbrmvBQr3lY97meI8Chx7G+06QoMhZ3sjfoFscm3a4CunAUjnZlrp6lF7q9ZmyuzCQvv1c7XoVeUxgEd1CwtWLYZwh6eSCgphZXVnr7UTKiNWSV4yI0aXcj0EbvcSuvQyuNN0i8agyWj5dPGQB/mCVZy9OyfKoy0UOSV8tMN2KPU6EJjK4wV/fsIqyIB+l/9SM+F7upGCfjzCVsnb8686+Tj8w1oDqESgQrYK5oTPK2Y8errsA4FE/db2V9C7ToOfWxZcehQ05G5IlPAQcxVzZvQmmHgKneXw8JS2SLr75r44IZjy1I+YL9xgacllZdGvcv7RDyVdAM0QrT6HQiPRjfiTUKIffynmmAEKMjCCnvSO/bQsLNI0u1uzkzuj/Pj9mQsEuxx7claP/5PjBq7KX+2J1X9zGDvsgMI79T6r7T0CZUYFktz/mkgb7xATxdb84OjueUMCJtQ22SNmF+kOYXdxk= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43c036d3-0416-41ee-fbea-08dc31fe2dae X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4382.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2024 10:24:53.9308 (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: /aXqNUEIyrIc9QafefO8Dlsg5RfxSVflzE4ROV2U+/apGJ8CfTgvaMuuZZN8O6tHAo5vcjzp9mh5VhQhak7Sbm+uOIhU+ORw4FwMU6+aDQQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7624 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-20_06,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402200074 X-Proofpoint-GUID: QB8e5w5d_CGZMUHh_UMTk9uxm8kRg5gV X-Proofpoint-ORIG-GUID: QB8e5w5d_CGZMUHh_UMTk9uxm8kRg5gV X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Dissociated .BTF.ext from the CO-RE relocations creation. Improvement of allocation/deallocation of BTF structures. Moving deallocation to final when needed. gcc/ChangeLog: * config/bpf/bpf.cc (bpf_option_override): Make BTF.ext enabled by default for BPF. (btf_asm_init_sections): Add btf deallocation. * dwarf2ctf.cc (ctf_debug_finalize): Fixed btf deallocation. --- gcc/config/bpf/bpf.cc | 20 +++++++++----------- gcc/dwarf2ctf.cc | 5 ++++- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/gcc/config/bpf/bpf.cc b/gcc/config/bpf/bpf.cc index d6ca47eeecbe..4318b26b9cda 100644 --- a/gcc/config/bpf/bpf.cc +++ b/gcc/config/bpf/bpf.cc @@ -195,10 +195,8 @@ bpf_option_override (void) if (TARGET_BPF_CORE && !btf_debuginfo_p ()) error ("BPF CO-RE requires BTF debugging information, use %<-gbtf%>"); - /* To support the portability needs of BPF CO-RE approach, BTF debug - information includes the BPF CO-RE relocations. */ - if (TARGET_BPF_CORE) - write_symbols |= BTF_WITH_CORE_DEBUG; + /* BPF applications always generate .BTF.ext. */ + write_symbols |= BTF_WITH_CORE_DEBUG; /* Unlike much of the other BTF debug information, the information necessary for CO-RE relocations is added to the CTF container by the BPF backend. @@ -218,10 +216,7 @@ bpf_option_override (void) /* -gbtf implies -mcore when using the BPF backend, unless -mno-co-re is specified. */ if (btf_debuginfo_p () && !(target_flags_explicit & MASK_BPF_CORE)) - { - target_flags |= MASK_BPF_CORE; - write_symbols |= BTF_WITH_CORE_DEBUG; - } + target_flags |= MASK_BPF_CORE; /* Determine available features from ISA setting (-mcpu=). */ if (bpf_has_jmpext == -1) @@ -267,7 +262,7 @@ bpf_option_override (void) static void bpf_asm_init_sections (void) { - if (TARGET_BPF_CORE) + if (btf_debuginfo_p () && btf_with_core_debuginfo_p ()) btf_ext_init (); } @@ -279,8 +274,11 @@ bpf_asm_init_sections (void) static void bpf_file_end (void) { - if (TARGET_BPF_CORE) - btf_ext_output (); + if (btf_debuginfo_p () && btf_with_core_debuginfo_p ()) + { + btf_ext_output (); + btf_finalize (); + } } #undef TARGET_ASM_FILE_END diff --git a/gcc/dwarf2ctf.cc b/gcc/dwarf2ctf.cc index 93e5619933fa..b9dfecf2c1c4 100644 --- a/gcc/dwarf2ctf.cc +++ b/gcc/dwarf2ctf.cc @@ -944,7 +944,10 @@ ctf_debug_finalize (const char *filename, bool btf) if (btf) { btf_output (filename); - btf_finalize (); + /* btf_finalize when compiling BPF applciations gets deallocated by the + BPF target in bpf_file_end. */ + if (btf_debuginfo_p () && !btf_with_core_debuginfo_p ()) + btf_finalize (); } else From patchwork Tue Feb 20 10:24:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cupertino Miranda X-Patchwork-Id: 86027 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2E0243858C98 for ; Tue, 20 Feb 2024 10:26:49 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id E604C3858C31 for ; Tue, 20 Feb 2024 10:25:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E604C3858C31 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E604C3858C31 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1708424710; cv=pass; b=l1PBXNFncM/XIMt3U5W1rcC5/Pveg/Ii/bfGCTLAOUtngogQuSLV6vJ0RyvzBGYUFw1duLeSXQtV8zmiJySpCntT/vTwJQC2HLnlrvb03iDYMcEyUNqx2LCXTVj/2S/MugFZnUSHMYNdHqsEfWxckvTplVXtNBSZVTIF9vCH0ao= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1708424710; c=relaxed/simple; bh=ky4kCliuo8UHupfFX10QipLiXuJe3hnIC8YnFHSxpj0=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=aX38hOkbqBV6l343ZmVNOVE2uxKdHS8GevgjWA85VGpC/pTLv8vhq1GDOQRqu1LmCFgra5QlUAftIbQeI9uhcIZzUyfiua0dB3J63R8DAUMXRaQdSSk/NYjUc+YYo/yLV9ArQp4qlj9kBGtzhWFyckjTCTuJSo1YBnCDhmVmrkE= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41K8xRvm024949 for ; Tue, 20 Feb 2024 10:25:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=Qrxf/pnIbnr08o2+e+T82mrvSE7eQxfzGzxpWC2HPM4=; b=BmL1ZJHUj8qUahLSVouEW04j/sUY3vvKI7r7JDJxrj9sEKyCuWxj6Jwit0I0DxjTJC9E GODTr62K50JLjPX2+oGjTX7cWVUaOW9Z0mmF4I7a+j20HvyTTXD0UEevjRxhpPypqw2c d4nLjTJosoUg335uF1y4xkyfyJlehICRVimmFCTdDyWApGXrOqdRUorPU8QkjvVmM0sk MURfi/EvRp5NA1PMAGti1t2rzCAFcTOCjLk6zPJdW1RQs4STsVnpNp7ee4M7i0q/aa2/ YCeew6pT4ncWU/TBotgrPCoUA0hqR3Tq0QF1ZptUDf5fRhEojWy9RlICAIfjeR88I64z QA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wakqc6d3d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 Feb 2024 10:25:01 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41K9DiKE037798 for ; Tue, 20 Feb 2024 10:25:00 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3wak871dt0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 Feb 2024 10:25:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kNNbelA3RLpzHbCXOuvgnvT0MN9Qb17RAwJpetgRK/YF/Y+4VdPgUYgXRiNT/pQb4i+dh/hPz1iYW5Cy5WibJABAX/GuImJXY3qC5pjR5xNVtF/M6x0a1MYhYYX3QDwXWLk+Oy/j9xeQqt8SfNiwe8qzkhoWBvV0rix05Qo5qVBOxnvvUTiNxN4uCjsuSfzjW2baFvRQXN9xCeHufzzLD8dZ1X+yepo2s7X1sQAtw15qsK8c0/HsqVX+IOkIH5t764Nx/7acir87yAREjUPt2XEGW/dz+LGI9PNGoBe9VJ6qf2cV+kw/giMACM17HdCJPWYfSvS2ihhucd3JZwv8Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Qrxf/pnIbnr08o2+e+T82mrvSE7eQxfzGzxpWC2HPM4=; b=DSFV9rsqHDrkIQnXAq97B+Y5GLE7Cq/2Z4BhVYl/X6lnKKnN2l1L0CQJBWzi+1nOxUOIDyLk3b6JqJ2lYP3a0TmC4RiwozBPjqsS0L2AmMu5ohXV8G4Hm9NtmtMcwOmnkYrciO6OZow42zhKgykuM4QLGN8S56wzuhxvkty447YJxHTyx8EDtKleKr91ah99foWoH5eYjkEzo00ZQfpwqrmtOJ+HHMPNBIPPBDnvmS2LYVMSeJRdHzMDVY0xp8KUndkQNcZJXPh2Y231OzoJhQqA2i51IS2pkk3OGNhKRdtX9v8Yn21Mcxjqf/Ns0fmVlCf9zdV0joKk8FSlf9IgCw== 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=Qrxf/pnIbnr08o2+e+T82mrvSE7eQxfzGzxpWC2HPM4=; b=MWIlDSRPEDwPpAeMgpVCf9iW9FTnx+s1wj5UuItG+gora85BVC5c2FDBAnpvd1WjzdkJ7YXnfCgGcrKzuFzdpyaO5QJjEEE9GqcKGgwdmGl/sdwol14LEUC+EtDzbNpzqx/MMNgg0WTkoU14c0hBS+jABTrHYn3rd+8vf1XT2z0= Received: from MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) by IA0PR10MB7624.namprd10.prod.outlook.com (2603:10b6:208:491::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.39; Tue, 20 Feb 2024 10:24:57 +0000 Received: from MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8de3:eccb:9288:95d0]) by MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8de3:eccb:9288:95d0%6]) with mapi id 15.20.7292.036; Tue, 20 Feb 2024 10:24:57 +0000 From: Cupertino Miranda To: gcc-patches@gcc.gnu.org Cc: jose.marchesi@oracle.com, david.faust@oracle.com, elena.zannoni@oracle.com, indu.bhagat@oracle.com, Cupertino Miranda Subject: [PATCH 4/5] bpf: implementation of func_info in .BTF.ext. Date: Tue, 20 Feb 2024 10:24:26 +0000 Message-Id: <20240220102427.1512739-5-cupertino.miranda@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240220102427.1512739-1-cupertino.miranda@oracle.com> References: <20240220102427.1512739-1-cupertino.miranda@oracle.com> X-ClientProxiedBy: LO6P123CA0026.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:313::17) To MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR10MB4382:EE_|IA0PR10MB7624:EE_ X-MS-Office365-Filtering-Correlation-Id: 494c2dde-800b-4808-e390-08dc31fe2fde X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +8e0+yLeQILINwS9HKqnB7ZrEynlUe6XO1AYvOyGMtFcPuZG33wrxLONx9tlUTBl6bm/j/P4gMfi/t7MUC/Pm/A6d+CT88N+qfq+56rbiL4AutobQLlgaq+Hf8lSzMYj/Yvk3dt/lSskkc77+lB47PneDIIMXEA4EGZWMxCND9OMT5jGmlofK0GpDx51g5kYTjAau8pSSubRz3oRePsGhy9E/kxIUfhyubXU6lMkp4oaQQFCO1pAnXq8WbjTUxQ8A+r2gkRLnPBPDSqPIyX/sd77xTpm7qEfxGREjtq5PpO2i9aXx9sV8oM4nMvcB0AkpJxGV4hSFEasDFHMIYh4TnTHf0AvCsxMBMY74ZZ+gWZETqs1nHR68YBBulEZGSoMrUrOhSEIJ7BNXuDeshv/IUm1Bw2mfdQKv2OMOYycC/srMo1pTB2ka7TvFTYNE/QLprPm3Zgu/XnmASoqdtr7mCJH4ChxEV5zvnFsEkHa6T79Oi6u65ZLKVAX0z312JcEEqinABR3iu1yYiyfPRph8Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR10MB4382.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mg8otnUMxr+mfQbJdFAWCx0m3iJoEpKbE7Ov6DvHWycZq4wwD02t1BtbaKzMTmUzhje04/GgdEv1xoNRIFGjpQbKggZXFWz3kYRAExodCRxNUsSZCjJ950+vWOP2WzUNx6TBZZyETJL4gIFtxnMtmY67X7z/utuSxhKZYXns/ZzcuVl/X2qas6Wh3Lw4CRkq1C5Ki/dS1UeugNZZ90PajdkdzkYfSnWGxHDBM1tGcL0OmDp1gHOgdN7KAe5d9y7i6ZSjTdI4zQRcEBWQo4iGcrkX2K/g94Xw7vWHOKdyVDtwlMzIVKi3Ds2m+KE9yqgydzrtdRcXzkEYoTBsHsbpjKwOv08yAzVMh7cPuTY+SHqRXx3gQEBfuQ2dH0S/v04UR1aHnIXjhuu7J6lpuGYOXoSGkrWtjx1zIwQ6BfIS3W719Z23vnHvraJ144kWgh42hQ3l+G9slbKDGz3pV0qnx26Re+Z6TALwMEI8GzOxdBo/bijmDcW94O56/ImjACMOMKwEYOAjSOKTGJSBDbXEdDyHt8a0+bAqgaJc6xAct63B8+IlCTslSeoA8zYVg0Sfo87pKehC6rwiwGaNR6IB+kTZ0XqLa5WNrowOATlswqzXu9D+RLweEWXsCubAp0Z7ePnmnAAnDnTE0PaLdGdPodeRzTjLoqQQ2pueAPbCNypeJawguE76Y/4+zka9zrQXisxERyK3r+bUEfb4LLUS/nC+LEiv88IPVAtEN9Z1Zw942WPb6A86krriwzTe4/zygbJZIHBiCNGC8ehGbSOieu8SgDp1gYp4hExpFjvqZwVfn/pg13vIYaX7N8iirfG4yr2/IjkYP2SMcRgY0BflWGKvKppB/pBJzfBnfsauQF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rwwXFduWn6Qo2hG7ADQ1rLcFp0ck2bqYsreR+L+uYd3HB+Ex9BIG6DjHDtsyCAGcC80jmYfuOxO/caIIIJKEq3AADedFsd4ztDntlKUhIVEzCaE0x5Rf7/Jz0QUaXUc0VJf09t6HdYTKx/eCvkCJuceeWVYO/jq8f9qWoFkAKuuAh/l2tzFqDH8tZ5PQwFm7uauJF1BnzSKr9mA6sOGdTsHj2MxG1IDxrE/H+Cdmi2BcaKQq8IJl7nENMECoRnwuw9/GPXV+1wnbH9yWSEmozgBLsyOGGfVd982ZxKReYUdCsupZnyu7RqET24U/dnmrGVBxggTAbbWQWLL1M1QdIx/UTJGTTNi91UnJ74mR2acqFY0dumR9SOXcCQEdP85k= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 494c2dde-800b-4808-e390-08dc31fe2fde X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4382.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2024 10:24:57.6577 (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: qohhBJGh1CruAmYByaz/oKSGydJCiG97QKguhX0QsaNlr40ql4bXmFy8+VTAEzK2jC92g0AxeCCniF0f46BB6NzsRjtwI9JuiUQ7Cs5L5XU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7624 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-20_06,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402200074 X-Proofpoint-GUID: iSsaeJqaMNTP3BJrIoTsKUr05HgUCKBN X-Proofpoint-ORIG-GUID: iSsaeJqaMNTP3BJrIoTsKUr05HgUCKBN X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Kernel verifier complains in some particular cases for missing func_info implementation in .BTF.ext. This patch implements it. Strings are cached locally in coreout.cc to avoid adding duplicated strings in the string list. This string deduplication should eventually be moved to the CTFC functions such that this happens widely. With this implementation, the CO-RE relocations information was also simplified and integrated with the FuncInfo structures. gcc/Changelog: PR target/113453 * config/bpf/bpf.cc (bpf_function_prologue): Defined target hook. * config/bpf/coreout.cc (brf_ext_info_section) (btf_ext_info): Moved from coreout.h (btf_ext_funcinfo, btf_ext_lineinfo): Added struct. (bpf_core_reloc): Renamed to btf_ext_core_reloc. (btf_ext): Added static variable. (btfext_info_sec_find_or_add, SEARCH_NODE_AND_RETURN) (bpf_create_or_find_funcinfo, bpt_create_core_reloc) (btf_ext_add_string, btf_funcinfo_type_callback) (btf_add_func_info_for, btf_validate_funcinfo) (btf_ext_info_len, output_btfext_func_info): Added function. (output_btfext_header, bpf_core_reloc_add) (output_btfext_core_relocs, btf_ext_init, btf_ext_output): Changed to support new structs. * config/bpf/coreout.h (btf_ext_funcinfo, btf_ext_lineinfo): Moved and changed in coreout.cc. (btf_add_func_info_for, btf_ext_add_string): Added prototypes. gcc/testsuite/ChangeLog: PR target/113453 * gcc.target/bpf/btfext-funcinfo-nocore.c: Added. * gcc.target/bpf/btfext-funcinfo.c: Added. * gcc.target/bpf/core-attr-5.c: Fixed regexp. * gcc.target/bpf/core-attr-6.c: Fixed regexp. * gcc.target/bpf/core-builtin-fieldinfo-offset-1.c: Fixed regexp. * gcc.target/bpf/core-section-1.c: Fixed regexp --- gcc/config/bpf/bpf.cc | 12 + gcc/config/bpf/coreout.cc | 518 +++++++++++++----- gcc/config/bpf/coreout.h | 20 +- .../gcc.target/bpf/btfext-funcinfo-nocore.c | 42 ++ .../gcc.target/bpf/btfext-funcinfo.c | 46 ++ gcc/testsuite/gcc.target/bpf/core-attr-5.c | 9 +- gcc/testsuite/gcc.target/bpf/core-attr-6.c | 6 +- .../bpf/core-builtin-fieldinfo-offset-1.c | 13 +- gcc/testsuite/gcc.target/bpf/core-section-1.c | 2 +- 9 files changed, 506 insertions(+), 162 deletions(-) create mode 100644 gcc/testsuite/gcc.target/bpf/btfext-funcinfo-nocore.c create mode 100644 gcc/testsuite/gcc.target/bpf/btfext-funcinfo.c diff --git a/gcc/config/bpf/bpf.cc b/gcc/config/bpf/bpf.cc index 4318b26b9cda..ea47e3a8dbfb 100644 --- a/gcc/config/bpf/bpf.cc +++ b/gcc/config/bpf/bpf.cc @@ -385,6 +385,18 @@ bpf_compute_frame_layout (void) #undef TARGET_COMPUTE_FRAME_LAYOUT #define TARGET_COMPUTE_FRAME_LAYOUT bpf_compute_frame_layout +/* Defined to initialize data for func_info region in .BTF.ext section. */ + +static void +bpf_function_prologue (FILE *f ATTRIBUTE_UNUSED) +{ + if (btf_debuginfo_p ()) + btf_add_func_info_for (cfun->decl, current_function_func_begin_label); +} + +#undef TARGET_ASM_FUNCTION_PROLOGUE +#define TARGET_ASM_FUNCTION_PROLOGUE bpf_function_prologue + /* Expand to the instructions in a function prologue. This function is called when expanding the 'prologue' pattern in bpf.md. */ diff --git a/gcc/config/bpf/coreout.cc b/gcc/config/bpf/coreout.cc index 2f06ec2a0f29..31b2abc3151b 100644 --- a/gcc/config/bpf/coreout.cc +++ b/gcc/config/bpf/coreout.cc @@ -31,6 +31,7 @@ #include "btf.h" #include "rtl.h" #include "tree-pretty-print.h" +#include "cgraph.h" #include "coreout.h" @@ -95,64 +96,193 @@ result, a single .BTF.ext section can contain CO-RE relocations for multiple programs in distinct sections. */ -/* Internal representation of a BPF CO-RE relocation record. */ +/* BTF.ext debug info section. */ +static GTY (()) section * btf_ext_info_section; + +#ifndef BTF_EXT_INFO_SECTION_NAME +#define BTF_EXT_INFO_SECTION_NAME ".BTF.ext" +#endif +#define BTF_EXT_INFO_SECTION_FLAGS (SECTION_DEBUG) + +#ifndef BTF_EXT_INFO_SECTION_LABEL +#define BTF_EXT_INFO_SECTION_LABEL "Lbtfext" +#endif + +#define MAX_BTF_EXT_LABEL_BYTES 40 +static char btf_ext_info_section_label[MAX_BTF_EXT_LABEL_BYTES]; + +/* A funcinfo record, in the .BTF.ext funcinfo section. */ +struct GTY ((chain_next ("%h.next"))) btf_ext_funcinfo +{ + uint32_t type; /* Type ID of a BTF_KIND_FUNC type. */ + const char *fnname; + const char *label; + + struct btf_ext_funcinfo *next; /* Linked list to collect func_info elems. */ +}; + +/* A lineinfo record, in the .BTF.ext lineinfo section. */ +struct GTY ((chain_next ("%h.next"))) btf_ext_lineinfo +{ + uint32_t insn_off; /* Offset of the instruction. */ + uint32_t file_name_off; /* Offset of file name in BTF string table. */ + uint32_t line_off; /* Offset of source line in BTF string table. */ + uint32_t line_col; /* Line number (bits 31-11) and column (11-0). */ -typedef struct GTY (()) bpf_core_reloc { + struct btf_ext_lineinfo *next; /* Linked list to collect line_info elems. */ +}; + +/* Internal representation of a BPF CO-RE relocation record. */ +struct GTY ((chain_next ("%h.next"))) btf_ext_core_reloc { unsigned int bpfcr_type; /* BTF type ID of container. */ unsigned int bpfcr_astr_off; /* Offset of access string in .BTF string table. */ rtx_code_label * bpfcr_insn_label; /* RTX label attached to instruction to patch. */ enum btf_core_reloc_kind bpfcr_kind; /* Kind of relocation to perform. */ -} bpf_core_reloc_t; -typedef bpf_core_reloc_t * bpf_core_reloc_ref; + struct { + const char *accessor_str; + tree type; + } info; -/* Internal representation of a CO-RE relocation (sub)section of the - .BTF.ext information. One such section is generated for each ELF section - in the output object having relocations that a BPF loader must resolve. */ + struct btf_ext_core_reloc *next; +}; -typedef struct GTY (()) bpf_core_section { - /* Name of ELF section to which these CO-RE relocations apply. */ - const char * name; +/* Main data structure to keep .BTF.ext section data. */ +struct GTY ((chain_next ("%h.next"))) btf_ext_info_sec { + const char *sec_name; + uint32_t sec_name_off; /* offset to section name. */ + + struct { + uint32_t num_info; + struct btf_ext_funcinfo *head; + } func_info; + struct { + uint32_t num_info; + struct btf_ext_lineinfo *head; + } line_info; + struct { + uint32_t num_info; + struct btf_ext_core_reloc *head; + } core_info; + + struct btf_ext_info_sec *next; +}; - /* Offset of section name in .BTF string table. */ - uint32_t name_offset; +static GTY (()) struct btf_ext_info_sec *btf_ext = NULL; - /* Relocations in the section. */ - vec * GTY (()) relocs; -} bpf_core_section_t; +/* Helper function to add a section structure to the linked list with entry + point in info static variable. */ -typedef bpf_core_section_t * bpf_core_section_ref; +static struct btf_ext_info_sec * +btfext_info_sec_find_or_add (const char *sec_name, bool add) +{ + struct btf_ext_info_sec **tmp = &btf_ext; -/* BTF.ext debug info section. */ + while (*tmp != NULL) + { + if (strcmp ((*tmp)->sec_name, sec_name) == 0) + return *tmp; + tmp = &((*tmp)->next); + } -static GTY (()) section * btf_ext_info_section; + if (add == false) + return NULL; -static int btf_ext_label_num; + struct btf_ext_info_sec *ret = ggc_cleared_alloc (); + *tmp = ret; -#ifndef BTF_EXT_INFO_SECTION_NAME -#define BTF_EXT_INFO_SECTION_NAME ".BTF.ext" -#endif + /* Set data for section info. */ + ret->sec_name = sec_name; + ret->sec_name_off = btf_ext_add_string (sec_name); -#define BTF_EXT_INFO_SECTION_FLAGS (SECTION_DEBUG) + return ret; +} -#define MAX_BTF_EXT_LABEL_BYTES 40 +#define SEARCH_NODE_AND_RETURN(TYPE, FIELD, CONDITION) ({ \ + TYPE **head = &(FIELD); \ + while (*head != NULL) \ + { \ + if (CONDITION) \ + return (*head); \ + head = &((*head)->next); \ + } \ + head; \ +}) + +/* Function to create or find a funcinfo node in info. */ + +static struct btf_ext_funcinfo * +bpf_create_or_find_funcinfo (const char *fnname, const char *sec_name, + btf_ext_info_sec **in_sec = NULL) +{ + struct btf_ext_info_sec *sec_elem = + btfext_info_sec_find_or_add (sec_name, true); -static char btf_ext_info_section_label[MAX_BTF_EXT_LABEL_BYTES]; + if (in_sec != NULL) + *in_sec = sec_elem; -#ifndef BTF_EXT_INFO_SECTION_LABEL -#define BTF_EXT_INFO_SECTION_LABEL "Lbtfext" -#endif + struct btf_ext_funcinfo **head = + SEARCH_NODE_AND_RETURN(struct btf_ext_funcinfo, + sec_elem->func_info.head, + strcmp ((*head)->fnname, fnname) == 0); -static GTY (()) vec *bpf_core_sections; + *head = ggc_cleared_alloc (); + (*head)->fnname = fnname; + (*head)->label = NULL; -struct GTY(()) bpf_core_extra { - const char *accessor_str; - tree type; + return *head; +} + +/* Function to create a core_reloc node in info. */ + +static struct btf_ext_core_reloc * +bpf_create_core_reloc (const char *sec_name, + struct btf_ext_info_sec **in_sec = NULL) +{ + struct btf_ext_info_sec *sec_elem = + btfext_info_sec_find_or_add (sec_name, true); + + if (in_sec != NULL) + *in_sec = sec_elem; + + struct btf_ext_core_reloc **head = + SEARCH_NODE_AND_RETURN(struct btf_ext_core_reloc, + sec_elem->core_info.head, + false); + + *head = ggc_cleared_alloc (); + + return *head; +} + +/* String caching to avoid repeated strings added to BTF string table. */ +struct GTY((chain_next ("%h.next"))) string_cache { + const char *str; + unsigned int offset; + struct string_cache *next; }; -typedef struct bpf_core_extra *bpf_core_extra_ref; -static GTY(()) hash_map *bpf_comment_info; +static GTY(()) struct string_cache *btf_ext_strings = NULL; + +unsigned int +btf_ext_add_string (const char *str) +{ + ctf_container_ref ctfc = ctf_get_tu_ctfc (); + struct string_cache **tmp = &btf_ext_strings; + while (*tmp != NULL) + { + if (strcmp ((*tmp)->str, str) == 0) + return (*tmp)->offset; + tmp = &((*tmp)->next); + } + + *tmp = ggc_cleared_alloc (); + (*tmp)->str = ggc_strdup (str); + ctf_add_string (ctfc, (*tmp)->str, &((*tmp)->offset), CTF_AUX_STRTAB); + + return (*tmp)->offset; +} /* Create a new BPF CO-RE relocation record, and add it to the appropriate CO-RE section. */ @@ -162,42 +292,23 @@ bpf_core_reloc_add (const tree type, const char * section_name, rtx_code_label *label, enum btf_core_reloc_kind kind) { - bpf_core_reloc_ref bpfcr = ggc_cleared_alloc (); - bpf_core_extra_ref info = ggc_cleared_alloc (); + struct btf_ext_info_sec *sec = NULL; + struct btf_ext_core_reloc *bpfcr = bpf_create_core_reloc (section_name, &sec); + ctf_container_ref ctfc = ctf_get_tu_ctfc (); /* Buffer the access string in the auxiliary strtab. */ - ctf_add_string (ctfc, accessor, &(bpfcr->bpfcr_astr_off), CTF_AUX_STRTAB); + bpfcr->bpfcr_astr_off = 0; + if (accessor != NULL) + bpfcr->bpfcr_astr_off = btf_ext_add_string (accessor); bpfcr->bpfcr_type = get_btf_id (ctf_lookup_tree_type (ctfc, type)); bpfcr->bpfcr_insn_label = label; bpfcr->bpfcr_kind = kind; - info->accessor_str = accessor; - info->type = type; - bpf_comment_info->put (bpfcr, info); - - /* Add the CO-RE reloc to the appropriate section. */ - bpf_core_section_ref sec; - int i; - FOR_EACH_VEC_ELT (*bpf_core_sections, i, sec) - if (strcmp (sec->name, section_name) == 0) - { - vec_safe_push (sec->relocs, bpfcr); - return; - } + bpfcr->info.accessor_str = accessor; + bpfcr->info.type = type; - /* If the CO-RE section does not yet exist, create it. */ - sec = ggc_cleared_alloc (); - - ctf_add_string (ctfc, section_name, &sec->name_offset, CTF_AUX_STRTAB); - if (strcmp (section_name, "")) - ctfc->ctfc_aux_strlen += strlen (section_name) + 1; - - sec->name = section_name; - vec_alloc (sec->relocs, 1); - vec_safe_push (sec->relocs, bpfcr); - - vec_safe_push (bpf_core_sections, sec); + sec->core_info.num_info += 1; } /* Return the 0-based index of the field NODE in its containing struct or union @@ -243,6 +354,113 @@ bpf_core_get_sou_member_index (ctf_container_ref ctfc, const tree node) return -1; } +/* Helper function to check if a particular named function exists as a + BTF_KIND_FUNC type record. */ + +static bool +btf_funcinfo_type_callback (ctf_dtdef_ref func, void *data) +{ + struct btf_ext_funcinfo *info = (struct btf_ext_funcinfo *) data; + if (strcmp (func->dtd_name, info->fnname) == 0) + { + uint32_t type = func->dtd_type; + info->type = type; + return true; + } + return false; +} + +/* Entry point function to add a func_info in local data structures + represented by info static variable. + This function is used in bpf.cc. */ + +struct btf_ext_funcinfo * +btf_add_func_info_for (tree decl, const char *label) +{ + const char *fnname = IDENTIFIER_POINTER (DECL_NAME (decl)); + const char *sec_name = decl_section_name (decl); + + /* Finding suffixed function names, due to the function cloning base on + optimizations. + This is required to recover the original function name that is the one + used in BTF_KIND_FUNC type records. */ + const char *cp_ptr = strstr (fnname, "."); + if (cp_ptr != NULL) + { + char new_name[100]; + strcpy (new_name, fnname); + int pos = cp_ptr - fnname; + new_name[pos] = 0; + fnname = ggc_strdup (new_name); + } + + if (sec_name == NULL) + sec_name = ".text"; + + struct btf_ext_info_sec *sec = NULL; + struct btf_ext_funcinfo *info = + bpf_create_or_find_funcinfo (fnname, sec_name, &sec); + + info->label = label; + return info; +} + +/* This function traverses all func_info entries and verified they do have a + BTF_KIND_FUNC type record associated. If they do not it is marked as + invalided by clearing the associated label. */ + +static void +btf_validate_funcinfo (btf_ext_info_sec *sec) +{ + while (sec != NULL) + { + struct btf_ext_funcinfo *funcinfo = sec->func_info.head; + while (funcinfo != NULL) + { + bool found = traverse_btf_func_types (btf_funcinfo_type_callback, + funcinfo); + if (found == true) + sec->func_info.num_info += 1; + else + funcinfo->label = NULL; + + funcinfo = funcinfo->next; + } + sec = sec->next; + } +} + +/* Compute the section size in section for func_info, line_info and core_info + regions of .BTF.ext. */ + +static void +btf_ext_info_len (uint32_t *fi_len, uint32_t *li_len, uint32_t *cr_len) +{ + *fi_len = *li_len = *cr_len = 0; + struct btf_ext_info_sec *tmp = btf_ext; + if (tmp != NULL) + while (tmp != NULL) + { + /* Size computation does 8 bytes per section entry plus num_info of the + * respective structure size: + - 8 bytes for func_info, + - 16 bytes for both line_info and core_info. */ + if (tmp->func_info.num_info > 0) + *fi_len += 8 + (8 * tmp->func_info.num_info); + if (tmp->line_info.num_info > 0) + *li_len += 8 + (16 * tmp->line_info.num_info); + if (tmp->core_info.num_info > 0) + *cr_len += 8 + (16 * tmp->core_info.num_info); + tmp = tmp->next; + } + + /* If there are entries within the regions, add 4 bytes to set the header of + the respective sections that contains the size for each of the entry. */ + *fi_len += *fi_len != 0 ? 4 : 0; + *li_len += *li_len != 0 ? 4 : 0; + *cr_len += *cr_len != 0 ? 4 : 0; +} + /* Compute and output the header of a .BTF.ext debug info section. */ static void @@ -256,23 +474,19 @@ output_btfext_header (void) dw2_asm_output_data (1, 0, "btfext_flags"); dw2_asm_output_data (4, sizeof (struct btf_ext_header), "btfext_hdr_len"); - uint32_t func_info_off = 0, func_info_len = 0; - uint32_t line_info_off = 0, line_info_len = 0; - uint32_t core_relo_off = 0, core_relo_len = 0; + btf_validate_funcinfo (btf_ext); - /* Header core_relo_len is the sum total length in bytes of all CO-RE - relocation sections, plus the 4 byte record size. */ - size_t i; - bpf_core_section_ref sec; - core_relo_len += vec_safe_length (bpf_core_sections) - * sizeof (struct btf_ext_section_header); + uint32_t func_info_len = 0; + uint32_t line_info_len = 0; + uint32_t core_info_len = 0; + btf_ext_info_len (&func_info_len, &line_info_len, &core_info_len); - FOR_EACH_VEC_ELT (*bpf_core_sections, i, sec) - core_relo_len += - vec_safe_length (sec->relocs) * sizeof (struct btf_ext_reloc); + if (!TARGET_BPF_CORE) + core_info_len = 0; - if (core_relo_len) - core_relo_len += sizeof (uint32_t); + uint32_t func_info_off = 0; + uint32_t line_info_off = func_info_len; + uint32_t core_info_off = line_info_off + line_info_len; dw2_asm_output_data (4, func_info_off, "func_info_offset"); dw2_asm_output_data (4, func_info_len, "func_info_len"); @@ -280,47 +494,47 @@ output_btfext_header (void) dw2_asm_output_data (4, line_info_off, "line_info_offset"); dw2_asm_output_data (4, line_info_len, "line_info_len"); - dw2_asm_output_data (4, core_relo_off, "core_relo_offset"); - dw2_asm_output_data (4, core_relo_len, "core_relo_len"); + dw2_asm_output_data (4, core_info_off, "core_relo_offset"); + dw2_asm_output_data (4, core_info_len, "core_relo_len"); } -/* Output a single CO-RE relocation record. */ +/* Outputs func_info region on .BTF.ext. */ static void -output_asm_btfext_core_reloc (bpf_core_reloc_ref bpfcr) +output_btfext_func_info (struct btf_ext_info_sec *sec) { - bpf_core_extra_ref *info = bpf_comment_info->get (bpfcr); - gcc_assert (info != NULL); - - bpfcr->bpfcr_astr_off += ctfc_get_strtab_len (ctf_get_tu_ctfc (), - CTF_STRTAB); - - dw2_assemble_integer (4, gen_rtx_LABEL_REF (Pmode, bpfcr->bpfcr_insn_label)); - fprintf (asm_out_file, "\t%s%s\n", - flag_debug_asm ? ASM_COMMENT_START : "", - (flag_debug_asm ? " bpfcr_insn" : "")); - - /* Extract the pretty print for the type expression. */ - pretty_printer pp; - dump_generic_node (&pp, (*info)->type, 0, TDF_VOPS|TDF_MEMSYMS|TDF_SLIM, - false); - char *str = xstrdup (pp_formatted_text (&pp)); - - dw2_asm_output_data (4, bpfcr->bpfcr_type, "bpfcr_type (%s)", str); - dw2_asm_output_data (4, bpfcr->bpfcr_astr_off, "bpfcr_astr_off (\"%s\")", - (*info)->accessor_str); - dw2_asm_output_data (4, bpfcr->bpfcr_kind, "bpfcr_kind"); -} - -/* Output all CO-RE relocation records for a section. */ - -static void -output_btfext_core_relocs (bpf_core_section_ref sec) -{ - size_t i; - bpf_core_reloc_ref bpfcr; - FOR_EACH_VEC_ELT (*(sec->relocs), i, bpfcr) - output_asm_btfext_core_reloc (bpfcr); + unsigned int str_aux_off = ctfc_get_strtab_len (ctf_get_tu_ctfc (), + CTF_STRTAB); + bool executed = false; + while (sec != NULL) + { + uint32_t count = 0; + if (sec->func_info.num_info > 0) + { + if (executed == false && (executed = true)) + dw2_asm_output_data (4, 8, "FuncInfo entry size"); + dw2_asm_output_data (4, sec->sec_name_off + str_aux_off, + "FuncInfo section string for %s", + sec->sec_name); + dw2_asm_output_data (4, sec->func_info.num_info, "Number of entries"); + + struct btf_ext_funcinfo *elem = sec->func_info.head; + while (elem != NULL) + { + if (elem->label != NULL) + { + count += 1; + dw2_asm_output_offset (4, elem->label, + NULL, "label for function %s", elem->fnname); + dw2_asm_output_data (4, elem->type, "btf_type_id"); + } + elem = elem->next; + } + } + + gcc_assert (count == sec->func_info.num_info); + sec = sec->next; + } } /* Output all CO-RE relocation sections. */ @@ -328,28 +542,51 @@ output_btfext_core_relocs (bpf_core_section_ref sec) static void output_btfext_core_sections (void) { - size_t i; - bpf_core_section_ref sec; - - /* BTF Ext section info. */ - dw2_asm_output_data (4, sizeof (struct btf_ext_reloc), - "btfext_core_info_rec_size"); - - FOR_EACH_VEC_ELT (*bpf_core_sections, i, sec) + struct btf_ext_info_sec *sec = btf_ext; + unsigned int str_aux_off = ctfc_get_strtab_len (ctf_get_tu_ctfc (), + CTF_STRTAB); + bool executed = false; + while (sec != NULL) { - /* Section name offset, refers to the offset of a string with the name of - the section to which these CORE relocations refer, e.g. '.text'. - The string is buffered in the BTF strings table. */ - - /* BTF specific strings are in CTF_AUX_STRTAB, which is concatenated - after CTF_STRTAB. Add the length of STRTAB to the final offset. */ - sec->name_offset += ctfc_get_strtab_len (ctf_get_tu_ctfc (), CTF_STRTAB); - - dw2_asm_output_data (4, sec->name_offset, "btfext_secinfo_sec_name_off"); - dw2_asm_output_data (4, vec_safe_length (sec->relocs), - "btfext_secinfo_num_recs"); - - output_btfext_core_relocs (sec); + uint32_t count = 0; + if (sec->core_info.num_info > 0) + { + if (executed == false && (executed = true)) + dw2_asm_output_data (4, 16, "CoreInfo entry size"); + dw2_asm_output_data (4, sec->sec_name_off + str_aux_off, + "CoreInfo section string for %s", + sec->sec_name); + dw2_asm_output_data (4, sec->core_info.num_info, "Number of entries"); + + struct btf_ext_core_reloc *bpfcr = sec->core_info.head; + while (bpfcr != NULL) + { + count += 1; + dw2_assemble_integer (4, + gen_rtx_LABEL_REF (Pmode, bpfcr->bpfcr_insn_label)); + fprintf (asm_out_file, "\t%s%s\n", + flag_debug_asm ? ASM_COMMENT_START : "", + (flag_debug_asm ? " bpfcr_insn" : "")); + + /* Extract the pretty print for the type expression. */ + pretty_printer pp; + dump_generic_node (&pp, bpfcr->info.type, 0, + TDF_VOPS|TDF_MEMSYMS|TDF_SLIM, + false); + char *str = xstrdup (pp_formatted_text (&pp)); + + dw2_asm_output_data (4, bpfcr->bpfcr_type, "bpfcr_type (%s)", + str); + dw2_asm_output_data (4, bpfcr->bpfcr_astr_off + str_aux_off, + "bpfcr_astr_off (\"%s\")", + bpfcr->info.accessor_str); + dw2_asm_output_data (4, bpfcr->bpfcr_kind, "bpfcr_kind"); + bpfcr = bpfcr->next; + } + } + + gcc_assert (count == sec->core_info.num_info); + sec = sec->next; } } @@ -362,22 +599,23 @@ btf_ext_init (void) BTF_EXT_INFO_SECTION_FLAGS, NULL); ASM_GENERATE_INTERNAL_LABEL (btf_ext_info_section_label, - BTF_EXT_INFO_SECTION_LABEL, - btf_ext_label_num++); - - vec_alloc (bpf_core_sections, 1); - bpf_comment_info = hash_map::create_ggc (); + "Lbtfext", 0); } + /* Output the entire .BTF.ext section. */ void btf_ext_output (void) { output_btfext_header (); - output_btfext_core_sections (); + output_btfext_func_info (btf_ext); + if (TARGET_BPF_CORE) + output_btfext_core_sections (); - bpf_core_sections = NULL; + /* Extra padding required by BPF code, just in case all structures are empty. + */ + dw2_asm_output_data (4, 0, "Required padding by libbpf structs"); } #include "gt-coreout.h" diff --git a/gcc/config/bpf/coreout.h b/gcc/config/bpf/coreout.h index 8a209f26e94b..1c26b9274739 100644 --- a/gcc/config/bpf/coreout.h +++ b/gcc/config/bpf/coreout.h @@ -38,22 +38,6 @@ struct btf_ext_section_header uint32_t num_records; }; -/* A funcinfo record, in the .BTF.ext funcinfo section. */ -struct btf_ext_funcinfo -{ - uint32_t insn_off; /* Offset of the first instruction of the function. */ - uint32_t type; /* Type ID of a BTF_KIND_FUNC type. */ -}; - -/* A lineinfo record, in the .BTF.ext lineinfo section. */ -struct btf_ext_lineinfo -{ - uint32_t insn_off; /* Offset of the instruction. */ - uint32_t file_name_off; /* Offset of file name in BTF string table. */ - uint32_t line_off; /* Offset of source line in BTF string table. */ - uint32_t line_col; /* Line number (bits 31-11) and column (11-0). */ -}; - enum btf_core_reloc_kind { BPF_RELO_INVALID = -1, @@ -113,6 +97,10 @@ bpf_core_reloc_add (const tree type, const char * section_name, extern int bpf_core_get_sou_member_index (ctf_container_ref, const tree); +struct btf_ext_funcinfo *btf_add_func_info_for (tree decl, + const char *label); +unsigned int btf_ext_add_string (const char *str); + #ifdef __cplusplus } #endif diff --git a/gcc/testsuite/gcc.target/bpf/btfext-funcinfo-nocore.c b/gcc/testsuite/gcc.target/bpf/btfext-funcinfo-nocore.c new file mode 100644 index 000000000000..09d3acc8c2d4 --- /dev/null +++ b/gcc/testsuite/gcc.target/bpf/btfext-funcinfo-nocore.c @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -dA -gbtf -mno-co-re" } */ + +struct T { + int a; + int b; + struct U { + int c; + struct V { + int d; + int e[4]; + int f; + } v; + } u; +} __attribute__((preserve_access_index)); + +__attribute__((section("foo_sec"), used)) +int foo_func (struct T *t) +{ + t->u.c = 5; + return t->u.v.e[3]; +} + +__attribute__((section("bar_sec"), used)) +int bar_func (struct T *t) +{ + int *x = &(t->u.v.f); + int old = *x; + *x = 4; + return old; +} + +/* { dg-final { scan-assembler-times "FuncInfo section string for foo_sec" 1 } } */ +/* { dg-final { scan-assembler-times "FuncInfo section string for bar_sec" 1 } } */ +/* { dg-final { scan-assembler-times "label for function foo_func" 1 } } */ +/* { dg-final { scan-assembler-times "label for function bar_func" 1 } } */ +/* { dg-final { scan-assembler-times ".4byte\t0x1\t# Number of entries" 2 } } */ +/* { dg-final { scan-assembler-times "Required padding" 1 } } */ + +/* { dg-final { scan-assembler-times "ascii \"foo_sec.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "ascii \"bar_sec.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ + diff --git a/gcc/testsuite/gcc.target/bpf/btfext-funcinfo.c b/gcc/testsuite/gcc.target/bpf/btfext-funcinfo.c new file mode 100644 index 000000000000..a59c5bd37eb9 --- /dev/null +++ b/gcc/testsuite/gcc.target/bpf/btfext-funcinfo.c @@ -0,0 +1,46 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -dA -gbtf" } */ + +struct T { + int a; + int b; + struct U { + int c; + struct V { + int d; + int e[4]; + int f; + } v; + } u; +} __attribute__((preserve_access_index)); + +__attribute__((section("foo_sec"), used)) +int foo_func (struct T *t) +{ + t->u.c = 5; + return t->u.v.e[3]; +} + +__attribute__((section("bar_sec"), used)) +int bar_func (struct T *t) +{ + int *x = &(t->u.v.f); + int old = *x; + *x = 4; + return old; +} + +/* { dg-final { scan-assembler-times "FuncInfo section string for foo_sec" 1 } } */ +/* { dg-final { scan-assembler-times "FuncInfo section string for bar_sec" 1 } } */ +/* { dg-final { scan-assembler-times "label for function foo_func" 1 } } */ +/* { dg-final { scan-assembler-times "label for function bar_func" 1 } } */ + +/* { dg-final { scan-assembler-times "ascii \"0:2:1:1:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:2:1:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "ascii \"foo_sec.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "ascii \"bar_sec.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "FuncInfo entry size" 1 } } */ + +/* { dg-final { scan-assembler-times ".4byte\t0x1\t# Number of entries" 3 } } */ +/* { dg-final { scan-assembler-times ".4byte\t0x2\t# Number of entries" 1 } } */ +/* { dg-final { scan-assembler-times "Required padding" 1 } } */ diff --git a/gcc/testsuite/gcc.target/bpf/core-attr-5.c b/gcc/testsuite/gcc.target/bpf/core-attr-5.c index c0dc15fbb271..e71901d0d4d1 100644 --- a/gcc/testsuite/gcc.target/bpf/core-attr-5.c +++ b/gcc/testsuite/gcc.target/bpf/core-attr-5.c @@ -55,8 +55,13 @@ func (struct T *t, int i) /* { dg-final { scan-assembler-times "ascii \"0:4.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:1:1:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:1:1:1.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ -/* { dg-final { scan-assembler-times "ascii \"0:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 2 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:0.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:1:3\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:4\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:3\"\\)" 2 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:2\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:1:1\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:0\"\\)" 1 } } */ /* { dg-final { scan-assembler-times "bpfcr_type \\(struct T \\*\\)" 4 } } */ /* { dg-final { scan-assembler-times "bpfcr_type \\(struct U \\*\\)" 4 { xfail *-*-* } } } */ - diff --git a/gcc/testsuite/gcc.target/bpf/core-attr-6.c b/gcc/testsuite/gcc.target/bpf/core-attr-6.c index 858ae627cb8b..34a4c367e528 100644 --- a/gcc/testsuite/gcc.target/bpf/core-attr-6.c +++ b/gcc/testsuite/gcc.target/bpf/core-attr-6.c @@ -37,10 +37,14 @@ func (struct T *t, int i) mset (&t->a); } -/* { dg-final { scan-assembler-times "ascii \"0:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 2 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:1:1:1.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:1:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:0.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:1:1\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:3\"\\)" 2 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:2\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:0\"\\)" 1 } } */ /* { dg-final { scan-assembler-times "bpfcr_type \\(struct T \\*\\)" 3 } } */ /* { dg-final { scan-assembler-times "bpfcr_type \\(struct U \\*\\)" 2 } } */ diff --git a/gcc/testsuite/gcc.target/bpf/core-builtin-fieldinfo-offset-1.c b/gcc/testsuite/gcc.target/bpf/core-builtin-fieldinfo-offset-1.c index a4af9a53282a..27654205287d 100644 --- a/gcc/testsuite/gcc.target/bpf/core-builtin-fieldinfo-offset-1.c +++ b/gcc/testsuite/gcc.target/bpf/core-builtin-fieldinfo-offset-1.c @@ -52,9 +52,18 @@ unsigned int foo (struct T *t) /* { dg-final { scan-assembler-times "ascii \"0:1:0:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:1:0:4.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:1:1:0.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ -/* { dg-final { scan-assembler-times "ascii \"0:1:1:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 2 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:1:1:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:1:1:4.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ -/* { dg-final { scan-assembler-times "ascii \"0:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 2 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ + +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:0:0\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:0:3\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:0:4\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:1:0\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:1:3\"\\)" 2 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:1:1:4\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:2\"\\)" 1 } } */ +/* { dg-final { scan-assembler-times "bpfcr_astr_off \\(\"0:3\"\\)" 2 } } */ /* { dg-final { scan-assembler-times "0\[\t \]+\[^\n\]*bpfcr_kind" 10 } } */ diff --git a/gcc/testsuite/gcc.target/bpf/core-section-1.c b/gcc/testsuite/gcc.target/bpf/core-section-1.c index 4f16b087c1a2..c2bac46cee78 100644 --- a/gcc/testsuite/gcc.target/bpf/core-section-1.c +++ b/gcc/testsuite/gcc.target/bpf/core-section-1.c @@ -35,4 +35,4 @@ int bar_func (struct T *t) /* { dg-final { scan-assembler-times "ascii \"foo_sec.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"bar_sec.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "bpfcr_type" 2 } } */ -/* { dg-final { scan-assembler-times "btfext_core_info_rec_size" 1 } } */ +/* { dg-final { scan-assembler-times "CoreInfo entry size" 1 } } */ From patchwork Tue Feb 20 10:24:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cupertino Miranda X-Patchwork-Id: 86026 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A14EC3858C74 for ; Tue, 20 Feb 2024 10:26:30 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 20C5C3858D38 for ; Tue, 20 Feb 2024 10:25:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 20C5C3858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 20C5C3858D38 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1708424709; cv=pass; b=FOyccQASXePfINjNqvjIJYztQQhnpAzBkDtY9jF6K3K08DQs3RDv9raQbRHhNXgkvMDjqAHw1c6/5qlURIA78ppaQGY2YizWsHcPyQCh+D7Zk5b8Ku4B9q1jATwqOh/oe/HyNTblmrrvA8z6qpFnLsUAC3CdtRNMJaL0Sl13jIQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1708424709; c=relaxed/simple; bh=RL8e5XLUp0H3lGnVgF/4pjbe7LBSM+E5f+W++PXWLhg=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=fwsKeTlQk4qMaYfGQMSA2HYCQhex7EAMyCt3zP6twwAmHyRi7TwQCY5oZmcB57ze0nZQ7DQpPP16qT3l2jXtSzp9gO/fd/KWlIKsJmPSN3JHVhZmu5SQzb5aNDjhobtuB94K5xMiETLWXrs+Aho9yS6zXre3zHhRhnVczvq7Dio= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41K8xRRB024948 for ; Tue, 20 Feb 2024 10:25:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=hAmzY8IjZS1xDrONr2+3rJAn40wk+J4R8WhHqdZtOVk=; b=MGhb7bZySo8cx7P+0uQLS7oZ7VAj2FM2itc8zFDG+WJouAeYCZFXzSwpmshrsJwqmc0c D/lXUujv3+m1mXQY9CGSYBHpdkKg99j20GVVdlUiTG6bsef6Us5eYoTtnvfdXqYyQ+HQ M4W5Jbj1tKwYJZdVEGhw+C+O7OJn3qYDEP/qx2nzxnsxFBPlTKl+0GW6d25cEQXazd9f VW9eyMDlIY3XXNwTUS9V6bXUFC5pwB5f5uAddaIu1qVVVNqlTYmzoa+OYOparMzzGg7I WjOkfqdkF2yrWpU8jroSENt/jmeGExaJdqfgmB4cno5Wa5UNzfF7pRr+bkBEWcUAjlq4 Rw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wakqc6d3k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 Feb 2024 10:25:05 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41K9rlNM039647 for ; Tue, 20 Feb 2024 10:25:04 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wak872awb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 Feb 2024 10:25:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DejfXYBKHABjBwloztqb+dpueVKnTm9OxDlIUKa1K9s8XdQjNDhu0Z+zWCmN+Fpaw/8QPBXRiJvh0+7mwy+NrgAHvqNPceesFXoI1kpvmos17xWc90l7M2bLL8iybMh+WjDEzoxasMH5SGFxjsBd+j3ERgTm0wMpKOFZL1cztv+up4vZtUxRZ9fenVsuITt6Wzo73pWuR78Jybt5ok2O1H2R3/xj+pKAlfCNpQ85I5KxP9dUbXwiwov3rcm0xiDkViUxnRhV5O4sIX5dY7Mn2o+H1AoDNmXUjT0YH70ul5w7pFu1HKegEx3VzI/++JJ6Mi/82r8KG/7KwoY8yGxTEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=hAmzY8IjZS1xDrONr2+3rJAn40wk+J4R8WhHqdZtOVk=; b=WZk0nJmBsXOEs/452q0uoKzH+8hU2QRmDyYNwkDyKww0Txs/h4mLUnEHOOE/Rn7tPULm0AFjOOc4GKIrU6zUUTtjPkk6Yhsemye9OrFQ9+FIITJLdlmUpjW4e+xiBqSTrOfdRNaZPM7dLRgUd7EE9AygcODXuC1o8eZWOseAJPqnCJ0w+Aft/DaWPAkpS0I2XrHMKlOn7VDocv2zhhUT8NKLJHglBuXuuA/tXMVcjAo5k3K8fumI4wvPQIfnV6cuCpcZkczXforkhx9XYmnRUpl4EPEldaPT3k51ptzXfBDyWQ0K28wCvsRapC2kLBKPjW/ftu1kKJKuSZc/EI7y6w== 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=hAmzY8IjZS1xDrONr2+3rJAn40wk+J4R8WhHqdZtOVk=; b=sZzfFKerWrYvfI4B/nrSy8guv2EoJgetMC+5YFwYusxt5SnV34jcfSbeS4SUcLsv7gpV6j6pLoGlUr7T/bRnDgLJNHbTpDcqQxMknDVYBzfBlZ7aI4XFuuDl1X2tgPf5Ocub8v47oSpnw7EDQu7caPKqHhLABOwKGTYwZhF/+Bg= Received: from MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) by IA0PR10MB7624.namprd10.prod.outlook.com (2603:10b6:208:491::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.39; Tue, 20 Feb 2024 10:25:02 +0000 Received: from MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8de3:eccb:9288:95d0]) by MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8de3:eccb:9288:95d0%6]) with mapi id 15.20.7292.036; Tue, 20 Feb 2024 10:25:02 +0000 From: Cupertino Miranda To: gcc-patches@gcc.gnu.org Cc: jose.marchesi@oracle.com, david.faust@oracle.com, elena.zannoni@oracle.com, indu.bhagat@oracle.com, Cupertino Miranda Subject: [PATCH 5/5] bpf: renamed coreout.* files to btfext-out.*. Date: Tue, 20 Feb 2024 10:24:27 +0000 Message-Id: <20240220102427.1512739-6-cupertino.miranda@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240220102427.1512739-1-cupertino.miranda@oracle.com> References: <20240220102427.1512739-1-cupertino.miranda@oracle.com> X-ClientProxiedBy: LO2P265CA0434.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:e::14) To MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR10MB4382:EE_|IA0PR10MB7624:EE_ X-MS-Office365-Filtering-Correlation-Id: 53d71f39-dbfd-4ce0-9854-08dc31fe32a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LEAJLKd7ewFQAv9KyRLinvJielOcv/1BJB4V4mQSUkOMACgkE31Q4bLGCrHRX441Uo0FqxbvhXARH+7wEBz/kJSo+8zAln0JBPl9MOkm/PAvPIK71d2ry6j9O/KV0rtON2JHuo25Botdetwos1CNG8fW/ByHT9ATKiEIwuH7usqsA/MpMUl449bFEEvBY2rIreY6WKEspPN3Kdtq5lEnoUjqf3aeuizI3A3kt4MB221pzdM5SKMepRPyClrMFBTV+HAwrun9MKHLG52MHfwPUJchvNGoOMhoFM1w93TYwemUJI4XnVKKnTwKfvuZC8aH6gMIUdMjW8DkCCR8mdXdzjBEh3mYAFM5b5gWIQ4TEGAjECEViyw1+2DHTrFXUoazHNSVUXxwkxTRmESJNqcmPpNQsKFyjrwHgNUeZuRyAFeFrv/mgntL3+wDaXAhiHMu3YZBT+T18TAOvIK2zcrycLeGMxp54JvjEWTaL56IkTBykPVMm7PuH+a9SJl/FM0JZ2huJ6IhG8ERb7Lwp0QoFszU9VIzj2EIMQ7EPZMrkQU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR10MB4382.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: y23fKEv4D4nywm+f8zBWU/HEhIqBtHJGc8VP8QHVi2lIq855XRHx8iG/H0mdok5/3OSP/fAH8UfEhzbdXEXoOBr6Ym2DR6vyZ/LRjwum0tEAIUuJCEZ+4DSfC7ASH4bh42HPnxiq8xxnxBdYh4JV2uuoQMnsT9BF9EKtzTSPt0MiDEFDNGswzTxnPMQggtcRUnpZwDlrKcFQjZ6s+us3ErLDrqv4ko4zylFSzrhjMrrVFArsU7Yn+PtJDIY4YAAFR8zgGkXH3b5bZMRHPEgajLH6xs3RX1Mdl4DzUCTFwS7WEsCPCmPJlxp+tz6IAPF/1o0yIfD2Me8NbJz8GzC67dbm+6iJV6rW71nw2hm2lwG7luiuKCiX7R++s1UkouA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FhBkcQfDpBRS8aCjH2HzZof9wCkTOBQ1WQ6iHMtraIRQCXcITSkyMII0UKkBFFlJAVhpSxZjSEzr5+8A7bSQCMAlEu2nryEVxPULU0ML1f2ngK42FsdTaeBzZ2M91/5ZcTFTFbI4waCwZXzx17o8LAo9xwPH3MRhbLUuAmX8s= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: r2Xqf8j7jGFqwQH3cMwlBlnMJAVUIOh/r0MYR9i/7sb4iv/9t5Z1DjX6iJYyotRBlgosApgxJ9XaG7rBvdYdWZ77IWBPFTIBUEGTx/pi1Bz1K38fRX9PuhZG8NlDs1BkV5kx3Ovntv+vJNXKNzmSHEpc7Y9FKenO0GiLnQQ7y/9kkT8QX4iUq/eUWMFOKTH5RbTHqa26mtVu9KSGpfV4UVmEop0BAwHsxnQMzaGwuNnQ+qmOW39f2uDdU8t/+HxWk4XEj19NPMJIRIBrIhPmyCmFvPE7g6aQdsLCFfvNZqBvrRo/o8pHxR993sSGNir/EBrUY5qSbQCcC4WD81MQq+Wset6aF9xQAnye7u2xFvq9NtJ4i2ClkOiwzypJgrCgRdFvIixOzWrgqwiW92nG9IAyM6xHx12OPSYzIGDJ8F4zSpscwQT3D9omz1sPjmmjnawUrN428QxQOxZi6eNB1cVyEc+y0xnyJ0Y6OMEesFUoNcRStrP3qoOPtsXi5EtTeakx1l9spDsRBeGe6yt1EcJxSyyhJmQJMzpUzjNET4vViMl4Zb0LSV+9/v26pIo6nmL4HbSAIKl7H7pmafbV8yLAweXJ05Q7h0Ka1EmO/R8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53d71f39-dbfd-4ce0-9854-08dc31fe32a1 X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4382.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2024 10:25:02.2123 (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: fVgxK5YD+fmpfnuPl8GyPrAYLgO0Nt4Dv9LwCgc3WxrAN8HXOwT4Xibh3xly/c/T9+D7xC9bNgKstUcCEOGMyfp0S15Yll+x3ez2r8rv/Pk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7624 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-20_06,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 suspectscore=0 mlxscore=0 bulkscore=0 spamscore=0 mlxlogscore=951 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402200074 X-Proofpoint-GUID: oyno3Cs4utCPoHMaAB8WqU8ABscLEfvy X-Proofpoint-ORIG-GUID: oyno3Cs4utCPoHMaAB8WqU8ABscLEfvy X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org gcc/ChangeLog: * config.gcc (target_gtfiles): changed coreout to btfext-out. (extra_objs): changed coreout to btfext-out. * config/bpf/coreout.cc: Renamed to btfext-out.cc * config/bpf/btfext-out.cc: Added * config/bpf/coreout.h: Renamed to btfext-out.h * config/bpf/btfext-out.h: Added * config/bpf/core-builtins.cc: Changed include * config/bpf/core-builtins.h: Changed include * config/bpf/t-bpf: Renamed file. --- gcc/config.gcc | 4 ++-- gcc/config/bpf/{coreout.cc => btfext-out.cc} | 4 ++-- gcc/config/bpf/{coreout.h => btfext-out.h} | 2 +- gcc/config/bpf/core-builtins.cc | 2 +- gcc/config/bpf/core-builtins.h | 2 +- gcc/config/bpf/t-bpf | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) rename gcc/config/bpf/{coreout.cc => btfext-out.cc} (99%) rename gcc/config/bpf/{coreout.h => btfext-out.h} (98%) diff --git a/gcc/config.gcc b/gcc/config.gcc index a0f9c6723083..1ca033d75b66 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1653,8 +1653,8 @@ bpf-*-*) tmake_file="${tmake_file} bpf/t-bpf" use_collect2=no use_gcc_stdint=provide - extra_objs="coreout.o core-builtins.o" - target_gtfiles="$target_gtfiles \$(srcdir)/config/bpf/coreout.cc \$(srcdir)/config/bpf/core-builtins.cc" + extra_objs="btfext-out.o core-builtins.o" + target_gtfiles="$target_gtfiles \$(srcdir)/config/bpf/btfext-out.cc \$(srcdir)/config/bpf/core-builtins.cc" ;; cris-*-elf | cris-*-none) tm_file="elfos.h newlib-stdint.h ${tm_file}" diff --git a/gcc/config/bpf/coreout.cc b/gcc/config/bpf/btfext-out.cc similarity index 99% rename from gcc/config/bpf/coreout.cc rename to gcc/config/bpf/btfext-out.cc index 31b2abc3151b..4281cca83e13 100644 --- a/gcc/config/bpf/coreout.cc +++ b/gcc/config/bpf/btfext-out.cc @@ -33,7 +33,7 @@ #include "tree-pretty-print.h" #include "cgraph.h" -#include "coreout.h" +#include "btfext-out.h" /* This file contains data structures and routines for construction and output of BPF Compile Once - Run Everywhere (BPF CO-RE) information. @@ -618,4 +618,4 @@ btf_ext_output (void) dw2_asm_output_data (4, 0, "Required padding by libbpf structs"); } -#include "gt-coreout.h" +#include "gt-btfext-out.h" diff --git a/gcc/config/bpf/coreout.h b/gcc/config/bpf/btfext-out.h similarity index 98% rename from gcc/config/bpf/coreout.h rename to gcc/config/bpf/btfext-out.h index 1c26b9274739..b36309475c97 100644 --- a/gcc/config/bpf/coreout.h +++ b/gcc/config/bpf/btfext-out.h @@ -1,4 +1,4 @@ -/* coreout.h - Declarations and definitions related to +/* btfext-out.h - Declarations and definitions related to BPF Compile Once - Run Everywhere (CO-RE) support. Copyright (C) 2021-2024 Free Software Foundation, Inc. diff --git a/gcc/config/bpf/core-builtins.cc b/gcc/config/bpf/core-builtins.cc index aa75fd68cae6..8d8c54c1fb3d 100644 --- a/gcc/config/bpf/core-builtins.cc +++ b/gcc/config/bpf/core-builtins.cc @@ -45,7 +45,7 @@ along with GCC; see the file COPYING3. If not see #include "ctfc.h" #include "btf.h" -#include "coreout.h" +#include "btfext-out.h" #include "core-builtins.h" /* BPF CO-RE builtins definition. diff --git a/gcc/config/bpf/core-builtins.h b/gcc/config/bpf/core-builtins.h index c54f6ddac812..e56b55b94e0c 100644 --- a/gcc/config/bpf/core-builtins.h +++ b/gcc/config/bpf/core-builtins.h @@ -1,7 +1,7 @@ #ifndef BPF_CORE_BUILTINS_H #define BPF_CORE_BUILTINS_H -#include "coreout.h" +#include "btfext-out.h" enum bpf_builtins { diff --git a/gcc/config/bpf/t-bpf b/gcc/config/bpf/t-bpf index 18f1fa67794d..dc50332350c4 100644 --- a/gcc/config/bpf/t-bpf +++ b/gcc/config/bpf/t-bpf @@ -1,7 +1,7 @@ -TM_H += $(srcdir)/config/bpf/coreout.h $(srcdir)/config/bpf/core-builtins.h +TM_H += $(srcdir)/config/bpf/btfext-out.h $(srcdir)/config/bpf/core-builtins.h -coreout.o: $(srcdir)/config/bpf/coreout.cc +btfext-out.o: $(srcdir)/config/bpf/btfext-out.cc $(COMPILE) $< $(POSTCOMPILE)