From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by sourceware.org (Postfix) with ESMTPS id 57CF0385C33A for ; Fri, 30 Sep 2022 08:24:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 57CF0385C33A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=maskray.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f171.google.com with SMTP id y136so3637871pfb.3 for ; Fri, 30 Sep 2022 01:24:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=l1cH6pfkQmJG0Mp8b/Wy2hRv1av8nusXlWOUD2+r9sw=; b=YrR8N89VcsDGcNYuMeGutaqAnLSKotpsXjfXL43c4sTg0XRLndgtRyKHj4Q98V8cmA A3yhfSCjAYGXpjyNU94fEDBipJG7Wt75Ryb+4sm130uyAWOJKSSa9DhN25HTXeAOd5/g y3EBEN0ju3VRoq1x3BjGKTTueamy5u5rKj85M1tuiPHopcqnb9Pp9/sBjdcW8CFwfNF9 WwwMhXqph4rHgBPLt6PEY+YrnCHQCB48z3XxnLblkqNHWdIl6f5a/jItSpARDbQ2fe6d mYN3S1BJpNHjHNY4D2HlQZVfX9hXE71C3hx14SZjMCgpQeZqWp0BRlgLuq3kVi7ucL7U xd7g== X-Gm-Message-State: ACrzQf0zDX+qlIbE7RPSxbVuNTmDS0yEJd95kQNYYaQN1U0TZyyGtiqA Vbv9rHd/St5kPVbBdYgAUrf2gLNE5lc= X-Google-Smtp-Source: AMsMyM6Z31mDjppG3RvihfEX1tuS2t/qKM7hd6zcTO8Nax1eJ4ln/BT+NCl1F6Drj0RgwI7v97t3gQ== X-Received: by 2002:a05:6a00:d4b:b0:53f:4690:d31 with SMTP id n11-20020a056a000d4b00b0053f46900d31mr7781409pfv.73.1664526256237; Fri, 30 Sep 2022 01:24:16 -0700 (PDT) Received: from localhost ([2601:647:6300:b760:b18e:cefa:e5a3:81da]) by smtp.gmail.com with ESMTPSA id d22-20020aa797b6000000b0053ea3d2ecd6sm1168041pfq.94.2022.09.30.01.24.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 01:24:15 -0700 (PDT) Date: Fri, 30 Sep 2022 01:24:14 -0700 From: Fangrui Song To: Indu Bhagat Cc: binutils@sourceware.org Subject: Re: [PATCH,V1 00/14] Definition and support for SFrame unwind format Message-ID: <20220930082414.2irpxfedprm6xdsj@gmail.com> References: <20220930000440.1672106-1-indu.bhagat@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20220930000440.1672106-1-indu.bhagat@oracle.com> X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_INFOUSMEBIZ,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 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. Have you tried removing callee-saved register information from .eh_frame? 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)?