From: Quentin Monnet <quentin@isovalent.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
Tonghao Zhang <tong@infragraf.org>,
Andrii Nakryiko <andrii@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"loongarch@lists.linux.dev" <loongarch@lists.linux.dev>,
"linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
"linux-riscv@lists.infradead.org"
<linux-riscv@lists.infradead.org>,
"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
"sparclinux@vger.kernel.org" <sparclinux@vger.kernel.org>,
Hao Luo <haoluo@google.com>,
John Fastabend <john.fastabend@gmail.com>,
Alexei Starovoitov <ast@kernel.org>, Song Liu <song@kernel.org>,
Stanislav Fomichev <sdf@google.com>, Jiri Olsa <jolsa@kernel.org>,
Hou Tao <houtao1@huawei.com>, KP Singh <kpsingh@kernel.org>,
Yonghong Song <yhs@fb.com>,
Martin KaFai Lau <martin.lau@linux.dev>,
"naveen.n.rao@linux.ibm.com" <naveen.n.rao@linux.ibm.com>,
"mpe@ellerman.id.au" <mpe@ellerman.id.au>
Subject: Re: [bpf-next v2] bpf: drop deprecated bpf_jit_enable == 2
Date: Mon, 23 Jan 2023 10:57:58 +0000 [thread overview]
Message-ID: <20dbac19-d510-c8f5-fd3d-588cb08a3afa@isovalent.com> (raw)
In-Reply-To: <26e09ae3-dc7a-858d-c15c-7c2ff080d36d@csgroup.eu>
2023-01-23 07:57 UTC+0000 ~ Christophe Leroy <christophe.leroy@csgroup.eu>
>
>
> Le 17/01/2023 à 16:42, Quentin Monnet a écrit :
>>
>> In the meantime, you could disable the use of skeletons in bpftool, by
>> removing "clang-bpf-co-re" from FEATURE_TESTS from the Makefile. You
>> should get a functional binary, which would only miss a few features
>> (namely, printing the pids of programs holding references to BPF
>> programs, and the "bpftool prog profile" command).
>
> Ok, with "clang-bpf-co-re" removed, bpftool doesn't complain.
>
> However, does it work at all ?
Yes it does.
>
> I started a 'tcpdump', I confirmed with ' bpf_jit_enable == 2' that a
> BPF jitted program is created by tcpdump.
>
> 'bptool prog show' and 'bpftool prog list' returns no result.
Bpftool works with eBPF, not with the older "classic" BPF (cBPF) used by
tcpdump. You should see programs listed if you load anything eBPF, for
example by using BCC tools, bpftrace, or load an eBPF program any other
way from user space:
$ echo "int main(void) {return 0;}" | \
clang -O2 -target bpf -c -o foo.o -x c -
# bpftool prog load foo.o /sys/fs/bpf/foo type xdp
# bpftool prog list
# bpftool prog dump jited name main
# rm /sys/fs/bpf/foo
I know tcpdump itself can show the cBPF bytecode for its programs, but I
don't know of another way to dump the JIT-ed image for cBPF programs.
Drgn could probably do it, with kernel debug symbols.
Quentin
next prev parent reply other threads:[~2023-01-23 10:58 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-05 3:06 [bpf-next v2] bpf: drop deprecated bpf_jit_enable == 2 tong
2023-01-05 9:36 ` Björn Töpel
2023-01-05 17:53 ` Christophe Leroy
2023-01-06 13:22 ` Tonghao Zhang
2023-01-06 15:37 ` Daniel Borkmann
2023-01-09 8:15 ` Christophe Leroy
2023-01-17 5:30 ` Tonghao Zhang
2023-01-17 7:30 ` Christophe Leroy
2023-01-17 11:36 ` Christophe Leroy
2023-01-17 14:18 ` Tonghao Zhang
2023-01-17 14:25 ` Christophe Leroy
2023-01-17 14:41 ` Quentin Monnet
2023-01-17 14:55 ` Christophe Leroy
2023-01-17 15:42 ` Quentin Monnet
2023-01-23 7:57 ` Christophe Leroy
2023-01-23 10:57 ` Quentin Monnet [this message]
2023-01-17 14:22 ` Tonghao Zhang
2023-01-17 15:59 ` Daniel Borkmann
2023-01-18 2:13 ` Tonghao Zhang
2023-01-18 2:21 ` Alexei Starovoitov
2023-01-18 7:35 ` Christophe Leroy
2023-01-18 17:42 ` Alexei Starovoitov
2023-01-23 8:00 ` Christophe Leroy
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=20dbac19-d510-c8f5-fd3d-588cb08a3afa@isovalent.com \
--to=quentin@isovalent.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=daniel@iogearbox.net \
--cc=haoluo@google.com \
--cc=houtao1@huawei.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=loongarch@lists.linux.dev \
--cc=martin.lau@linux.dev \
--cc=mpe@ellerman.id.au \
--cc=naveen.n.rao@linux.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=sdf@google.com \
--cc=song@kernel.org \
--cc=sparclinux@vger.kernel.org \
--cc=tong@infragraf.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox