All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@kernel.org>
To: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>
Cc: Andrii Nakryiko <andriin@fb.com>,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@chromium.org>,
	Jesper Dangaard Brouer <brouer@redhat.com>
Subject: [PATCH v12 bpf-next 11/14] bpf: Update .BTF_ids section in btf.rst with sets info
Date: Tue, 25 Aug 2020 21:21:21 +0200	[thread overview]
Message-ID: <20200825192124.710397-12-jolsa@kernel.org> (raw)
In-Reply-To: <20200825192124.710397-1-jolsa@kernel.org>

Updating btf.rst doc with info about BTF_SET_START/END macros.

Acked-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 Documentation/bpf/btf.rst | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/Documentation/bpf/btf.rst b/Documentation/bpf/btf.rst
index b5361b8621c9..44dc789de2b4 100644
--- a/Documentation/bpf/btf.rst
+++ b/Documentation/bpf/btf.rst
@@ -724,6 +724,31 @@ want to define unused entry in BTF_ID_LIST, like::
       BTF_ID_UNUSED
       BTF_ID(struct, task_struct)
 
+The ``BTF_SET_START/END`` macros pair defines sorted list of BTF ID values
+and their count, with following syntax::
+
+  BTF_SET_START(set)
+  BTF_ID(type1, name1)
+  BTF_ID(type2, name2)
+  BTF_SET_END(set)
+
+resulting in following layout in .BTF_ids section::
+
+  __BTF_ID__set__set:
+  .zero 4
+  __BTF_ID__type1__name1__3:
+  .zero 4
+  __BTF_ID__type2__name2__4:
+  .zero 4
+
+The ``struct btf_id_set set;`` variable is defined to access the list.
+
+The ``typeX`` name can be one of following::
+
+   struct, union, typedef, func
+
+and is used as a filter when resolving the BTF ID value.
+
 All the BTF ID lists and sets are compiled in the .BTF_ids section and
 resolved during the linking phase of kernel build by ``resolve_btfids`` tool.
 
-- 
2.25.4


  parent reply	other threads:[~2020-08-25 19:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25 19:21 [PATCH v12 bpf-next 00/14] bpf: Add d_path helper Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 01/14] tools resolve_btfids: Add size check to get_id function Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 02/14] tools resolve_btfids: Add support for set symbols Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 03/14] bpf: Move btf_resolve_size into __btf_resolve_size Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 04/14] bpf: Add elem_id pointer as argument to __btf_resolve_size Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 05/14] bpf: Add type_id " Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 06/14] bpf: Remove recursion call in btf_struct_access Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 07/14] bpf: Factor btf_struct_access function Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 08/14] bpf: Add btf_struct_ids_match function Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 09/14] bpf: Add BTF_SET_START/END macros Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 10/14] bpf: Add d_path helper Jiri Olsa
2020-08-25 22:58   ` Alexei Starovoitov
2020-08-26  9:25     ` Jiri Olsa
2020-08-25 19:21 ` Jiri Olsa [this message]
2020-08-25 19:21 ` [PATCH v12 bpf-next 12/14] selftests/bpf: Add verifier test for " Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 13/14] selftests/bpf: Add " Jiri Olsa
2020-08-25 23:06   ` Alexei Starovoitov
2020-08-26  9:30     ` Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 14/14] selftests/bpf: Add set test to resolve_btfids Jiri Olsa

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=20200825192124.710397-12-jolsa@kernel.org \
    --to=jolsa@kernel.org \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.