BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Hou Tao <houtao@huaweicloud.com>, bpf@vger.kernel.org
Cc: Martin KaFai Lau <martin.lau@linux.dev>,
	Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>, Song Liu <song@kernel.org>,
	Hao Luo <haoluo@google.com>,
	Yonghong Song <yonghong.song@linux.dev>,
	Daniel Borkmann <daniel@iogearbox.net>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@google.com>, Jiri Olsa <jolsa@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Kui-Feng Lee <thinker.li@gmail.com>,
	houtao1@huawei.com, xukuohai@huawei.com
Subject: Re: [RESEND][PATCH bpf 2/2] selftests/bpf: Add more test case for field flattening
Date: Wed, 11 Sep 2024 19:31:18 -0700	[thread overview]
Message-ID: <5886886d412f2314c0df5c8b1e8da57f4b4ef51b.camel@gmail.com> (raw)
In-Reply-To: <f5d93124-0f9d-dca8-a11d-a1d21bdf6432@huaweicloud.com>

On Thu, 2024-09-12 at 09:05 +0800, Hou Tao wrote:

[...]

> > progs/cpumask_failure.c:19:33: error: use of undeclared identifier 'BTF_FIELDS_MAX'; did you mean 'BTF_KIND_MAX'?
> >    19 |         struct kptr_nested_array_2 d_2[BTF_FIELDS_MAX + 1];
> >       |                                        ^~~~~~~~~~~~~~
> >       |                                        BTF_KIND_MAX
> > 
> > [...]
> 
> BTF_FIELDS_MAX should be defined in vmlinux.h. Could you please check
> whether or not it is present ? It seems that BPF CI reports the same
> problem for  build-x86_64-llvm-17/build-x86_64-llvm-18 [1], but others

(did you mean to specify a ling for [1] ?)

> build are OK.  Do you know  is there anything special about
> build-x86_64-llvm-17/18 ?
> 

Hm, this is interesting. I use LLVM 20.0.0git.
For BTF_FIELDS_MAX to be present in vmlinux.h it first has to be
present in vmlinux DWARF. However, the following output is empty:

  $ llvm-dwarfdump vmlinux | grep BTF_FIELDS_MAX

While picking some other enum literal:

  $ llvm-dwarfdump vmlinux | grep BTF_KIND_INT
                  DW_AT_name	("BTF_KIND_INT")
                  DW_AT_name	("BTF_KIND_INT")
                  ...

Produce output.

Looks like LLVM20 drops info about BTF_FIELDS_MAX for some reason.
I will take a look at compiler internals, but you would need some
workaround for the test, unfortunately.


      reply	other threads:[~2024-09-12  2:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-11 11:05 [RESEND][PATCH bpf 0/2] Check the remaining info_cnt before repeating btf fields Hou Tao
2024-09-11 11:05 ` [RESEND][PATCH bpf 1/2] bpf: " Hou Tao
2024-09-11 17:37   ` Eduard Zingerman
2024-09-12  1:20     ` Hou Tao
2024-09-12  3:03       ` Eduard Zingerman
2024-09-12  3:14         ` Eduard Zingerman
     [not found]     ` <CAFVMQ6Q64aFM7xCW_htrU0dpB+S+eEXYLSeUufTgg_eB5DEN4g@mail.gmail.com>
2024-09-12 19:45       ` Eduard Zingerman
2024-09-11 11:05 ` [RESEND][PATCH bpf 2/2] selftests/bpf: Add more test case for field flattening Hou Tao
2024-09-11 17:07   ` Eduard Zingerman
2024-09-12  1:05     ` Hou Tao
2024-09-12  2:31       ` Eduard Zingerman [this message]

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=5886886d412f2314c0df5c8b1e8da57f4b4ef51b.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=houtao1@huawei.com \
    --cc=houtao@huaweicloud.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=thinker.li@gmail.com \
    --cc=xukuohai@huawei.com \
    --cc=yonghong.song@linux.dev \
    /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