From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 5AA7C3858C27 for ; Fri, 1 Apr 2022 19:43:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5AA7C3858C27 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 231FvH4Z018522; Fri, 1 Apr 2022 19:42:58 GMT Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com with ESMTP id 3f1se0qw75-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 01 Apr 2022 19:42:58 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 231JfOxX037397; Fri, 1 Apr 2022 19:42:57 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2105.outbound.protection.outlook.com [104.47.55.105]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3f1s96afng-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 01 Apr 2022 19:42:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j3Qo5lKTUGiePtOfnacLzH7O0PE0Kb+narwNkOJV6VCcXZ/zEy0utzQtIjfbvb1GSMwgDRJKSo2MSJ1hIGYq4s6K+aSrtPYM5V1PLxawpI57ILVGzZCNHS47b2Yg5uRaziVCeVMfedYLDAgYOUSuCac2lm+tFMTZ7Cdd/hxUw/RxikViikytXqRXLVpegVNFMHgDvicyDZvqp9cAfD8uX1sPjICd0mYcMBYCU24X0foKHqWcXDnu21fLQcdxNJruvTfofWf75z5ik1g+QDQfqRn1/khOvKcwuaJsGh3teFVQO70O22pzIyBE5tQCLh53WkHkbUavIMeKWFbyZ1uPhg== 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=WH1qgAUvsBIe2qwz1jQtuyebzz+oAFJdhyaMcQIQyos=; b=BTPqLZcvSk5sfbKLDZD177+TKfdSfyLZJHzPg7XXzitF4LsFkRqzCoFzu0ZXl2ux45pGcXo9JvEuyjrL16n62NwsTWX/kZEUPmWrggeQI9Yw7ooT2NkCks5ldhv3bZMHKH/bEd1+LUcPIufiCovXIEYf90U+DxNQXLDAxiFKC7+tKsfKHeUaavIPlLS6kYOKbo6u9pxJZpLGpBN1fp6o+qaWcEUwU3EDQrPgum1tmU25qwrRITsr+AYmQjvlrlHUo0xrX+ZG6eoTLz4F7PQqK1yx4goyfWxIv0SqvuR8WAtMFJFrbVsVplu73e9XpCQayGKNSUNDtvsJ4Ico8TnyVg== 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 Received: from MN2PR10MB3213.namprd10.prod.outlook.com (2603:10b6:208:131::33) by MWHPR1001MB2286.namprd10.prod.outlook.com (2603:10b6:301:2d::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.19; Fri, 1 Apr 2022 19:42:56 +0000 Received: from MN2PR10MB3213.namprd10.prod.outlook.com ([fe80::705e:a465:c30b:fec6]) by MN2PR10MB3213.namprd10.prod.outlook.com ([fe80::705e:a465:c30b:fec6%6]) with mapi id 15.20.5123.021; Fri, 1 Apr 2022 19:42:56 +0000 From: David Faust To: gcc-patches@gcc.gnu.org Cc: yhs@fb.com, jose.marchesi@oracle.com Subject: [PATCH 2/8] include: Add BTF tag defines to dwarf2 and btf Date: Fri, 1 Apr 2022 12:42:10 -0700 Message-Id: <20220401194216.16469-3-david.faust@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220401194216.16469-1-david.faust@oracle.com> References: <20220401194216.16469-1-david.faust@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: DM6PR03CA0052.namprd03.prod.outlook.com (2603:10b6:5:100::29) To MN2PR10MB3213.namprd10.prod.outlook.com (2603:10b6:208:131::33) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bbcb558e-eaec-4392-3776-08da1417d1b6 X-MS-TrafficTypeDiagnostic: MWHPR1001MB2286:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mP8imIuSp3DAYrPlAK8M9NjQ89GEpX05snTniMvU1kAAFlH5n0We9wVP25Q09EuT47sy7Ep+lJV4FV70roATh4PElCN0gnXxJdInYxMYPMA/r6NcgaN3hcXFZiKMLOx6LkAnCoTkrazlqzbNHECsiy+THgrIsPD6GdPAxeDEQzklwv0BzuTRLLQCyoMJq6h90UFiHJQeudoFUL6xFaM2HdpMVkA0e8ZV+7vlrHGRZowscLpjrqGMJtLiaf+/Dh2YwElr3GZ2eyt/CNH2dcD23vpf1IeSTGDV2U7IY0ACQ5o9vMWPQVElN3NZEDk7gVW/Fy5gVJdmu38VGcTmG4Dh57ArJH1P+s+eR5+v4g0HgMno6uC/gitDqUfoD3j1OAigQWezjIk0APR8DB9tBvZfhkjqx09RcSQkP+Iwa+ciVxNrLCbKH6VTBwe4uMoewCt29YMfmTTK9Df09cGMlC8B1TZjOKus064HlQMvFlWnQXTWklJZbZV1DTIHQL5i0mrCCufEYu9Xeef0TbhB6RxUdWOpOngJuHPhYMeDQ9gOdpvEbxqTmazMXUgTU5Ouxag7E9m9LOpZvpIPFQVxEr4e0577TkkIFpSZyInUIlqzTwvP961AK6eZR2PxjsaOof1bKJVm0F1FLa3OHTX3hgcX7Zd8ONdMwdBVnRniGjmsP1vhiwCSQbJR99g4OUESBflbgSCHevISCvfnsSb0E6yAgvKWqmaluQNjmyYBEPCpAY0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR10MB3213.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(66946007)(6916009)(316002)(36756003)(66556008)(5660300002)(66476007)(508600001)(38100700002)(86362001)(6666004)(8676002)(44832011)(4326008)(8936002)(966005)(6486002)(6512007)(107886003)(52116002)(2906002)(6506007)(2616005)(83380400001)(186003)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?WR9exvqlLNi0E+zXgSh1HdMeFvqJ/Hq0ljh4O/8sC4x0MiMWWoHU500TTWm7?= =?us-ascii?Q?xsl9O6n29OkKaBveMmj0kNNCcai3uAI/a7p7aI4g1+v/89jhNbPADOplajox?= =?us-ascii?Q?amT6s3CSSqt9DM84PetnN3g0dvu9F+OaIMsK7FSDC0aAP8xDoPG8msJyyy1d?= =?us-ascii?Q?VgmHecvFYc75zvVpgBphDfnvqkP9dp/CDa2KrUOnvu273OLnNMsLLbX2mUiB?= =?us-ascii?Q?AXGgPvKLnuwH5+FVQJmA/jJzAl+M3tB8xxXAjsQ9iC+vqwp7MxAGSUCHTLqd?= =?us-ascii?Q?CMxmLHuVKZ4G6KH4iLseTg8gnouC0+BtL+Ce9tNNWNV+JSpweK1Cf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Fjxw5VPRM3yNn8qhz8rsePu8A7Hmh5LxW?= =?us-ascii?Q?KCI1xY+3UIKNHjGjTZ8DhdkSHUMswWZP/hgMQ72cnTiPgErcP+vXVid1yauV?= =?us-ascii?Q?aRPfUc7a5Y13rrQxy++A/RyF13uxXgexoHwXi8wFYnGYwcSeO7UThD/raDsN?= =?us-ascii?Q?mMGXCl0d7Zx8/Cqa987TLuOKrkuqG6dfr+4c9vjczgF6HllPNdExl6KdJVtE?= =?us-ascii?Q?fFGSSzTAI8foSmSVkcpmBLgPBIbv6aH/4drMFmxJ0rIa74I7AroRzr+Ac4XX?= =?us-ascii?Q?tVNXJ6pYHh1v3+yoIiHtwgK1PqZF/pSc/2u0RjIAaQwqPPGK9Woa/kkKg7D6?= =?us-ascii?Q?BHoPvBk9do732CKsqR9JWWSbIuDzdgYwOr12/m94bslTHTaa94Zv4aPkR1Nx?= =?us-ascii?Q?TJf46PIXnOsEyvcxr5SS6r1YGB432nSLAy1+kNnoPPQQ7sEEJ/31i5rztSfy?= =?us-ascii?Q?YmW7zEUQbHYw05ki8lspt/GVcmmSrJC7/Yo8AGv/PgCeFaSnGsqYnvx8Nhgc?= =?us-ascii?Q?JLQA0cLWkL4iXdt0NXOAdyGgZXc+PQspC554eHg+xRvezdEX/feI?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: bbcb558e-eaec-4392-3776-08da1417d1b6 X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB3213.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2022 19:42:56.2935 (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: t2drtDtVZBSFTY9jDZ+2yBdZpIkcXdnc/UFppdiDdMNMCBRWga96+Ov4CUPJgH2NLRKDi1O/o108C6+a8FIfQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1001MB2286 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425, 18.0.850 definitions=2022-04-01_05:2022-03-30, 2022-04-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxlogscore=825 phishscore=0 malwarescore=0 bulkscore=0 suspectscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204010093 X-Proofpoint-ORIG-GUID: ld7sm3nOeL3Ub0L61qlFWpdeB4x98za6 X-Proofpoint-GUID: ld7sm3nOeL3Ub0L61qlFWpdeB4x98za6 X-Spam-Status: No, score=-13.2 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_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2022 19:43:03 -0000 include/ * btf.h: Add BTF_KIND_DECL_TAG and BTF_KIND_TYPE_TAG defines. Update comments. (struct btf_decl_tag): New. * dwarf2.def: Add new DWARF extension DW_TAG_GNU_annotation. --- include/btf.h | 17 +++++++++++++++-- include/dwarf2.def | 4 ++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/include/btf.h b/include/btf.h index 78b551ced23..37deaef8b48 100644 --- a/include/btf.h +++ b/include/btf.h @@ -69,7 +69,7 @@ struct btf_type /* SIZE is used by INT, ENUM, STRUCT, UNION, DATASEC kinds. TYPE is used by PTR, TYPEDEF, VOLATILE, CONST, RESTRICT, FUNC, - FUNC_PROTO and VAR kinds. */ + FUNC_PROTO, VAR and DECL_TAG kinds. */ union { uint32_t size; /* Size of the entire type, in bytes. */ @@ -109,7 +109,9 @@ struct btf_type #define BTF_KIND_VAR 14 /* Variable. */ #define BTF_KIND_DATASEC 15 /* Section such as .bss or .data. */ #define BTF_KIND_FLOAT 16 /* Floating point. */ -#define BTF_KIND_MAX BTF_KIND_FLOAT +#define BTF_KIND_DECL_TAG 17 /* Decl Tag. */ +#define BTF_KIND_TYPE_TAG 18 /* Type Tag. */ +#define BTF_KIND_MAX BTF_KIND_TYPE_TAG #define NR_BTF_KINDS (BTF_KIND_MAX + 1) /* For some BTF_KINDs, struct btf_type is immediately followed by @@ -190,6 +192,17 @@ struct btf_var_secinfo uint32_t size; /* Size (in bytes) of variable. */ }; +/* BTF_KIND_DECL_TAG is followed by a single struct btf_decl_tag, which + describes the tag location: + - If component_idx == -1, then the tag is applied to a struct, union, + variable or function. + - Otherwise it is applied to a struct/union member or function argument + with the given given index numbered 0..vlen-1. */ +struct btf_decl_tag +{ + int32_t component_idx; +}; + #ifdef __cplusplus } #endif diff --git a/include/dwarf2.def b/include/dwarf2.def index 4214c80907a..e054890130a 100644 --- a/include/dwarf2.def +++ b/include/dwarf2.def @@ -174,6 +174,10 @@ DW_TAG (DW_TAG_GNU_formal_parameter_pack, 0x4108) are properly part of DWARF 5. */ DW_TAG (DW_TAG_GNU_call_site, 0x4109) DW_TAG (DW_TAG_GNU_call_site_parameter, 0x410a) + +/* Extension for BTF annotations. */ +DW_TAG (DW_TAG_GNU_annotation, 0x6000) + /* Extensions for UPC. See: http://dwarfstd.org/doc/DWARF4.pdf. */ DW_TAG (DW_TAG_upc_shared_type, 0x8765) DW_TAG (DW_TAG_upc_strict_type, 0x8766) -- 2.35.1