From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id 314183857C66 for ; Thu, 26 Aug 2021 10:02:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 314183857C66 Received: by mail-ej1-x634.google.com with SMTP id e21so4945704ejz.12 for ; Thu, 26 Aug 2021 03:02:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=46dcFhSs1ZXPJUtJNNXzeUhyBRqJfhetot3j0mm3K0Y=; b=DodI+GDlu9NWy/walw6uyv9k+HPgPIUZb8QxARwn/mfXt81T3QLcGqMRYgFKhgG2li ESq4UX6oa1M5XuKcP/s4XvrI8WZHhG3SZPvH5xbKHCnqZ3LTkW0ZbGxP9XkCgpKCH6oR u24yxZuP/+aOcFx2KmWFq6ZwJxI2X2c6qGkvmmTc75gBkp8DEMIZA/CwBDqK/ur3Ekxz UQ55o6nFW7fklp6RiuLlQ+t6WsUtYcx0DOBiep27OxnnIN2RvyJzfaJ1ZMhGybn3qamC lQyh9kKnSpWpMNIF+OZCVGejweo+ydQV93JreqbPE1aSQgKMg+p4hZjMO6cQj16VW0iW 9DKA== X-Gm-Message-State: AOAM532trRSYXNQAVO8VqldoWNwF9B3+NSqLkOjvHXmY4zGSKUyFonAj 4SX7svPe1M9iBOlWBCbO4uY38S/qwovkSgHXUoETfx7I X-Google-Smtp-Source: ABdhPJxvhA0POfD+z16x/vJu528McdHHp58wXITVdridWQfbney9ggYk8gqmrdBb1IJ4EsjrY20RVnk8BjBswyjoOog= X-Received: by 2002:a17:906:6815:: with SMTP id k21mr3350160ejr.371.1629972126178; Thu, 26 Aug 2021 03:02:06 -0700 (PDT) MIME-Version: 1.0 References: <20210804175411.6783-1-david.faust@oracle.com> <20210804175411.6783-5-david.faust@oracle.com> In-Reply-To: <20210804175411.6783-5-david.faust@oracle.com> From: Richard Biener Date: Thu, 26 Aug 2021 12:01:55 +0200 Message-ID: Subject: Re: [PATCH 4/7] btf: expose get_btf_id To: David Faust Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2021 10:02:08 -0000 On Wed, Aug 4, 2021 at 7:57 PM David Faust via Gcc-patches wrote: > > Expose the function get_btf_id, so that it may be used by the BPF > backend. This enables the BPF CO-RE machinery in the BPF backend to > lookup BTF type IDs, in order to create CO-RE relocation records. > > A prototype is added in ctfc.h Patches 2-4 are OK. > gcc/ChangeLog: > > * btfout.c (get_btf_id): Function is no longer static. > * ctfc.h: Expose it here. > --- > gcc/btfout.c | 2 +- > gcc/ctfc.h | 1 + > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/gcc/btfout.c b/gcc/btfout.c > index 8cdd9905fb6..cdc6c6378c0 100644 > --- a/gcc/btfout.c > +++ b/gcc/btfout.c > @@ -156,7 +156,7 @@ init_btf_id_map (size_t len) > /* Return the BTF type ID of CTF type ID KEY, or BTF_INVALID_TYPEID if the CTF > type with ID KEY does not map to a BTF type. */ > > -static inline ctf_id_t > +ctf_id_t > get_btf_id (ctf_id_t key) > { > return btf_id_map[key]; > diff --git a/gcc/ctfc.h b/gcc/ctfc.h > index 14180c1e5de..a0b7e4105a8 100644 > --- a/gcc/ctfc.h > +++ b/gcc/ctfc.h > @@ -431,6 +431,7 @@ extern int ctf_add_variable (ctf_container_ref, const char *, ctf_id_t, > dw_die_ref, unsigned int); > > extern ctf_id_t ctf_lookup_tree_type (ctf_container_ref, const tree); > +extern ctf_id_t get_btf_id (ctf_id_t); > > /* CTF section does not emit location information; at this time, location > information is needed for BTF CO-RE use-cases. */ > -- > 2.32.0 >