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 07534C6FD18 for ; Tue, 28 Mar 2023 15:31:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233791AbjC1Pb1 (ORCPT ); Tue, 28 Mar 2023 11:31:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233964AbjC1PbL (ORCPT ); Tue, 28 Mar 2023 11:31:11 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B879011148; Tue, 28 Mar 2023 08:30:11 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id x3so51248488edb.10; Tue, 28 Mar 2023 08:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680017409; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=SmG71KAe/HbOI/Vh5jnMjRu3Q7yaHvmEFQCCmVI70gM=; b=Xg+PTJRhONydOdUYtwqTNCV2+1RMLOGNZsuYif6kmKsGZPZyv5DZf8go3aaiXM6AD3 k6SUdeSLJt9b3p/tPIYNJYn7GIJEtFR+fyiCCTqIzox+EgTn/Wl2ovlDMmXqJUzOy0ig FSDV6LnHFnOGl9DX27KrvinRnpMN0LP+Fz7zRXGWd8AvCys6eY5eycAgrdjumsiWJtgP 5UIfTN2F2zUficuqLJdWYEIKp9CNa5X2RXruY/C3PHQuYSaqZkOGNXSzraMXIMQJv5t+ qFnjxDUKjhDKVdwN9iDHAd3T7vJYMTzAPBEwhlBDvoSHzLEam0yfs+v+rm10Bsf+XkgI X1xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680017409; h=mime-version:user-agent:content-transfer-encoding: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=SmG71KAe/HbOI/Vh5jnMjRu3Q7yaHvmEFQCCmVI70gM=; b=SNwIS2yB7HGb7YDpbadeO/eYkSR4JCtTDMsK7sG1GhXtAx19qVZOlwMutzjkhCk798 a3qlKnMEgf7slbX3fUxB+2yuf4KIi0M61f0fr1tC8CA73fnxkQ69zE24PUKY4oQ1ILiY GTTgHIPDv3QjjPB/IpIByW4MbQAqyEj718a+HItGmt2ytGpXV6A9/+5WdXWeNeFHkDNn s89DLcALjDwAHnbFaRmCfKrO4ZSbCz0iwzfWa0tS0nC+Twb2gc0+bu23fXpKV58Gc1vr ULKv3PnIrdUEYn+AF22dVBrxujrBb9LujsBTV707fxv4dszNTnx4J36rXgFIv1osM3tU 8Xmg== X-Gm-Message-State: AAQBX9fOLjVH1PCp8iAvfDMnm6bcjg0rokFsKox8lrbNZibRQP7vuRLU CMDNaRQ2OkRCqsgUkKtjxHY= X-Google-Smtp-Source: AKy350bgmFX2NPv2xwdz0oJHOHmaiza+hmgUYsCFTpvF4HpGDe9246z0ciGMwnHFw6BYApbHCFzvVQ== X-Received: by 2002:a17:906:4bcc:b0:93e:24f6:d7a3 with SMTP id x12-20020a1709064bcc00b0093e24f6d7a3mr15756390ejv.8.1680017408989; Tue, 28 Mar 2023 08:30:08 -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 i22-20020a17090671d600b0093348be32cfsm13501133ejk.90.2023.03.28.08.30.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 08:30:07 -0700 (PDT) Message-ID: <50a160d802ad3f84e91cf05c8f541e0c2e388fc8.camel@gmail.com> Subject: Re: [PATCH dwarves v2 1/5] fprintf: Correct names for types with btf_type_tag attribute From: Eduard Zingerman To: Arnaldo Carvalho de Melo Cc: dwarves@vger.kernel.org, bpf@vger.kernel.org, kernel-team@fb.com, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, yhs@fb.com, jose.marchesi@oracle.com, david.faust@oracle.com, alan.maguire@oracle.com Date: Tue, 28 Mar 2023 18:30:05 +0300 In-Reply-To: References: <20230314230417.1507266-1-eddyz87@gmail.com> <20230314230417.1507266-2-eddyz87@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Tue, 2023-03-28 at 12:26 -0300, Arnaldo Carvalho de Melo wrote: [...]=20 > Sure, but look: >=20 > > > - struct qdisc_size_table * stab; /* 32 = 8 */ > > > + struct qdisc_size_table stab; /* 32 = 8 */ >=20 > Its the DW_TAG_pointer_type that is getting lost somehow: >=20 > <1>: Abbrev Number: 81 (DW_TAG_structure_type) > DW_AT_name : (indirect string, offset: 0xe825): Qdi= sc > DW_AT_byte_size : 384 > DW_AT_decl_file : 223 > DW_AT_decl_line : 72 >=20 > >=20 > <2>: Abbrev Number: 65 (DW_TAG_member) > DW_AT_name : (indirect string, offset: 0x4745ff): s= tab > DW_AT_type : <0xb0b76b> > DW_AT_decl_file : 223 > DW_AT_decl_line : 99 > DW_AT_data_member_location: 32 >=20 > >=20 > <1>: Abbrev Number: 61 (DW_TAG_pointer_type) > DW_AT_type : <0xb0b77a> > <2>: Abbrev Number: 62 (User TAG value: 0x6000) > DW_AT_name : (indirect string, offset: 0x378): btf_= type_tag > DW_AT_const_value : (indirect string, offset: 0x6e93): rcu > <2>: Abbrev Number: 0 > <1>: Abbrev Number: 69 (DW_TAG_structure_type) > DW_AT_name : (indirect string, offset: 0x6e5ed): qd= isc_size_table > DW_AT_byte_size : 64 > DW_AT_decl_file : 223 > DW_AT_decl_line : 56 >=20 > =20 > So it's all there in the DWARF info: >=20 > b0af77 has type 0xb0b76b which is a DW_TAG_pointer_type that has type > 0xb0b77a, that is DW_TAG_structure_type. >=20 > Now lets see how this was encoded into BTF: >=20 > [4725] STRUCT 'Qdisc' size=3D384 vlen=3D28 > > 'stab' type_id=3D4790 bits_offset=3D256 > > [4790] PTR '(anon)' type_id=3D4789 > > [4789] TYPE_TAG 'rcu' type_id=3D4791 > > [4791] STRUCT 'qdisc_size_table' size=3D64 vlen=3D5 > 'rcu' type_id=3D320 bits_offset=3D0 > 'list' type_id=3D87 bits_offset=3D128 > 'szopts' type_id=3D4792 bits_offset=3D256 > 'refcnt' type_id=3D16 bits_offset=3D448 > 'data' type_id=3D4659 bits_offset=3D480 >=20 > So it all seems ok, we should keep all the info and teach fprintf to > handle TYPE_TAG. >=20 > Which you tried, but somehow the '*' link is missing. Yep, thanks a lot for the analysis, I will take a look. Hopefully will send v2 tomorrow. >=20 > - Arnaldo