public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: David Faust <david.faust@oracle.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 4/7] btf: expose get_btf_id
Date: Thu, 26 Aug 2021 12:01:55 +0200	[thread overview]
Message-ID: <CAFiYyc3bXAnqy+X+-a3FY978nFtW2OTHo44S3D94kaRYWjHt2Q@mail.gmail.com> (raw)
In-Reply-To: <20210804175411.6783-5-david.faust@oracle.com>

On Wed, Aug 4, 2021 at 7:57 PM David Faust via Gcc-patches
<gcc-patches@gcc.gnu.org> 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
>

  reply	other threads:[~2021-08-26 10:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04 17:54 [PATCH 0/7] BPF CO-RE Support David Faust
2021-08-04 17:54 ` [PATCH 1/7] dwarf: externalize lookup_type_die David Faust
2021-08-05  9:07   ` Richard Biener
2021-08-04 17:54 ` [PATCH 2/7] ctfc: externalize ctf_dtd_lookup David Faust
2021-08-04 17:54 ` [PATCH 3/7] ctfc: add function to lookup CTF ID of a TREE type David Faust
2021-08-04 17:54 ` [PATCH 4/7] btf: expose get_btf_id David Faust
2021-08-26 10:01   ` Richard Biener [this message]
2021-08-04 17:54 ` [PATCH 5/7] bpf: BPF CO-RE support David Faust
2021-08-10 15:11   ` Jose E. Marchesi
2021-08-04 17:54 ` [PATCH 6/7] bpf testsuite: Add BPF CO-RE tests David Faust
2021-08-10 15:12   ` Jose E. Marchesi
2021-08-04 17:54 ` [PATCH 7/7] doc: BPF CO-RE documentation David Faust
2021-08-26 10:01   ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFiYyc3bXAnqy+X+-a3FY978nFtW2OTHo44S3D94kaRYWjHt2Q@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=david.faust@oracle.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).