Message ID | 20240227190435.35750-3-cupertino.miranda@oracle.com |
---|---|
State | Committed |
Commit | 69a3ce49bda929e1ffbc1fc1123f5f2485ec944d |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> 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 417DF3858413 for <patchwork@sourceware.org>; Tue, 27 Feb 2024 19:05:38 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 998243858C98 for <gcc-patches@gcc.gnu.org>; Tue, 27 Feb 2024 19:04:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 998243858C98 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 998243858C98 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709060697; cv=pass; b=osd/Ah5lMGpShX2vyK6m1DgC4nA7MTvwGYLr6K7ebVJQ2phckHbfLPf1tr+GHiTSSHYHwGu5NaSuzOlXTZlSHspzIJSRG92N8UgxTpV6W+CdEfmmHGeZexZm+eNQVs73jKfHRhmDSVW/dwvTw/kw9IJ50bQmbohPPrPDhawG384= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709060697; c=relaxed/simple; bh=eC7s6w6SjkuRDua5MLPQaBIS6QTDjEVCEb/j7DKVDAo=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=dUDsuaKoTJI/uk9OeWb460E0rK4lx60hqnkT5U8BjqupQjrqLp3TJz3BGrsWYBX8IBAiMfEm16bl74IkBQzYiWkWaqMRq38tvnIbqPEJ/1k8ANe39xUe+8pymmm4tUZKdhvuDW8fVkqJsn0E015m1e04TzX99bNkgGCxUU+52HA= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41RFY19M004804 for <gcc-patches@gcc.gnu.org>; Tue, 27 Feb 2024 19:04: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=jHMSY+xa1Q/nFYSxVOCEetTuM6Yp1iLJUpEaoem92c4=; b=Y7pqnB1vPRbEmesdBx5b+5Rjy1oOTYmjDIGG+meq+60Y0i9P/oMOgARuKw7NoTAG/zMK 0SE4marRKx6OUpYZ5TvduTaiKh/J1wSBo+HM984c1K+1Gz6ikEZGRc1fsRQFEMwCL1KT aIUYZR05XfRGm0617ZwSfzY91IkDg/zIudeqcQwoMTIBJjiYFLefETQdWmbMIpgtFf0f JOw38doOBCZ6WJY1MFX1GOzEnMtVPlH9sNe57krcCvz1AX6CXYu6TKfFh4N3WKPXvhiJ 1NlfCrdUR/7wZf8Qo7+9J9/474R1rA7Q5r/tfIAMDBq3aKWZtVO0FJUWMTZR6iejmOG5 +w== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf6ve05jr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <gcc-patches@gcc.gnu.org>; Tue, 27 Feb 2024 19:04:51 +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 41RIp2dx001736 for <gcc-patches@gcc.gnu.org>; Tue, 27 Feb 2024 19:04:51 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6w7qhng-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <gcc-patches@gcc.gnu.org>; Tue, 27 Feb 2024 19:04:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mO4fdHej9ysbEY+MhZkMEqY4g1rfFX+e4fpDLkksR/mzvUyMse/0LG3uCs+ZlocMq/NkSu13UHrX/NvSa0S79ynZrtWgT4hj154H13fj+S7SHwVSRGR10o4u4Nj12xKvle52KiNZ7QkjI+20W6xB/MPpVppUStFuum6ydNjl3H2w0r91CnQVZJH2+h3+2YbG+0e20INhkcDVcdgwyNDirNgNVp63Q48jUxeEevsOwkitHrTC5gzEOeys48rhmOcdgxXOUBAj18Lvb9J4mBO/r1DUojM6jQKjm3nOK8RuysmQ8igPkQRj5x99kJHkXleKWvCsLJqpdNVn2n/gxaeMbw== 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=jHMSY+xa1Q/nFYSxVOCEetTuM6Yp1iLJUpEaoem92c4=; b=R80UJNZMX6iHqd6fcSyOKaLoP8TiTfOM94f5o8ylLcISdvnQ95l2igeYPV7yXiGFtRgBSehtplNrbx4igHzfcUJigtvA0Y32KzvcN7kGSCJaB1HxVIGkZsJXCiaxkLQGXW97uYgSNWErXqvScYh6aVLjjNyMBa1ghBhRB0GsQgFF3GDxKI6Eq71KmeSg2YLKtd+khjqlY9PU7jSpWStOvMHt1D1I48h/sEjuSL2o4LVaiozEwJoeS1F+Sl/tghB1pDEvgTh00wAcn2yRRnyEiP8d+fSckVbyHGOLTHKhAaDuh591ARCxUjkkCnBdgzB7mLhihGKXTgj8cqRtjosHpw== 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=jHMSY+xa1Q/nFYSxVOCEetTuM6Yp1iLJUpEaoem92c4=; b=BF9qfz/KVVa5pQUzIrU39zE0Yhu+0MU2w2Yj0EyeYHJoNqUaxLbyLTjp1Px24Bij1jTeeSZDQ8ik5mo3VWw+nD+5wjBODu8TkbTo8ppSbD7BHdil0prsziuM571RJp55lrDHY6mLlAaHRohGOylrNzGkV1ncrOhieq1n6ViYXY0= Received: from MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) by PH7PR10MB6625.namprd10.prod.outlook.com (2603:10b6:510:208::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.39; Tue, 27 Feb 2024 19:04:48 +0000 Received: from MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8aee:c094:84e2:9401]) by MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::8aee:c094:84e2:9401%4]) with mapi id 15.20.7316.037; Tue, 27 Feb 2024 19:04:48 +0000 From: Cupertino Miranda <cupertino.miranda@oracle.com> 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 <cupertino.miranda@oracle.com> Subject: [PATCH v2 2/5] btf: added KIND_FUNC traversal function. Date: Tue, 27 Feb 2024 19:04:32 +0000 Message-Id: <20240227190435.35750-3-cupertino.miranda@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240227190435.35750-1-cupertino.miranda@oracle.com> References: <20240227190435.35750-1-cupertino.miranda@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: LO0P265CA0010.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:355::7) To MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR10MB4382:EE_|PH7PR10MB6625:EE_ X-MS-Office365-Filtering-Correlation-Id: ef586b8f-d8d1-4c1b-4e56-08dc37c6f804 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OtDjvZMFsBWCd5DfVOMA3ccthb1AgMF8YSMqJ/F82iveGVehO9QpfvqZArhZkxWbkv/SC9Uq4W3ahSfyMWKgaVbRB6grxUsdjaNCTbu7sPsnV2TmYs3nkgtUxNDHUh5aES7cTTT3BxZmfzW36/YenvTgatET8DQ+r1HmNAAJdGGejtfXgZ1pVu2JWwWryaITa3hkzk2uWu9aONFigY+Vu2V5At7uGs+g1HMVOn0Wdm1RrQeuePxNmlrlyxFNCYCsCQ/Gf9OH1Qe9I/JWpMsH1kKYsZz7eoJa/htlOQgidGg1MmzGlgBC31BCUn625P7SXYAjrAkD9OAAoN8yTdHKhGBWBFVSvT4I4vOgPf8q7JQKQm0rdG38og/GASteGbtbVUdyngECA9RjEVrcTZ2yOenXWcKMz6CSdMa9knmsS9ot4qir0wYaVpUw2kTDqJ8lwXGLHwOQ208OIn5HsaR194H+n+6kumifUyyQ3dGOp5NR55nmr1Q1RNYkLC8f/SOiJGpAKBHfmbkMYbLcc8vK0UIFvpT/MPDbhtDjiq/uASV3tVVXj7GkYkTKF4MAlpL5dcy90JDZb/Q8I9sKV61eVU2utfHhmUTt5hlsCLdYGzvQbhH0Pqykxe8xmhdxxRYHtgaysnlQzfjRcuywQJKoUQ== 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: OHJ42Cxja/ZhopjrLIvZEpKM1rlw95ifu5FOE/qF49PxRSzCilwEvNRg8TihgmPc6+qJFGwk0ftgXH+G6VOqfbUualPlpqfHNys38DYFs8oW/691rSutpfy5Sc+Mlbh+/dKgD+Aho4GVDo0r1Z6nETD3IByiCK5hq21NTs1cfTwEhcCpMvMzXQDfxUKLpGpUJdG7FSs6B93f4TB21HUPPBxTs/zoZODB4ivJZW9TN7CLdO+V9v43/TruQ6mNwgcHwOo3ojDSlbJfgMIrwEShyROooFSg134i2lyhaoQf+txJbeDwZwXYQWlAi9McEZ4Qliim8/dr7rJzP5BskNg7dHh/2EtKFs/PIjts+QimFN1RASA//qcrdA2FQQmzKF5t5ZDZDi2eOZvQMI5Xop1ylX6pleveiQJy6ynJV1yrewzSSG84fHLfZdOtMMGwxRUSe2cCf5cVE9qUQQQ7/5HjDCQSXORKY+QKg/gwKV2yczFmBwR23fHF6OSugUS6pBWFinAF4hKSE+NvK8jCOB4vPjL6B1hg6g6pxBqbeqEgMqo/h1KRXm0DvyQiweRWAV1/l8nexWkxP0kDkloc81Le2PhybrQJ3PFMubCWQ9hXFCMMqYUwS8SLxyLQvsOYTpFXkVJkD2z6CoOESiqmN6/V+Xt1fzTJ3o+8Jbo9M74wozex7onW1jiC/KqWb77sn1BYTUcUAFBbnM0bBN4/T1CL+mbXGrmVfFU1lbsJco40jdS+J+9mdaREGdpnh8VqCJMb0XYsyQbv+yCkLEAEfJgwnnM7tBjOiBre+EEFA9Du1j3k/kVQczZU2RhZ3xK2bxjfyQavcIWEIMAkdSuJ+f6dIqa/YsuspE7Fo6KUsDFEP1LjUYIwmiYE2TdTzVdxC8Il9dhpYgACIwnwMiYtoRtcZbFHeVqQ+nrdkwp/YYll1dG4+oeAR0iufeRf9Y9n4gBaxCXSGZmQlgukhjyiE2Jnfw9k+gboyOSd9XNE/3UriBFKkhHHcYH3AYzihvK7PGbN4kXn6EkAjL0m3DxYJEsyDrFCaKFvAubwVUq8XyO2sEhUzq+zi5SryvzpCS9KfX1dWdKnxCxEOnkuRS+AKt4wlti8vOXDRARBHNRj2fcy1NmhskMNsp0w0lKwprwSxo7NT7agpy3gMEcgwE+urXBWPQdsV0gK5T96RBM6KI4u9PHBH0BmdiSed0Do5rbZ3NtO+O1ZRiTqKEYX+ZDHaPDDE/fvRelRa8Xr3AvC5P7Uvw7hhDVoMVP/x9STQuKmFqfJINaaEmyNMGnyjFSyVomRF4VuouxBo71Qw0ltQBJ13Rv30Xxn5hA4tbnguP8ozIoBXF4Ue6Tyi97sUENXwS9lSxOnBQH0z8fy7YgKUB4wi43PLPXjFz00xkMx9Pb8xOXNKiVn0YdQGA/svK7yKDZmCz75PGRfR7eAzVvPJ/DE7maVG0vuUGNCUeAKw8HzGH5JASy1wWvtd2W5Ft1ZAq1C9NoNzrIm3v3PNKdanoUiGCRUlAm3whbt8mRPg9T8G9wt7qxF6aoJ4Vn3mDaL5AmRIZ5WJGfBh6ATmiOcmTIH6qifShZ2/kwSBHMii6nNsuqLp8UcSYHmwLoWqc0WKXvPloFgEMI/QxCKCfGT80svg1k= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: wtPYy5r1UgvHl6pZOYjhyzfgD0ndMp+xNgXVdbKmZ50NoWI3pazRMxAQV8ok8w48nZmweOczoPvz+b4Tg10VnSwGN6jA1Lr818iDhhlE5cbAU45Q5fZvzoBBdktSfv5iHgMCsGKwx2Ok9trdq2QI3XouUGt+nK+69JdVsnVI3fr8muMfQpDZIZs/188oPdPtY3ss/35ndsS1+XgDOg95IMUhnch0RHPoJFmKZyLmjgzZOTIC6vP+qDJ6gdWID0PRAVEm5qdPiEvPJlQrth+ObNcKPBo5s+zQCou1GdCXyT1pJF1cBQ3SR+14E5T4EhrA3v/n10NBVDwtejBxHJagD6sXdxFlJict7i7Li7XqkzRt/XgZ5YmzJssXmMt4HQvPWwpMHX7s4eyP6WN1cIuPKqDVk+5wwriFzSVtsXnZjgQQxflIGxvvc8kUluOcGOXKUvp17HIO9lk+NKeh33hhLVBPNfUmt0scHCyJygMFBXy/Bp7q1uVpNtYyzPjvAKblNDzri9GMgkwHeaUsiO0hXyTgrb7yzF6ojuRuQEgokF/K6Z/MI7HDIY6PxRZtfJTnYcbPWYuOhfKFow4wuxuhau8j5zyV9T1G849hWhOq0u4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef586b8f-d8d1-4c1b-4e56-08dc37c6f804 X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4382.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2024 19:04:48.5515 (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: J0v56By1mWlN6t19Tn8PiN/zTC5diXCBQkcjKsKKEUNcmu2JW7pScuiaJtpkx+j8teQUpf9IZNXJ3umhcMyKl19KcVbGZzfklEnaT/nY1P8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6625 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-27_06,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 adultscore=0 mlxscore=0 mlxlogscore=976 phishscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402270148 X-Proofpoint-ORIG-GUID: R-BnbVqQdn6lqpk15tCD9H5H62vy-mA_ X-Proofpoint-GUID: R-BnbVqQdn6lqpk15tCD9H5H62vy-mA_ X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org |
Series | [v2,1/5] btf: fixed type id in BTF_KIND_FUNC struct data. | |
Checks
Context | Check | Description |
---|---|---|
linaro-tcwg-bot/tcwg_gcc_build--master-arm | success | Testing passed |
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 | success | Testing passed |
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 | fail | Patch failed to apply |
Commit Message
Cupertino Miranda
Feb. 27, 2024, 7:04 p.m. UTC
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(-)
Comments
Hi Cupertino, Similar to patch 1, please use present tense to match the style of existing commits, in commit message and in ChangeLog. On 2/27/24 11:04, Cupertino Miranda wrote: > Added a traversal function to traverse all BTF_KIND_FUNC nodes with a > callback function. Used for .BTF.ext section content creation. Added -> Add > > 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. Mix of present and past tenses here, please stick to the present: Defined -> Define Added -> Add The code changes LGTM, so OK with those nits fixed. Thanks. > --- > 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. */ >
Corrected and Pushed. Thanks, Cupertino David Faust writes: > Hi Cupertino, > > Similar to patch 1, please use present tense to match the style of > existing commits, in commit message and in ChangeLog. > > On 2/27/24 11:04, Cupertino Miranda wrote: >> Added a traversal function to traverse all BTF_KIND_FUNC nodes with a >> callback function. Used for .BTF.ext section content creation. > > Added -> Add > >> >> 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. > > Mix of present and past tenses here, please stick to the present: > Defined -> Define > Added -> Add > > The code changes LGTM, so OK with those nits fixed. > Thanks. > >> --- >> 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. */ >>
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. */