From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id F01493858D1E for ; Sat, 1 Oct 2022 00:15:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F01493858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28UM45Yu023538; Sat, 1 Oct 2022 00:15:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=djLvpxYrMHfpx/TzAGZtzdvk3fUdqQQCXERB4YKKIfA=; b=QGBFt84mgpqnijxBodCcdQp8ALRi4ujAn02ikEqZ/hRwow1IAudIhYT36PLv3BKuTXJN 3UFo0vhMeBMywn9gkg+fg7p7o4ZWTVEOLKZ69aaJ1tZaihjEtuDI3/BymwB3+9kW8Kza U2vM2bjSpCi2g8CqaEbz3N60nCAsL9aPJM5QvfZaWxA7cFU4hDLy0/huZMUj1G2yeUIg uj/EhztL1BOGi2RMPj8ScWAentFkmZ92bjDr8sGj6fY2mXiYQYkhaQ6Y4k9yyE9EJ+mf awgEnftvZaAJj4DUSYVjx0B9faCPWtydP/AK45yr53SNK5q99THbAbFDRkwyJ9KDhTDd ug== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jssrws3np-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 01 Oct 2022 00:15:21 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28UMSBHO004948; Sat, 1 Oct 2022 00:15:20 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jtps9ju0g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 01 Oct 2022 00:15:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fKsdDIkQiCU9xDkXZA6xQzWzSfHsQ1LzvNTDyB/k/7WebXvy5KbPJPsbXdZcF2rIxo+TJWR52E86xn72UQKtImWOJ9jNMJ3+taHzGLQxX/m/LUTPM6RcZX5/cIXloi4odXnOYl7RUJ9MuLRz5wbHInck7fY6Vh2m43bWipWPlRuFSC5Jc3qmseb+pkUZtOneoM63prHCbCtuN/Zd645R+7zqY4Zb/85nLUxtiw1vnCmgw9xnG0jxMX87G1SdA9KADFQBTpIug43Cie8L4sec1PHwkxx3BhKqc567sLjeH0oBT5MaHIBONKAk9IiIuBflaBALmSKltuQnqf1orVBK4g== 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=djLvpxYrMHfpx/TzAGZtzdvk3fUdqQQCXERB4YKKIfA=; b=LC2Q1TYKQ698xIMp9eUT8V7RAxq41YnuOxGAxVf3lHeqoDIYldA2RARECKG0vI75x/LDhdTTduOECGfxRQzg4iQu9Hj+P9i/An4egrYTk49eybl5hn0qmFcFEDKaB8v0mXTGkiRDdlXxzAEKRyBpqospPYzFimWip/5zSB676wwPgxY5M5JNk6wFMUl0TWxGrnD/5y3WWfW5aoPxdQ7qpjzc/gAlPT7CP3pWZa/oApEKpk+31Trfhv5bCKNBjguJJDvdTz43MZ9N7oLzySs8huwO++BEeFMvkrP0hyGNcZnCNKhXLF1GLH26JgBSljDyAtRmREav5k2/91bUaK/MVw== 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=djLvpxYrMHfpx/TzAGZtzdvk3fUdqQQCXERB4YKKIfA=; b=iu7Pn8ctPAPPS6v3qn4CpkY46dtwjFk8kG+RIXrW9wPw7kxAfvwgpgm2m05yTstfV32ALc1cy+0P6qEsaNDuQcKuJ1KXC50j8P08kgZJ9/v6lREsrnee76uyF00XTTNWLpzZmBvJeeFP2IHXyQcjL6JG9wk+jqJyUjc00kPcHUI= Received: from MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) by SN7PR10MB6547.namprd10.prod.outlook.com (2603:10b6:806:2aa::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.20; Sat, 1 Oct 2022 00:15:18 +0000 Received: from MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::80a7:f7f3:4303:54e4]) by MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::80a7:f7f3:4303:54e4%5]) with mapi id 15.20.5676.017; Sat, 1 Oct 2022 00:15:18 +0000 Message-ID: Date: Fri, 30 Sep 2022 17:15:15 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH,V1 00/14] Definition and support for SFrame unwind format Content-Language: en-US To: Fangrui Song Cc: binutils@sourceware.org References: <20220930000440.1672106-1-indu.bhagat@oracle.com> <20220930082414.2irpxfedprm6xdsj@gmail.com> From: Indu Bhagat In-Reply-To: <20220930082414.2irpxfedprm6xdsj@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: MW4P221CA0021.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::26) To MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2158:EE_|SN7PR10MB6547:EE_ X-MS-Office365-Filtering-Correlation-Id: 81ed76f4-73df-4134-5271-08daa342054d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jU2wCHvp6aKAS6RPpbcNjQO67ShES2dchrHTmUzSikxCjZxd87SKS3upvYr/m2tSvmP2+jDLJuGin/3DQ8TfM6UChzBz7oSV9N+XsaB66wTuBCEDNdjJ7clVamGUWHpReJ3zMMPuRvbVwHNiwtcjOEWGhk3Zyt+2pMdic5idJLSb0W1HO9CDquWQt5aJONVyu0nujMSIEY1ruLZZ8XqZU5ydognvIXk5eUmoXMPsYq576Yul/M/RAAJr86CJRs8NjgD6Z0neuzLAaxPz9OpCA5D4AbiBhxbxFNX3WGTpFXv4iyqnxqwNERs08zj9/Ate+mjRZ3XwQhxQNUkp8bVynEX1+U/IA7Q12FfBhgdNpXxCw3D0jANGO7a2OcvTTOWcFI1btVlhjBovLrEYqmMzy/KYGWz0sNYhxrJ08Y8M/EA4OyqQkGsB7jrwgBwDVY69RCVyT/tMIcDYUHd/TfX73mSk0e1yDFb9J+6sjKAl+NctT+gIbYVYFbbyiBSsP7IGYF4Hcyya4NNF5XiLojJGzgsg7BIIkzOm6zCdM9StuKCUS5mJNBKYTOw9SeybuL8MK5cnrU5ZexOoQv54wCUolWXhK7FonFHwMZsCc3I0wRe6uTcQ2+bcw4dhi++5IL6vWHJc9z020QM1SgveS1B19tNYqLDLhja+26s48eJFGyFHBcX3sK2mhGD6VN8+9E88YHAywqHFmBY7dYEmBUwmN35QQKU4PqQQpPaYlwGcRc2ONteoB7kx+2fqyLuKdSnQ1XhKifvdiCfEpEO5jKeKez2crkOCh0qTblUBk1C9Z/M4S8ct3MLAAyXfYImegTf/ 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:(13230022)(376002)(396003)(136003)(39860400002)(366004)(346002)(451199015)(66899015)(31686004)(66946007)(66476007)(66556008)(8676002)(4326008)(316002)(6666004)(6512007)(6506007)(478600001)(83380400001)(41300700001)(26005)(36756003)(53546011)(6916009)(2906002)(38100700002)(5660300002)(44832011)(6486002)(86362001)(31696002)(2616005)(186003)(8936002)(781001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SDVsVzQzMU5GT3VvZnhIdGJGSlc2Y2FXSTlobWQzV3N6dTJSeGprWWNHbjJX?= =?utf-8?B?WG05aEg2VFVVbE9VczlZVUh2OVk5Y1RmcXZTbnpOM1B6MmtxY0pGNFdSdTBZ?= =?utf-8?B?OEp3UmNlZ0gwZ2ZZYmxuQzIyd21IbXlqREZwOENRL2JSWVpBU2NOcGc5S3A5?= =?utf-8?B?ajJjSTFIaXhxK0tvVnhLVFdvbmNKTlkxelJjV2RybHJBMlYvQnJyeGhBZHhh?= =?utf-8?B?blhacHRVekJocE50c3pKTndxRG9BY2NUeEN2OEJnM0kvczRRbm4xeHJ3VWxu?= =?utf-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E1tYWJZTENnZnhS?= =?utf-8?Q?tnc9uLfVn4IWHpcI4lMk3SaAQ?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81ed76f4-73df-4134-5271-08daa342054d X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2158.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Oct 2022 00:15:18.0187 (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: fxpY9Y9rZvgd30UEM+RXOdx49VP+fgeZNbX3vU6cQVJjOC9fYifobe4BS/U4yaT4z+jCktIyXe51Q7Ut3/bSpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR10MB6547 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-30_05,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 suspectscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209300151 X-Proofpoint-ORIG-GUID: gpbACIC14TZfR5h7_lTs8zijnwrjnIWn X-Proofpoint-GUID: gpbACIC14TZfR5h7_lTs8zijnwrjnIWn X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,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 List-Id: On 9/30/22 01:24, Fangrui Song wrote: > On 2022-09-29, Indu Bhagat via Binutils wrote: >> What is SFrame format and why do we need it >> ------------------------------------------- >> SFrame format is the Simple Frame format.  It can be used to represent >> the >> minimal necessary information for backtracing.  As such, it only >> encodes how to >> recover the CFA (based on SP/FP) and the return address (RA) for all >> instructions of a program. >> >> The format is supported on AMD64 and AARCH64 ABIs only.  The >> information stored >> in the .sframe section is a subset of what .eh_frame can convey: >> .eh_frame can >> convey how to resurrect all callee-saved registers, if need be; but >> .sframe >> does not. >> >> SFrame format is intended for usecases where fast virtual stack unwind is >> needed, along with a need for a small simple unwinder. So, those >> applications >> which struggle with the following two complaints will want to consider >> SFrame >> format: >>  - EH Frame based unwinders are complex and slow to manage with >>  - EH Frame based unwinders are large as they need to deal with DWARF >>  opcodes via a stack machine implementation >> >> More details about the format are available in include/sframe.h, >> please see >> commit "sframe.h: Add SFrame format definition". >> >> Our not-so-exhaustive experiments (basically binutils programs built with >> -Wa,--gsframe) show that SFrame/EH Frame section ratio to be an >> average of 0.8x >> for x86_64 and 0.7x for aarch64. > > For an executable with 1000KiB .eh_frame, .sframe takes 800KiB? > Does SFrame has something similar to .eh_frame_hdr and what is the size > comparison? The saving isn't apealing in my view. > Small correction - For an executable with 1000KiB of .eh_frame+.eh_frame_hdr sections, .sframe takes 800KiB. Yes, SFrame has something similar to .eh_frame_hdr. The SFrame FDE (Function Descriptor Entries) are sorted on start PC by the linker before writing out the .sframe section. Re: size comparison of the index in SFrame vs .eh_frame_hdr - The size numbers I quote is the ratio of .sframe/(.eh_frame + .eh_frame_hdr) size for binutils programs. As SFrame FDEs contain more information than the individual entry in the .eh_frame_hdr, I don't know if this comparison will fetch us much insight. Re : space saving appeal - SFrame's "reason for existence" is to allow fast unwinding while using a simple unwinder. The stack offsets, for example, are encoded directly rather than being calculated at the time of backtracing. Such a representation will need more space when compared to the opcode-based encoding in EH Frame format in isolation. That said, there might be some more optimization opportunities to explore for reducing the size of SFrame further. > Have you tried removing callee-saved register information from > .eh_frame? > I haven't tried this yet. BTW, other folks also were curious about this at Cauldron. This keeps getting pushed lower on my task list, however, because the outcome of the experiment does not change the fact that there are applications where fast, plain vanilla backtracing is needed using a simple backtracer. Such a comparison can be informative though, I see that. > Has SFrame be compared with macOS compact unwind descriptors, Windows > ARM64 exception handling, MIPS compact exception tables (their .eh_frame > counterpart, not the .gcc_except_table counterpart)? I havent looked at them closely enough to offer a meaningful comparison at this time. I will take a second look. Thanks