From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B6F8249E2 for ; Wed, 11 Oct 2023 22:14:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c61g5YNW" Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 001BB91 for ; Wed, 11 Oct 2023 15:14:43 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-50305abe5f0so503397e87.2 for ; Wed, 11 Oct 2023 15:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697062482; x=1697667282; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:cc:to:from:subject:message-id:from:to :cc:subject:date:message-id:reply-to; bh=c4Hw2QjF7uomNkpyrrQrJqUZ8qfvURzS1mbxQaF4shg=; b=c61g5YNW2uT+x8pGfmMucfnnpZ62Tycta5Fd23AaaYn38jkjtDNgqQ53tuZo/PQp1y M4d0deNLwjUaArVRD/G2Wis1a891SePVKLwVbUq3U6vlfaRzTZvJW655Lyi335/rcy/e 4J0Gh7B7OHW23Ha1RTdrr1k/5O8jlazf/Rnz3KWW/dNrkerAIfCPz7uB1l5Qi53bk+MP 03KJFrfpvGpNO6Sev3oC7Tg2ubwdUW7FUd46eHVx5AE0GR97y7xNV3EhMcZpxT6rrodJ y+C30KJRfGrjIlDWKtVd3B2qrdPMTQRx3rAaGrEEtSBKzs81QhYD7TInmuMpE7r4Ijlg o5KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697062482; x=1697667282; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=c4Hw2QjF7uomNkpyrrQrJqUZ8qfvURzS1mbxQaF4shg=; b=Q9TDc7Epu43NcDnbhmOHEpMZPlCITyWPPqeL8/F25VpebKEvfbzLR182ggx3ATKGXh VjkDmdjPv5f2CQKt0xZ1ldXAzGfWtLqfZmbXu8JGIrp0jTU+XVSvVAo3BbqEUZL6LJ2z EXaocBXirMmNDIt7Rrilc7kgZSM0TDuNL/9fgSKEogL4KVb02eOHTGBPj6BgC59DNbAN MdTSLj+nmrxXuxwnzJENHtrBquCG3fhPbRm+fd3gtmXfFIe3npArecNH1fZl3dZf5WIc u+XPEf/UCIrNdDU6STy0Pby3xXMRyVq1VeijBYyGVxaCI1F3CegvGPcUoTWcapRbz2re J2LQ== X-Gm-Message-State: AOJu0Yycu7jvexY1MvIF9+UKPZW4vIwhDN0rboufsv0Sy4UA9Vs7ND9h YOyarodipyi3Nu7XR3Oei94= X-Google-Smtp-Source: AGHT+IHCRD9ruioFugW2RZ04J8Cpf1HfoFrozRoKLuUY570DyI44OFPxieu9u116aNx+Ts/xIq89GQ== X-Received: by 2002:a05:6512:3f18:b0:503:35bb:1e74 with SMTP id y24-20020a0565123f1800b0050335bb1e74mr18592606lfa.61.1697062481927; Wed, 11 Oct 2023 15:14:41 -0700 (PDT) Received: from [192.168.1.95] (host-176-36-0-241.b024.la.net.ua. [176.36.0.241]) by smtp.gmail.com with ESMTPSA id p9-20020a2e7409000000b002bfe8537f37sm3172561ljc.33.2023.10.11.15.14.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 15:14:41 -0700 (PDT) Message-ID: <07a9eb9eaa6cd424ac5025f76ea620eae6062c54.camel@gmail.com> Subject: Re: [RFC dwarves 3/4] pahole: add --btf_features=feature1[,feature2...] support From: Eduard Zingerman To: Alan Maguire , acme@kernel.org, andrii.nakryiko@gmail.com Cc: jolsa@kernel.org, ast@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, mykolal@fb.com, bpf@vger.kernel.org, Andrii Nakryiko Date: Thu, 12 Oct 2023 01:14:39 +0300 In-Reply-To: <7b4ff1c8-f8c7-b96e-c581-f27a389379f0@oracle.com> References: <20231011091732.93254-1-alan.maguire@oracle.com> <20231011091732.93254-4-alan.maguire@oracle.com> <5b40ffbfa5949c24dad44ed6adf70d35cf72f757.camel@gmail.com> <7b4ff1c8-f8c7-b96e-c581-f27a389379f0@oracle.com> Autocrypt: addr=eddyz87@gmail.com; prefer-encrypt=mutual; keydata=mQGNBGKNNQEBDACwcUNXZOGTzn4rr7Sd18SA5Wv0Wna/ONE0ZwZEx+sIjyGrPOIhR14/DsOr3ZJer9UJ/WAJwbxOBj6E5Y2iF7grehljNbLr/jMjzPJ+hJpfOEAb5xjCB8xIqDoric1WRcCaRB+tDSk7jcsIIiMish0diTK3qTdu4MB6i/sh4aeFs2nifkNi3LdBuk8Xnk+RJHRoKFJ+C+EoSmQPuDQIRaF9N2m4yO0eG36N8jLwvUXnZzGvHkphoQ9ztbRJp58oh6xT7uH62m98OHbsVgzYKvHyBu/IU2ku5kVG9pLrFp25xfD4YdlMMkJH6l+jk+cpY0cvMTS1b6/g+1fyPM+uzD8Wy+9LtZ4PHwLZX+t4ONb/48i5AKq/jSsb5HWdciLuKEwlMyFAihZamZpEj+9n91NLPX4n7XeThXHaEvaeVVl4hfW/1Qsao7l1YjU/NCHuLaDeH4U1P59bagjwo9d1n5/PESeuD4QJFNqW+zkmE4tmyTZ6bPV6T5xdDRHeiITGc00AEQEAAbQkRWR1YXJkIFppbmdlcm1hbiA8ZWRkeXo4N0BnbWFpbC5jb20+iQHUBBMBCgA+FiEEx+6LrjApQyqnX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LLXt51G7P30TVavIeB6s2lCt1QKt62ccLqUAEQEAAYkBvAQYAQoAJhYhBMfui64wKUMqp1wmBC4MZXpJYEQJBQJijTUBAhsMBQkDwmcAAAoJEC4MZXpJYEQJkRAMAKNvWVwtXm/WxWoiLnXyF2WGXKoDe5+itTLvBmKcV/b1OKZF1s90V7WfSBz712eFAynEzyeezPbwU8QBiTpZcHXwQni3IYKvsh7s t1iq+gsfnXbPz5AnS598ScZI1oP7OrPSFJkt/z4acEbOQDQs8aUqrd46PV jsdqGvKnXZxzylux29UTNby4jTlz9pNJM+wPrDRmGfchLDUmf6CffaUYCbu4FiId+9+dcTCDvxbABRy1C3OJ8QY7cxfJ+pEZW18fRJ0XCl/fiV/ecAOfB3HsqgTzAn555h0rkFgay0hAvMU/mAW/CFNSIxV397zm749ZNLA0L2dMy1AKuOqH+/B+/ImBfJMDjmdyJQ8WU/OFRuGLdqOd2oZrA1iuPIa+yUYyZkaZfz/emQwpIL1+Q4p1R/OplA4yc301AqruXXUcVDbEB+joHW3hy5FwK5t5OwTKatrSJBkydSF9zdXy98fYzGniRyRA65P0Ix/8J3BYB4edY2/w0Ip/mdYsYQljBY0A== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.0 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net On Wed, 2023-10-11 at 23:05 +0100, Alan Maguire wrote: [...] > > > > I'm not sure I understand the logic behind "skip" features. > > > > Take `decl_tag` for example: > > > > - by default conf_load->skip_encoding_btf_decl_tag is 0; > > > > - if `--btf_features=3Ddecl_tag` is passed it is still 0 because of= the > > > > `skip ? false : true` logic. > > > >=20 > > > > If there is no way to change "skip" features why listing these at a= ll? > > > >=20 > > > You're right; in the case of a skip feature, I think we need the > > > following behaviour > > >=20 > > > 1. we skip the encoding by default (so the equivalent of > > > --skip_encoding_btf_decl_tag, setting skip_encoding_btf_decl_tag > > > to true > > >=20 > > > 2. if the user however specifies the logical inversion of the skip > > > feature in --btf_features (in this case "decl_tag" - or "all") > > > skip_encoding_btf_decl_tag is set to false. > > >=20 > > > So in my code we had 2 above but not 1. If both were in place I think > > > we'd have the right set of behaviours. Does that sound right? > >=20 > > You mean when --features=3D? is specified we default to > > conf_load->skip_encoding_btf_decl_tag =3D true, and set it to false onl= y > > if "all" or "decl_tag" is listed in features, right? > >=20 >=20 > Yep. Here's the comment I was thinking of adding for the next version, > hopefully it clarifies this all a bit more than the original. >=20 > +/* --btf_features=3Dfeature1[,feature2,..] allows us to specify > + * a list of requested BTF features or "all" to enable all features. > + * These are translated into the appropriate conf_load values via > + * struct btf_feature which specifies the associated conf_load > + * boolean field and whether its default (representing the feature being > + * off) is false or true. > + * > + * btf_features is for opting _into_ features so for a case like > + * conf_load->btf_gen_floats, the translation is simple; the presence > + * of the "float" feature in --btf_features sets conf_load->btf_gen_floa= ts > + * to true. > + * > + * The more confusing case is for features that are enabled unless > + * skipping them is specified; for example > + * conf_load->skip_encoding_btf_type_tag. By default - to support > + * the opt-in model of only enabling features the user asks for - > + * conf_load->skip_encoding_btf_type_tag is set to true (meaning no > + * type_tags) and it is only set to false if --btf_features contains > + * the "type_tag" feature. > + * > + * So from the user perspective, all features specified via > + * --btf_features are enabled, and if a feature is not specified, > + * it is disabled. > */ Sounds reasonable. Maybe also add a line saying that skip_encoding_btf_decl_tag defaults to false if --btf_features is not specified to remain backwards compatible? Thanks, Eduard [...]