From patchwork Thu Jun 29 23:53:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Indu Bhagat X-Patchwork-Id: 114492 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9988910vqr; Thu, 29 Jun 2023 16:54:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Jg02R3QqzSt0M28ytnor/3osIOXMPkYLvmkyV8w3jcBFuDUGgsjWcb4d9HTdnhdpcrRyJ X-Received: by 2002:a17:906:8388:b0:973:c070:1b5f with SMTP id p8-20020a170906838800b00973c0701b5fmr540427ejx.44.1688082858342; Thu, 29 Jun 2023 16:54:18 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id t23-20020a170906179700b00982930191b4si7832709eje.546.2023.06.29.16.54.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 16:54:18 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=W4zkidIb; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1579238582A4 for ; Thu, 29 Jun 2023 23:54:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1579238582A4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1688082852; bh=PTIvtIhfIl8927LjUYQT2pN+s5V/N9X1ZEbR0FbxmZA=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=W4zkidIbnvC/yUiKBi1JduLzqrHcgMKnApofwlWv55XdpT1tpkrhnJqZKA845rKKU xQ3nwFStsCwoT/51NxwGYJO/fMcSDc0JvXXjjz0FEovRRQIb1vppEX1PT2Zx858KzL rWBytsSEo04AEvSYMqA4UeNSZvXyJgYo0b4ha1KY= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 04D2F3858CD1 for ; Thu, 29 Jun 2023 23:54:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 04D2F3858CD1 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35TJ3p1b002881 for ; Thu, 29 Jun 2023 23:54:00 GMT Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rf40ecqfq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 29 Jun 2023 23:54:00 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 35TMflaN008611 for ; Thu, 29 Jun 2023 23:53:57 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2042.outbound.protection.outlook.com [104.47.57.42]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpx837h0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 29 Jun 2023 23:53:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mpJRItKwC+MQ26lg3miCGay0ojZCZ9pGGuGcBaF2yAyU88wiGVQd/1hp2O7gg8zN9wiknUUWMMZU07qMI67y3QCH0L952Cd4taO60O8M3KLVwbZls55S7dF1g3ts2dvDTw5W99v1itZ7akDtduLlkY62b52UREtUZspfCuiuCkudp85tz+ll1H8ss9FKQEiOl0CHU5UCeuVwMG1Lhg0zmqPG60EUJF/ERF6ZUQpG5xEV2hjct7mBulq6IJgRahLHFa3P6zzhaHVVNn9GknGSOzKvpdOS2YJlM11K6rrRMs8Slw5VQa4duiUEn0OoSLfnggQ+QvGwGdsitFvthKdWAw== 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=PTIvtIhfIl8927LjUYQT2pN+s5V/N9X1ZEbR0FbxmZA=; b=e7kkY+eQr5RMOaYxfzrTa8a73RJCVsdzMo2HDOWBH1pTXK9WYxbO1pwf//z7H9cmkEuHZ3xQJ2khL4KaYrddZ3tTdmKQX3Z+FRa39cuVa2KycBj1q4wTmowtEq/Zl9Lha2IJplkQI1VXM6zcTAo9VNTQhTb2voJwytf3OmvkXdNgsGJ2CNKsKeOvwo6kipCKBj+bOqVo3bTL7rkpiVfPw+cPK/47o0C1H76CGPMXb9x5W4DN2y1gkHrD4VMZM8V8voALOisP/cglD+aukinWOkrCoKwHjk9VPcX7jv5U4ByW2oE2W/G/7l9X7UNnMUXW16rgcVZb2Hxh/0geXhPY9g== 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 MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) by CY5PR10MB6165.namprd10.prod.outlook.com (2603:10b6:930:33::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Thu, 29 Jun 2023 23:53:40 +0000 Received: from MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::fdbb:b921:1ef:2d44]) by MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::fdbb:b921:1ef:2d44%4]) with mapi id 15.20.6521.026; Thu, 29 Jun 2023 23:53:40 +0000 To: binutils@sourceware.org Cc: Indu Bhagat Subject: [COMMITTED] doc: sframe: update specification for SFRAME_VERSION_2 Date: Thu, 29 Jun 2023 16:53:25 -0700 Message-Id: <20230629235326.1167898-3-indu.bhagat@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230629235326.1167898-1-indu.bhagat@oracle.com> References: <20230629235326.1167898-1-indu.bhagat@oracle.com> X-ClientProxiedBy: MW4PR03CA0097.namprd03.prod.outlook.com (2603:10b6:303:b7::12) To MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2158:EE_|CY5PR10MB6165:EE_ X-MS-Office365-Filtering-Correlation-Id: e15d579a-e266-4c83-27f6-08db78fc1072 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oio0KSAbkSoGDxkTbEnJjZWqW7hiHw1cu8hRJlEqSX8SffGjfodFsZRVyvcF9379z6CC+E1/WD1M53E/BuPipFjcKQH0E/A2ZR+Q3t5JXmmMhUMW33Jg68V+0lzCxbf0VRmEgXAGvRtj6cEfEUrfcxntCTycbsHn6L35ZJb/eKGiirIP+7VWo9pJp4X4dqzlWCOe30klymmNKm80scqorCS0fKtJYRIcqpnwECOppq/8pl5zfSdWqwHLAYwwQPwtu0WiAEsp7jVTYAn8uvFnx1g2xPhe8kT3aCPR8koW8CoDwUh03aL1UXegBuzj6hcdd3QqKLLUQtWgUgxmwMGr9Z1W/Ev8skb/v5wJw9S1M0p9304hr0C4sEpVgx/fu2AGJgYTFiIbaB7wOMSysuUXV+BrjTHVkBLj7nlRD7PltgPjiK7rrZ3KR+T7/p706VyrRhzGhXUcDU60CDrR8N2kU+PeXyZdQLp++py3XU4+fRqNIlT9bdGJDZsLCQ7bE5f92TLlh2dfX4esSOp4Jh/cu4y94vZXdDyabRJCWgS46MhaUvoGEf3WXo9RTuhXUnEo X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1001MB2158.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(376002)(136003)(366004)(346002)(396003)(39860400002)(451199021)(6512007)(6666004)(2906002)(186003)(6486002)(86362001)(107886003)(38100700002)(83380400001)(2616005)(26005)(6506007)(1076003)(41300700001)(478600001)(316002)(36756003)(66556008)(4326008)(66946007)(66476007)(6916009)(5660300002)(44832011)(8676002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MW00gsPYZvj6YpW6TGoD2ba8fYWqjg1+fB0AAvNLSepmB8GqfozPgPnOBiuJbE2eCpF2nHsaz5J3Y8MM7FLJhLhF0w0a0Pir9o9RiwZKF5khfuZq43XhYvpnsbpPIz0DtqIJAfVJ+cEwfEPWv2tlq2APH60f38lasOTeBtv1zGfDijNY3Y60iBfk4gnZMx423CDoxq7vidY2mXg4FYix4WxsodZMNpiI2i/RsgDEt3dfNHSFbl3Llrh7Py99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TnE4hG5qkezv47hUYBvpp3NBcqYbz4bpKXzst7mEIcVZJZY3FjxqlXIbLxTC/EDOQu+Da4A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e15d579a-e266-4c83-27f6-08db78fc1072 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2158.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2023 23:53:40.7733 (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: OTD2j+dMd528M2hLJ4jrJ/1lwbjDEtDRt+xxsT7O5taqdZm720480nSS/ilpko8WuyN/y2tOdOCm3lb6Jc60Hw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR10MB6165 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-29_10,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 malwarescore=0 suspectscore=0 spamscore=0 bulkscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306290217 X-Proofpoint-GUID: Ki5cfzsG3C4s5Goh0_kkCySMb9eusxw4 X-Proofpoint-ORIG-GUID: Ki5cfzsG3C4s5Goh0_kkCySMb9eusxw4 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Indu Bhagat via Binutils From: Indu Bhagat Reply-To: Indu Bhagat Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770083171303058660?= X-GMAIL-MSGID: =?utf-8?q?1770083171303058660?= Add details for the changes made from Version 1 to Version 2 of the format. Also add details about alignment in the SFrame format. A portion of the SFrame stack trace format has an unaligned on-disk representation. Add description at relevant points in the specificatin to clarify the alignment related details. --- libsframe/doc/sframe-spec.texi | 84 ++++++++++++++++++++++++++++++---- 1 file changed, 74 insertions(+), 10 deletions(-) diff --git a/libsframe/doc/sframe-spec.texi b/libsframe/doc/sframe-spec.texi index a37a6f91414..8a59aa76f52 100644 --- a/libsframe/doc/sframe-spec.texi +++ b/libsframe/doc/sframe-spec.texi @@ -20,7 +20,7 @@ License''. @titlepage @title The SFrame Format -@subtitle Version 1 +@subtitle Version 2 @author Indu Bhagat @page @@ -33,7 +33,7 @@ License''. @node Top @top The SFrame format -This manual describes version 1 of the SFrame file format. SFrame stands for +This manual describes version 2 of the SFrame file format. SFrame stands for Simple Frame format. SFrame format keeps track of the minimal necessary information needed for generating stack traces: @@ -50,17 +50,25 @@ The reason for existence of the SFrame format is to provide a simple, fast and low-overhead mechanism to generate stack traces. @menu -* Overview:: +* Introduction:: * SFrame section:: * Index:: @end menu @end ifnottex +@node Introduction +@chapter Introduction +@cindex Introduction + +@menu +* Overview:: +* Changes from Version 1 to Version 2:: +@end menu + @node Overview -@unnumbered Overview +@section Overview @cindex Overview -@tindex PT_GNU_SFRAME The SFrame stack trace information is provided in a loaded section, known as the @code{.sframe} section. When available, the @code{.sframe} section appears in @@ -69,6 +77,11 @@ a new segment of its own, PT_GNU_SFRAME. The SFrame format is currently supported only for select ABIs, namely, AMD64 and AAPCS64. +A portion of the SFrame format follows an unaligned on-disk representation. +Some data structures, however, (namely the SFrame header and the SFrame +function descriptor entry) have elements at their natural boundaries. All data +structures are packed, unless otherwise stated. + The contents of the SFrame section are stored in the target endianness, i.e., in the endianness of the system on which the section is targetted to be used. An SFrame section reader may use the magic number in the SFrame header to @@ -76,6 +89,11 @@ identify the endianness of the SFrame section. Addresses in this specification are expressed in bytes. +The rest of this specification describes the current version of the format, +@code{SFRAME_VERSION_2}, in detail. Additional sections outline the major +changes made to each previously published version of the SFrame stack trace +format. + The associated API to decode, probe and encode the SFrame section, provided via @code{libsframe}, is not accompanied here at this time. This will be added later. @@ -83,6 +101,26 @@ later. This document is intended to be in sync with the C code in @file{sframe.h}. Please report discrepancies between the two, if any. +@node Changes from Version 1 to Version 2 +@section Changes from Version 1 to Version 2 +@cindex Changes from Version 1 to Version 2 + +The following is a list of the changes made to the SFrame stack trace format +since Version 1 was published. + +@itemize @bullet +@item +SFrame Function Descriptor Entry encodes the size of the repetitive code +blocks, e.g., pltN entries for which an FDE of type SFRAME_FDE_TYPE_PCMASK is +used. +@item +SFrame Function Descriptor Entry includes an explicit padding of two bytes to +ensure natural alignment for its data members. +@item +The above two imply that each SFrame Function Descriptor Entry has a fixed size +of 20 bytes instead of its size of 17 bytes in SFrame format version 1. +@end itemize + @node SFrame section @chapter SFrame section @cindex SFrame section @@ -114,6 +152,8 @@ typedef struct sframe_preamble @} ATTRIBUTE_PACKED sframe_preamble; @end example +Every element of the SFrame preamble is naturally aligned. + All values are stored in the endianness of the target system for which the SFrame section is intended. Further details: @@ -160,13 +200,15 @@ The version of the SFrame format can be determined by inspecting @tindex SFRAME_VERSION_1 @cindex SFrame versions -@multitable {SFRAME_VERSION_1} {Number} {First version, under development.} +@multitable {SFRAME_VERSION_2} {Number} {Current version, under development.} @headitem Version @tab Number @tab Description @item @code{SFRAME_VERSION_1} -@tab 1 @tab First version, under development. +@tab 1 @tab First version, obsolete. +@item @code{SFRAME_VERSION_2} +@tab 2 @tab Current version, under development. @end multitable -This section documents @code{SFRAME_VERSION_1}. +This document describes @code{SFRAME_VERSION_2}. @node SFrame flags @subsection SFrame flags @@ -223,6 +265,8 @@ typedef struct sframe_header @} ATTRIBUTE_PACKED sframe_header; @end example +Every element of the SFrame header is naturally aligned. + The sub-section offsets, namely @code{sfh_fdeoff} and @code{sfh_freoff}, in the SFrame header are relative to the @emph{end} of the SFrame header; they are each an offset in bytes into the SFrame section where the SFrame FDE @@ -344,9 +388,13 @@ typedef struct sframe_func_desc_entry uint32_t sfde_func_start_fre_off; uint32_t sfde_func_num_fres; uint8_t sfde_func_info; + uint8_t sfde_func_rep_size; + uint16_t sfde_func_padding2; @} ATTRIBUTE_PACKED sframe_func_desc_entry; @end example +Every element of the SFrame function descriptor entry is naturally aligned. + @code{sfde_func_start_fre_off} is the offset to the first SFrame FRE for the function. This offset is relative to the @emph{end of the SFrame FDE} sub-section (unlike the offsets in the SFrame header, which are relative to the @@ -357,7 +405,7 @@ type and the FDE type for the function @xref{The SFrame FDE info word}. Following table describes each component of the SFrame FDE structure: -@multitable {Offset} {@code{uint32_t sfde_func_start_fre_off}} {The ABI/arch identifier. See above} +@multitable {Offset} {@code{uint32_t sfde_func_start_fre_off}} {Signed 32-bit integral field denoting the} @headitem Offset @tab Name @tab Description @item 0x00 @tab @code{int32_t sfde_func_start_address} @@ -381,7 +429,18 @@ used for the function. @item 0x10 @tab @code{uint8_t sfde_func_info} -@tab The SFrame FDE info word. @xref{The SFrame FDE info word}. +@tab Unsigned 8-bit integral field specifying the SFrame FDE info word. +@xref{The SFrame FDE info word}. + +@item 0x11 +@tab @code{uint8_t sfde_func_rep_size} +@tab Unsigned 8-bit integral field specifying the size of the repetitive code +block for which an SFrame FDE of type SFRAME_FDE_TYPE_PCMASK is used. For +example, in AMD64, the size of a pltN entry is 16 bytes. + +@item 0x12 +@tab @code{uint16_t sfde_func_padding2} +@tab Padding of 2 bytes. Currently unused bytes. @end multitable @@ -560,6 +619,11 @@ typedef struct sframe_frame_row_entry_addr4 @} ATTRIBUTE_PACKED sframe_frame_row_entry_addr4; @end example +For ensuring compactness, SFrame frame row entries are stored unaligned on +disk. Appropriate mechanisms need to be employed, as necessary, by the +serializing and deserializing entities, if unaligned accesses need to be +avoided. + @code{sfre_start_address} is an unsigned 8-bit/16-bit/32-bit integral field identifies the start address of the range of program counters, for which the SFrame FRE applies. The value encoded in the @code{sfre_start_address} field