BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
	bpf <bpf@vger.kernel.org>,  KP Singh <kpsingh@kernel.org>
Subject: Re: Is tools/testing/selftests/bpf/ maintained?
Date: Thu, 12 Oct 2023 19:34:38 +0300	[thread overview]
Message-ID: <26b213505abeefba2728d238927ddd1907967786.camel@gmail.com> (raw)
In-Reply-To: <adfab6e8-b1de-4efc-a9ef-84e219c91833@I-love.SAKURA.ne.jp>

On Thu, 2023-10-12 at 22:39 +0900, Tetsuo Handa wrote:
> Hello.
> 
> I'm having problem with finding BPF LSM examples that work.
> I tried building tools/testing/selftests/bpf/progs/lsm.c and
> tools/testing/selftests/bpf/prog_tests/test_lsm.c explained at
> https://docs.kernel.org/bpf/prog_lsm.html , but got a lot of errors.

Hello,

> Is tools/testing/selftests/bpf/ maintained?

It pretty much is, build it every day :)
And we have a CI too: https://github.com/kernel-patches/bpf .

I tried setting up a minimal Debian chroot to showcase the build
and came up with the following list of commands:

# Use trixie to get llvm-16
sudo /usr/sbin/debootstrap --variant=buildd --arch=amd64 trixie trixie-chroot/ http://deb.debian.org/debian
# don't forget to umount with 'umount -R ...'
sudo mount --rbind /dev/pts trixie-chroot/dev/pts
sudo mount -t proc proc trixie-chroot/proc
sudo chroot trixie-chroot

# The reset of commands are from chroot itself, first as root
apt install build-essential llvm clang lld bc flex bison pahole git \
    libelf-dev libssl-dev docutils-common rsync
# Note: you might want to build pahole from source
useradd -d /home/eddy -s /bin/bash eddy
mkdir /home/eddy
chown eddy /home/eddy
su eddy

# Now as a user 'eddy':
cd /home/eddy
git clone https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git
cd linux/
./scripts/kconfig/merge_config.sh tools/testing/selftests/bpf/config tools/testing/selftests/bpf/config.x86_64
# Note: kernel build is mandatory, as vmlinux.h is constructed from DWARF in ./vmlinux
make -j14
make -j14 headers
make -j14 -C tools/testing/selftests/bpf/

Hope this helps,
Eduard


  reply	other threads:[~2023-10-12 16:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-12 13:39 Is tools/testing/selftests/bpf/ maintained? Tetsuo Handa
2023-10-12 16:34 ` Eduard Zingerman [this message]
2023-10-13 13:15   ` Tetsuo Handa
2023-10-13 13:25     ` Eduard Zingerman
2023-10-13 14:17       ` Tetsuo Handa
2023-10-13 14:23         ` Eduard Zingerman
2023-10-12 16:35 ` Andrii Nakryiko

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=26b213505abeefba2728d238927ddd1907967786.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /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