From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 083BDC77B73 for ; Tue, 2 May 2023 09:10:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233513AbjEBJKe (ORCPT ); Tue, 2 May 2023 05:10:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbjEBJKd (ORCPT ); Tue, 2 May 2023 05:10:33 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2246946BB for ; Tue, 2 May 2023 02:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=CPY4fAF1NZjAjeucATevCxKHj1LIrVSMd5eD+8azJYQ=; b=guntJDmRJoEHpfxoIgjnN/5sYG bR9mOKXguUw4wQ/gEIpVLT7k6hQB6V4KAsebzSKVBXQH7z5769GhUEUp2fKRazr5/2ZtNllw8zn0A cD/tayAh/6JFElFqeXdDnAL3NdkE/W6UKFU6AhQIVMYIeMqQM5CTNYxnwoAUBcIBWq3SPF7T1Ab89 UbGhdCGThqp29VD4T3/CUtKiDTi63evZx0LBgoo0Ma68UJHFVmVCWGya60vVj/6BsTtpjEAvrKtMY DvmIMqR3jCIjH9LAbvfAJK6LMAlr2PjvVU8rmebjZSGObyndnHzuv26kBeJ1CAg+oNxvHJ0Ry8RYN 4xljl03A==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ptm19-008AL6-AS; Tue, 02 May 2023 09:09:51 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9B63D3002BF; Tue, 2 May 2023 11:09:50 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 82C5823C5C34D; Tue, 2 May 2023 11:09:50 +0200 (CEST) Date: Tue, 2 May 2023 11:09:50 +0200 From: Peter Zijlstra To: Indu Bhagat Cc: linux-toolchains@vger.kernel.org, daandemeyer@meta.com, andrii@kernel.org, rostedt@goodmis.org, kris.van.hees@oracle.com, elena.zannoni@oracle.com, nick.alcock@oracle.com Subject: Re: [POC 3/5] sframe: add new SFrame library Message-ID: <20230502090950.GI1597476@hirez.programming.kicks-ass.net> References: <20230501200410.3973453-1-indu.bhagat@oracle.com> <20230501200410.3973453-4-indu.bhagat@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230501200410.3973453-4-indu.bhagat@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org On Mon, May 01, 2023 at 01:04:08PM -0700, Indu Bhagat wrote: > +struct sframe_header > +{ > + struct sframe_preamble preamble; > + /* Information about the arch (endianness) and ABI. */ > + uint8_t abi_arch; > + /* > + * Offset for the Frame Pointer (FP) from CFA may be fixed for some > + * ABIs (e.g, in AMD64 when -fno-omit-frame-pointer is used). When fixed, > + * this field specifies the fixed stack frame offset and the individual > + * FREs do not need to track it. When not fixed, it is set to > + * SFRAME_CFA_FIXED_FP_INVALID, and the individual FREs may provide > + * the applicable stack frame offset, if any. > + */ > + int8_t cfa_fixed_fp_offset; > + /* > + * Offset for the Return Address from CFA is fixed for some ABIs > + * (e.g., AMD64 has it as CFA-8). When fixed, the header specifies the > + * fixed stack frame offset and the individual FREs do not track it. When > + * not fixed, it is set to SFRAME_CFA_FIXED_RA_INVALID, and individual > + * FREs provide the applicable stack frame offset, if any. > + */ > + int8_t cfa_fixed_ra_offset; > + /* > + * Number of bytes making up the auxiliary header, if any. > + * Some ABI/arch, in the future, may use this space for extending the > + * information in SFrame header. Auxiliary header is contained in > + * bytes sequentially following the sframe_header. > + */ > + uint8_t auxhdr_len; > + /* Number of SFrame FDEs in this SFrame section. */ > + uint32_t num_fdes; > + /* Number of SFrame Frame Row Entries. */ > + uint32_t num_fres; > + /* Number of bytes in the SFrame Frame Row Entry section. */ > + uint32_t fre_len; > + /* Offset of SFrame Function Descriptor Entry section. */ > + uint32_t fdeoff; > + /* Offset of SFrame Frame Row Entry section. */ > + uint32_t freoff; > +} __packed; So I know there's people that hate hard on tail comments, but personally I can't read the above, something like: /* * Number of bytes making up the auxiliary header, if any. * Some ABI/arch, in the future, may use this space for extending the * information in SFrame header. Auxiliary header is contained in * bytes sequentially following the sframe_header. */ uint8_t auxhdr_len; uint32_t num_fdes; /* Number of SFrame FDEs in this SFrame section. */ uint32_t num_fres; /* Number of SFrame Frame Row Entries. */ uint32_t fre_len; /* Number of bytes in the SFrame Frame Row Entry section. */ uint32_t fdeoff; /* Offset of SFrame Function Descriptor Entry section. */ uint32_t freoff; /* Offset of SFrame Frame Row Entry section. */ Is far more readable (but yes, busts the line length a little). An alternative form might be: /* * @auxhdr_len: Number of bytes making up the auxiliary header, if any. * Some ABI/arch, in the future, may use this space for extending the * information in SFrame header. Auxiliary header is contained in * bytes sequentially following the sframe_header. * @num_fdes: Number of SFrame FDEs in this SFrame section. * @num_fres: Number of SFrame Frame Row Entries. * @fre_len: Number of bytes in the SFrame Frame Row Entry section. * @fdeoff: Offset of SFrame Function Descriptor Entry section. * @freoff: Offset of SFrame Frame Row Entry section. */ uint8_t auxhdr_len; uint32_t num_fdes; uint32_t num_fres; uint32_t fre_len; uint32_t fdeoff; uint32_t freoff;