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 03A11C433F5 for ; Fri, 4 Mar 2022 20:05:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229943AbiCDUGJ (ORCPT ); Fri, 4 Mar 2022 15:06:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230164AbiCDUGC (ORCPT ); Fri, 4 Mar 2022 15:06:02 -0500 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 672CD31AF78 for ; Fri, 4 Mar 2022 12:01:48 -0800 (PST) Received: by mail-io1-xd36.google.com with SMTP id q8so10757851iod.2 for ; Fri, 04 Mar 2022 12:01:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O7OLZj9rVyIA/cuusSddefTkUC8S9jwrVI7aSuOTwU8=; b=KZhl8cPz8VPZF189CYhXzEKjOV85C3T479ZsuAQDX690BJgGL3X2woY6yrMh8BlVHY QE5fE8y6m3b764RObAYkC5gKB+5NnNvTVB/6+vSjdAQlBJfV3eu97GBBUcuwJYpy7Zjv /EW48ykwVHn74RiL4WEEUnlAHQUaeV4NeHp+84gbbMPFtvCtyX44I2Q6GC1KPczTx5qt zLhiXNYgYQoCRxAUnexdCn+uxGxahE8eHWBiAwWOEpFcYNN5QCoGG7pPTxptCWNnKCGQ CRfmdhsjmM7UBBDco0NFSeUvuMWl/o+LWgqYSUZUgzVR9dTKzeWLxIdZlmnQSepcxh0o yLWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O7OLZj9rVyIA/cuusSddefTkUC8S9jwrVI7aSuOTwU8=; b=Mop3c5x7kaApZdeDekwx5G4DBrHEGG00XXQrNkpdUWX4HKC6LWdj6bo8kd46INetYp DqxlvNhuSd5QKDVihIcO9E881Wh+nThI1a7hWJ7sImpRSB4BENLaVs3SuxK5SNKW10CD y/VPhitvfxR9T+xX0Gvnp5jxMTZv64y294cYYUE/QwyZyjBJwoZJfAdrHKcE9ODiqUtK BYmy1mEM/TG/KD3yerjCYkoOfQNW5lxPoL6t0JPJSUdGkwFq2lT3tPFd2CzdvIQjsrn+ jKNtopgCeZ8L7eSkiEfEBfq6azX0G6QgV08GQueyQMi8OUw/lJkNL+9EJFH57Beqq7KT HDaA== X-Gm-Message-State: AOAM5318fApMSr6KjhsHvwvEwXyvST6li/oYhTei7A7lfOjX+w5s1NSf KaepvA2qxnvGWU1jKNlVlJhMlTRtBy4AB3rKfJEFo0EgN+M= X-Google-Smtp-Source: ABdhPJzRmZ6kQ8lsE6/KDwx6+rpivxNdG3UV8ztcjbr90G3xY9TwwfDWgK7onMlsqM6owxeYwcDMiKEswzXsy0+q3Ys= X-Received: by 2002:a5e:c648:0:b0:640:bc31:cbec with SMTP id s8-20020a5ec648000000b00640bc31cbecmr114683ioo.79.1646422207587; Fri, 04 Mar 2022 11:30:07 -0800 (PST) MIME-Version: 1.0 References: <9028e60f908d30d5f156064cebfd5af8d66c5c9c.camel@fb.com> <108158a8914fbae73f750d635773172db007a704.camel@fb.com> In-Reply-To: <108158a8914fbae73f750d635773172db007a704.camel@fb.com> From: Andrii Nakryiko Date: Fri, 4 Mar 2022 11:29:56 -0800 Message-ID: Subject: Re: [PATCH bpf-next 2/4] bpftool: add support for subskeletons To: Delyan Kratunov Cc: "daniel@iogearbox.net" , "ast@kernel.org" , "andrii@kernel.org" , "bpf@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Thu, Mar 3, 2022 at 12:54 PM Delyan Kratunov wrote: > > On Thu, 2022-03-03 at 10:52 -0800, Delyan Kratunov wrote: > > > > > > > > > > > + map_type_id = btf__find_by_name_kind(btf, > > > > bpf_map__section_name(map), BTF_KIND_DATASEC); > > > > > > if we set obj_name to "", bpf_map__name() should return ELF section > > > name here, so no need to expose this as an API > > > > > > > > > oh, but also bpf_map__btf_value_type_id() should give you this ID directly > > > > TIL, that's not obvious at all. There's a few places in gen.c that could be > > simplified then - find_type_for_map goes through slicing the complete name and > > walking over every BTF type to match on the slice. Is there some compatibility > > reason to do that or is btf_value_type_id always there? > > Unfortunately, the internal datasec maps have value_type_id = key_value_type_id > = 0 i.e. void, so bpf_map__btf_value_type_id won't work out of the box. > > I haven't looked if that's a bug all the way in clang-emitted object or > somewhere further on. Yeah, just replied in another email. We fill it out too late, but it should be possible to move it earlier into open phase. > > -- Delyan