bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@fb.com>
To: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>,
	<dwarves@vger.kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>, <bpf@vger.kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>, <kernel-team@fb.com>
Subject: [PATCH dwarves v2 0/4] btf: support btf_type_tag attribute
Date: Mon, 22 Nov 2021 20:56:12 -0800	[thread overview]
Message-ID: <20211123045612.1387544-1-yhs@fb.com> (raw)

btf_type_tag is a new llvm type attribute which is used similar
to kernel __user/__rcu attributes. The format of btf_type_tag looks like
  __attribute__((btf_type_tag("tag1")))
For the case where the attribute applied to a pointee like
  #define __tag1 __attribute__((btf_type_tag("tag1")))
  #define __tag2 __attribute__((btf_type_tag("tag2")))
  int __tag1 * __tag1 __tag2 *g;
the information will be encoded in dwarf.

In BTF, the attribute is encoded as a new kind
BTF_KIND_TYPE_TAG and latest bpf-next supports it.

The patch added support in pahole, specifically
converts llvm dwarf btf_type_tag attributes to
BTF types. Please see individual patches for details.

Changelog:
  v1 -> v2:
     - reorg an if condition to reduce nesting level.
     - add more comments to explain how to chain type tag types.

Yonghong Song (4):
  libbpf: sync with latest libbpf repo
  dutil: move DW_TAG_LLVM_annotation definition to dutil.h
  dwarf_loader: support btf_type_tag attribute
  btf_encoder: support btf_type_tag attribute

 btf_encoder.c  |   7 +++
 dutil.h        |   4 ++
 dwarf_loader.c | 140 ++++++++++++++++++++++++++++++++++++++++++++++---
 dwarves.h      |  38 +++++++++++++-
 lib/bpf        |   2 +-
 pahole.c       |   8 +++
 6 files changed, 190 insertions(+), 9 deletions(-)

-- 
2.30.2


             reply	other threads:[~2021-11-23  4:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23  4:56 Yonghong Song [this message]
2021-11-23  4:56 ` [PATCH dwarves v2 1/4] libbpf: sync with latest libbpf repo Yonghong Song
2021-11-23  4:56 ` [PATCH dwarves v2 2/4] dutil: move DW_TAG_LLVM_annotation definition to dutil.h Yonghong Song
2021-11-23  4:56 ` [PATCH dwarves v2 3/4] dwarf_loader: support btf_type_tag attribute Yonghong Song
2021-11-23  4:56 ` [PATCH dwarves v2 4/4] btf_encoder: " Yonghong Song
2021-11-23 18:32 ` [PATCH dwarves v2 0/4] btf: " Andrii Nakryiko
2021-11-23 23:36   ` Arnaldo Carvalho de Melo
2021-11-24  3:56     ` Yonghong Song
2021-11-24  4:49     ` Andrii Nakryiko
2021-11-25 21:33       ` Arnaldo Carvalho de Melo
2021-11-26  5:37         ` Yonghong Song

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=20211123045612.1387544-1-yhs@fb.com \
    --to=yhs@fb.com \
    --cc=andrii@kernel.org \
    --cc=arnaldo.melo@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dwarves@vger.kernel.org \
    --cc=kernel-team@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 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 NNTP newsgroup(s).