From patchwork Wed Oct 30 18:31:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Faust X-Patchwork-Id: 99839 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 E4DA03857C6A for ; Wed, 30 Oct 2024 18:33:13 +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 746A63857BB6 for ; Wed, 30 Oct 2024 18:32:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 746A63857BB6 Authentication-Results: sourceware.org; dmarc=pass (p=reject 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 746A63857BB6 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=1730313144; cv=pass; b=ZUz1cX7DZk9it4qLvmnMH+KApMu308rCo9wXA5nEJ1AxzcBrSKYiLcjTWMvfaWd68ZQ1YSeO2UgqgIr55oxDalQoyRDKiHrJsSnAOwjlv57LyGSI29GhRGmWvcBJVRmg9g2YRRfwro/X4os3T/AOh5s1dFCMVl+oKMATvZZY7tw= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1730313144; c=relaxed/simple; bh=nkOLhlDifUdHP9uHJ2Nh3s6ZFGdAe32NvdbU9wbjNdA=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=Wmey5OLtrJZJNyrXAqBiWt+glrmYih4ETZJd0kvaDs7YJUqkyXJ8JTPb5iUH0WfDk3sK4WOf/Cnt1fuENEqbZ5KecdfceTiRp6u6K5c7IO4ocA1hAMs6sdYvKxu7B14l18eWNCC03E6BWT7+37rHExQWO/yCK9ccVmDb/BfaKO8= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49UGXb2D019158; Wed, 30 Oct 2024 18:32:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=BbM7y/YJP8BRdqlV4BBhm1T92g5HX71KHak3DJdaNZc=; b= Cn6hNzjQwx8+SlToXeL0Lvtvy67hEPXLWxjS5W4TAPmQAP3cCNPr5A6b0O5KPOPT a3EHFuajCiIKo0wUvvZjJ0swRrFmwcx2dZR6Vwx9N9o1lhu4JkngzHVhZFYDStIs f+0hPl1eunQDnPKbhYxkacmI6y1pIhAA5n/F3STXpWKt7TKM/sdSbd/CZjruoG7V 4qWng2ZkwyxeY3f+MsPdIOUNMmgotbtKBYHUUgW+12oc/ZBnMY3l7wjIrTy5zE5G 6we4/2CHWbprlb/Isgf/hr41Xsu4zo0pdB+bhZdNfS8vxRrYfGCLUgxpvwlF9EIO KG+TGC7IjMmznT9l55OZoQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42grgwgnu2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Oct 2024 18:32:20 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 49UHR8KX004777; Wed, 30 Oct 2024 18:32:19 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2177.outbound.protection.outlook.com [104.47.58.177]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42jb2w3ayh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Oct 2024 18:32:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jOfPH5Me20jGfJqffBo4CIMzFWPVQuuHFWw2fQYXxtwcDpizGMoXl+nWLNmhAeAQEv2ukJ74XGqunIzx1YWaAAxavoOf7QFmU7AO0xzoywOwg5hkfJNjpwC8M9hlGpc22uDwOM3VtE6/o5V/dGgtSzfWKAmbGbjZFtEnd6wi75riypAS1D3IsXdnxUTteV/1+pilLadR40YywOB821tHfOze1cXH5R5jq3ZJjbbtn4tary5SXHtzf6y8NxZTcW3jLBhFkjr1+BOjunfIXSCpXLdhBXDMGNxSkUgW5nZZrNty6cH/ZEd23jxwxVWd7vL12JV/R/yDJZapwwd1FiLKGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BbM7y/YJP8BRdqlV4BBhm1T92g5HX71KHak3DJdaNZc=; b=oLLn3+rUkc1kxcqK7RAqK+PbOrVf7MV3gwP9L9q9/BdTipB4oL7/MvUVEvlZ2Mo0ASOVow+0fWh4/LEdvcXP93TqX0ZI/bNQjjG0SGxlpa/07qHPRPQR979mDW+0gzMHQ89RnW+8Lu0vTpDaNm9pG3UtvAFesxhORcifphmCf9ArFGaoqLa8nsceheekn2ehExnriOY5qslLk0SE8Ij3l86s75MWGKLMWX+H3swfzfF7hA2Y8usrCgJo3c9DSmkAOWariqt5m1PEbbUoJ/vgOua39hB2Ir+U6me76TQuMkXWkTB0A+UvZHPa4uI8BVvQVP8wfXNTa24cNmhzqDrcHA== 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=BbM7y/YJP8BRdqlV4BBhm1T92g5HX71KHak3DJdaNZc=; b=w/Y4taGZuZYocwZ1WEPHypxTaaSD+ZquzkmaProKGq8pc1GLDCmIBSxV3F+LqJKXzUzAAXkKnCsOmH8M5qc7AkBHE+mZuVIho3RwwgPnXlmJKYrfO2qknoN7bxpwtLT4sJeAG2zxyJ4SLwce9nUY/vvd+qoIbJ6as1vi3dvHEI4= Received: from DS0PR10MB7953.namprd10.prod.outlook.com (2603:10b6:8:1a1::22) by SJ0PR10MB4672.namprd10.prod.outlook.com (2603:10b6:a03:2af::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Wed, 30 Oct 2024 18:32:16 +0000 Received: from DS0PR10MB7953.namprd10.prod.outlook.com ([fe80::5b2d:d28c:8773:c84]) by DS0PR10MB7953.namprd10.prod.outlook.com ([fe80::5b2d:d28c:8773:c84%4]) with mapi id 15.20.8093.024; Wed, 30 Oct 2024 18:32:16 +0000 From: David Faust To: gcc-patches@gcc.gnu.org Cc: jose.marchesi@oracle.com, yonghong.song@linux.dev Subject: [PATCH 5/5] doc: document btf_type_tag and btf_decl_tag attributes Date: Wed, 30 Oct 2024 11:31:55 -0700 Message-ID: <20241030183155.2038501-6-david.faust@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241030183155.2038501-1-david.faust@oracle.com> References: <20241030183155.2038501-1-david.faust@oracle.com> X-ClientProxiedBy: MW4PR03CA0065.namprd03.prod.outlook.com (2603:10b6:303:b6::10) To DS0PR10MB7953.namprd10.prod.outlook.com (2603:10b6:8:1a1::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7953:EE_|SJ0PR10MB4672:EE_ X-MS-Office365-Filtering-Correlation-Id: f6d7a4be-561c-4f93-3683-08dcf9112e1e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024; X-Microsoft-Antispam-Message-Info: xE0qb+KiblHaiO9nDrj2SkUiRyBQycZEWEuqNB8aHX+2U34qKV/D+teWxT7qx6PxKz/mE2Azmdep9AwyyLNaQeWP2PVpFIncVwal+3VnE9ScXNLXrRtZJyaMPRiGiog6dWCWAzebikPS5N+kHQjjA9KeMqRjq0FYWxZHPhz1091NtLSbs9hmPjup3T9/fDfAIttebcfxPba3mU4Wqqmbpy7YTuW5cmx4NLkDbASWmHPpkgSPiZsUVJVsEs7rFKhj0CJ3SMKimnAW+TkoizE4HuEX6GWsO7T/Wf9tiIbhK//PeMjTnMV0y4HbUXKFXKIq5/2m5pGnFWcX/uEfFGVRSgC/bbVxhBymkGoMJK4ZFVjyc9XmXR2VSzqEcjtRkAu6I5LSw9skkFGAqelmuI3M+IeHUvViuw8SsKpOZgh3ujugD8gxXrA5Zew9Fr8e8AyJxur7aQrnZF8uP3krk8FqZuZtZXVRnEXLqtZTzJ4OqZAttlJCLOafCDXyO8d9Zhcih33UO3xM6FItm9K6ntyEpmVVstsgf502U0nk/Jyh8FXcuz1AIX04Ukk7v4mf2YJ2oMegZzhH66dQnPGW9aC05z3GlA7XfbxJ9lfHMkZ2Sg//7FiM4Fmrmh9LbzI4ok06XpgPzalNhM4gn9rg0Mr4hK8+QRIZ8Hy3p9yazlAANSPer+XtF9bGgZnyfpg37SXOOW038Gw9aBURAYGW7+DmknsBZowl+S9X20r9SWjCMIB01T9huN45MmZgW0u0rwhgG4rmdSwA3kC6BWxY4CEsPg9Eh2pLgwFaWD9x2cCKahrzBoGPoJVMl61HVCkAd3M1pfRnfAdprBXxj+Us3gjbTXtCFPXgO7hngjzIl3LCxxcv6X0KaknfGxxlMVwKEfGGY0QSDDm5+lCi5k5q3qdKd3IE1itVC2EPSXLw3N0T6ubaorF/PlN/C3CjCGO38bxd/Ml6macWYB8ZS9rViVh454dda7RU+C3+IppfNEB433mbKPMbvKRwWp5lZoDwIGFh/vYkrU2AK99TkExn3BQTHg3PHpmsRW6JGFMdomQ/guyFVeofIMesa5UMnjMOR7WDVkrgcxwYJtOGydxqnFrLInSX4KoFwtj/NmlQJPj9BkWLPjM+K5uOQ1W+vBz0ITYuTJgaAU0tQ/hxg+tE6wmkWUjX1Ct4xCo8ssPT4j7hF1SpxRyhkrSxJlv/rc1JluHeQ3POddRWB5NZZEFylXD6TYKn2qaSowhQir0bnvvs7v0/vcK7aOEN0iSeSmp96cVyH1U5q6/2hlgQgcfgxWN4vv+BcX7oLNaBnpBhaiv3Jhk= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR10MB7953.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tBbvPOOrM6uhI8KIYMDZP1aJuKushCzGo07IeZT4TEuOtbkDyEcclO3jXD3aa1iZMiOLPyrK1akSckp1X1ZKDV1YCKDU2ubX1d33Uzw/L6PMbdzBUw1pzR0QvrRZ+Oq5A6gHcotOUg6F8vE5gLWtZ/XT7ad+Ta2lE5bSACUlDUwvgJ5GyEm5XAtamx118SFaL8EFif1uiwyuyZ6gFAmZXvIUxoe67NAMkewKX4WegJTWEiNLEmUtO3ajABmfdWG7P0r+wWVxQw9kcw5DcpceqOxHsvIJdju85goeobb380D27zPwEHiDs+BWzcuQvUOoDpATHEm/gJs88BCqMC1bb6eLeFGT5V1wRbCYuzuE8xRlERaL6/wRkP03tcgPt8aTx0lELy8mUwtIYjiHjLmOVT/bLVgKziYTBIMIldwb6gRsj1PJDfc7pViggMDDuP2utOzFP/CDFaT4XPWssN1c8jmuJCKWPdmEaIFiAtN5dVfuCMr/1GrvQo/HyWzefQdFfKGYhPWZZzfQCnBTS4EGmmjv5Sw010j59ATTI9CE3nOs4PImN6WTRN+iODNvyYFeVEU+H/rU+isM78kdEHO0i7Qr8J1XQgY4u0BO8cPKkRu+48HWQsAhAXLsJGfim/A3hlOjX71eBkITyjLtNritxjcb9Q3fxy6f4vnnF1H1vQj38JpZUkS8hJhJsiebBpVPCAfFXBEC77gN5HqtsR7X3cCEpSSlQllf9o4LqdAKQ+i5wKDbtO3AiydOIPs+1HPZAeBK+5VBa0D/5FuKFgH1XfPu+YmtRS+YfsDjNMVJbh9KVKC8hIcfBm1j3aas4CeEO8ZAG3mIj/+ScERqRUG7xDOjNxA6r4N6hQfmDQq+rtdQra2zfqqeSrzwqedXFY5pT1oOB+YhSFr6YNQT0YbSF7Q+EpSs78prMADeBVplKlYIehV9/ZeU/egx0R5ckc+X9qdsEk6VxrSFs7q35CD6VcdOuehJDavNiB8wgvd44EG4TRsBv4qsPfbjIYBYBMFZTJkysyxIVa2fzQz3IcX/gDWeaCLjgp2cuXoeVoj6WazqaOqxZM9ewfGVC/QXrJPz16znkHeUDcO36NmG/aslzNUf3eWkg537WRzXmyn7j5m7lTSG4J0pl+ACZ18xqu5i8mJoL8VXblKPLz2+JqVqJH6A1kSYXtVsyOb/yLpN3tW6MNLFURl1kI9NT0zQN9ydOx4mpceAn2nowSbnU7JI+trIwnot/g6jfm8ISPMUlhZEurA36N2ru6JQVnYrr7S4YwfQi0lyHxIgiKlc8vjCiX2HOUoKH49MejUrrgt8VyrrJj91unIk/mT7g6kSkWUd7MueV2njjeXuTz4ZCgbrIB6Dt0wLpTK5+ZIU+G5PCYJ6elT1G/8jSkv3vh/nHwU2v7Nd+S8PXsl6jM5k0CW6GB9NGA/J9nB81uE/MeKee8fAa7joL15ZsYNsOJvcBIEdyuU0oF1v6EcA31wTO28YchaAYRCXc39WB9vsUldkN/p7LyX7KP/FWz9lqCWqqA3FNcA7oW0QylwcqAgbNI6ayzVr+VA18JohASctrm3uf8I3IUxswdnkLDoW5fktV+Ys9pTzGE0wV616ZgxXgR4AnA== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: dHVcBi2Ge2/n5Hzs+K61+46O6eziFSHJkEXIqFInLW1aTpku4rq2l8uq5lqXdlhiCfk40Z+ghhxQoTNTkPvEH30P9MHtzS9shLlIcMlE1ybpUcCwmoRJ8sB1gwROtnRa7WTSWQYnmay/zfDuNnsZWsMqJckckK/SbcctDDjqeoB+wxdZHwkk0+3FaeQk2bDKl9ohRVn2A7xmhLXjVJazJor90Q0fSK9ZIzp80DZ4ixDJqVeA9d9sB8cdda9g9pRTzdaiO7dUIfAZIuzhbfsqAwVEozTdZzTTkhU0g+9uWR/xlEQb+oSI5Q7FmRTL+X5nRYlIVimtT4Os561PHUdglPzyXgvToVHhoB+94HMPrqAAy5vZ3b7ITOg7p59+M5PKsDcuXU5nEfxCyIYcLHxq5kyxTRxOulkQbbFmnDp2OgQ9n31KZ/z3pb+RlOr/l/4kpJ+USsKCVrSw6NfUPvdxh9akb2QpgXESJqWbSUZAvwstWby0U5s/wJSfNGMD36nS6yKA9eBI/Ug/IoTQej/okAswAICZFkSn8jICzlAM8J14RZ9dMBANTz+LYHw2HJOUo9SHeuLzz4z/kguVij5Gxk2UmbpHgavujCut3vmeLAA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f6d7a4be-561c-4f93-3683-08dcf9112e1e X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7953.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2024 18:32:16.5805 (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: XsBT0QNUTfdawQWRZY4R83F/xKqfSo0jR1sJ10S2Ju4PA+TYnSl7RYUQ8ZDDVIBffdLDwKgVaI+e1DL24EsKgQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4672 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-30_14,2024-10-30_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 bulkscore=0 adultscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410300145 X-Proofpoint-ORIG-GUID: FA_5CoEPIQtzJxvw3e49mtTCXTIiPjUN X-Proofpoint-GUID: FA_5CoEPIQtzJxvw3e49mtTCXTIiPjUN X-Spam-Status: No, score=-13.8 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_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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/ * doc/extend.texi (Common Variable Attributes): Document new btf_decl_tag attribute. (Common Type Attributes): Document new btf_type_tag attribute. --- gcc/doc/extend.texi | 68 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 42bd567119d..fd8f2425947 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -7920,6 +7920,41 @@ align them on any target. The @code{aligned} attribute can also be used for functions (@pxref{Common Function Attributes}.) +@cindex @code{btf_decl_tag} variable attribute +@item btf_decl_tag (@var{argument}) +The @code{btf_decl_tag} attribute may be used to associate variable +declarations, struct or union member declarations, function +declarations, or function parameter declarations with arbitrary strings. +These strings are not interpreted by the compiler in any way, and have +no effect on code generation. Instead, these user-provided strings +are recorded in DWARF (via @code{DW_AT_GNU_annotation} and +@code{DW_TAG_GNU_annotation} extensions) and BTF information (via +@code{BTF_KIND_DECL_TAG} records), and associated to the attributed +declaration. If neither DWARF nor BTF information is generated, the +attribute has no effect. + +The argument is treated as an ordinary string in the source language +with no additional special rules. + +The attribute may be supplied multiple times for a single declaration, +in which case each distinct argument string will be recorded in a +separate DIE or BTF record, each associated to the declaration. For +a single declaration with multiple @code{btf_decl_tag} attributes, +the order of the @code{DW_TAG_GNU_annotation} DIEs produced is not +guaranteed to maintain the order of attributes in the source code. + +For example: + +@smallexample +int * foo __attribute__ ((btf_decl_tag ("__percpu"))); +@end smallexample + +@noindent +when compiled with @code{-gbtf} results in an additional +@code{BTF_KIND_DECL_TAG} BTF record to be emitted in the BTF info, +associating the string ``__rcu'' with the normal @code{BTF_KIND_VAR} +record for the variable ``foo''. + @cindex @code{counted_by} variable attribute @item counted_by (@var{count}) The @code{counted_by} attribute may be attached to the C99 flexible array @@ -9109,6 +9144,39 @@ is given by the product of arguments 1 and 2, and that @code{malloc_type}, like the standard C function @code{malloc}, returns an object whose size is given by argument 1 to the function. +@cindex @code{btf_type_tag} type attribute +@item btf_type_tag (@var{argument}) +The @code{btf_type_tag} attribute may be used to associate (to ``tag'') +particular types with arbitrary string annotations. These annotations +are recorded in debugging info by supported debug formats, currently +DWARF (via @code{DW_AT_GNU_annotation} and @code{DW_TAG_GNU_annotation} +extensions) and BTF (via @code{BTF_KIND_TYPE_TAG} records). These +annotation string are not interpreted by the compiler in any way, and +have no effect on code generation. If neither DWARF nor BTF +information is generated, the attribute has no effect. + +The argument is treated as an ordinary string in the source language +with no additional special rules. + +The attribute may be supplied multiple times for a single declaration, +in which case each distinct argument string will be recorded in a +separate DIE or BTF record, each associated to the type. For a single +type with multiple @code{btf_decl_tag} attributes, the order of the +@code{DW_TAG_GNU_annotation} DIEs produced is not guaranteed to +maintain the order of attributes in the source code. + +For example + +@smallexample +int * __attribute__ ((btf_type_tag ("__user"))) foo; +@end smallexample + +@noindent +associates the string ``__user'' to the pointer-to-integer type of +the declaration. This string will be recorded in DWARF and/or BTF +information associated with the appropriate pointer type DIE or +@code{BTF_KIND_PTR} record. + @cindex @code{copy} type attribute @item copy @itemx copy (@var{expression})