From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF7A63164C5 for ; Mon, 13 Jul 2026 15:33:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783956788; cv=none; b=Zwt/DOFU6P1LRWujL62WlXCAHNMFpfeORUSx1zg93xMl620LtgJFOlSZTwcaWsLuh+hTv1mrkYkjiMn/vHmpYtfKSPhaxE9R4OfhUEfj7Iq0Ue5b9cZRqoZk+BXnAlhGff8ZJ/XpJuzxQk7p8+FBWpH8X+orFF3+dHu3MJyMNJg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783956788; c=relaxed/simple; bh=mM2m2Iv09FCmXKxsnnnY41Pvn6pTqfbZKQfmUKONGPc=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:From:To: References:In-Reply-To; b=I4IEhmFmGRJxtNxxZNNGKo4aDxmof8PlaLTAxy6s7iYByK53CpoPpm2lTm8IpK5oHe9jfbEfuAg1ajBaxV/8j+YiPyAJuUHi2kXFrG3EdVHWl1eqqJJfLzS/9TmWrrgmUWr87IdEL+l7VQvQD4QldpOdzSgarUK/T73/I8JvOvc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=0n2JaYlb; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="0n2JaYlb" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 66AFE4E40D90; Mon, 13 Jul 2026 15:33:04 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 3944860345; Mon, 13 Jul 2026 15:33:04 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 0E71011BD21E7; Mon, 13 Jul 2026 17:32:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1783956783; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=MA6mxJIo1x+dTMvwPcn/qU2Jkn4kB67D529MAoNiIY8=; b=0n2JaYlbMk4CsI/36ows0HBYeEMraw7UfRAXjY3dHZDJn56Z8Ol+hPp2YpRA7t461YNjFY +h5mfHAMYio4orHWwO0D6uXbxa7R5JA+C852N/KcYZXwGs1xc26rdIToRvEq7ndxbXoqE6 9bbYMk3NkW3XOalvTdWnGDaB1C0W2XmxLTzanRqGLgdyB8NuDRQLF1V53a62w9GojyhPDY 5FFapEVx/+D5tl7Vi8t+QWvFOfiSFnW1VNXAb8xVzlmwAcWNSE0YrYL1jxd0uVbfkvITgy TTfxw0Eb7XYHmSwKKpdwuO+yRqnLf7i3kOKnZBJtXVFmcgC+2l7Q6cTTLILMOg== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 13 Jul 2026 17:32:58 +0200 Message-Id: Subject: Re: [PATCH 1/4] selftests/bpf: Install bpftool where test_progs expects to find it Cc: , , From: =?utf-8?q?Alexis_Lothor=C3=A9?= To: =?utf-8?b?UmljYXJkbyBCLiBNYXJsacOocmU=?= , "Alexei Starovoitov" , "Daniel Borkmann" , "Andrii Nakryiko" , "Eduard Zingerman" , "Kumar Kartikeya Dwivedi" , "Martin KaFai Lau" , "Song Liu" , "Yonghong Song" , "Jiri Olsa" , "Emil Tsalapatis" , "Shuah Khan" , =?utf-8?b?QWxleGlzIExvdGhvcsOpIChlQlBGIEZvdW5kYXRpb24p?= , "Ihor Solodrai" , "Christian Brauner" X-Mailer: aerc 0.21.0-0-g5549850facc2 References: <20260710-selftests-bpf_fixes-v1-0-aa24dfd6f4f9@suse.com> <20260710-selftests-bpf_fixes-v1-1-aa24dfd6f4f9@suse.com> In-Reply-To: <20260710-selftests-bpf_fixes-v1-1-aa24dfd6f4f9@suse.com> X-Last-TLS-Session-Version: TLSv1.3 Hi, On Sat Jul 11, 2026 at 12:09 AM CEST, Ricardo B. Marli=C3=A8re wrote: > bpftool_helpers.c looks for bpftool at "tools/sbin/bpftool" or > "../tools/sbin/bpftool" relative to the running test_progs binary, matchi= ng > the build directory layout where bpftool sits at > $(OUTPUT)/tools/sbin/bpftool. > > INSTALL_RULE installs bpftool through the generic TEST_GEN_PROGS_EXTENDED > mechanism, which flattens it straight into $(INSTALL_PATH) and loses the > tools/sbin/ prefix. After "make install", every flavor of test_progs, > including the default one, fails to locate bpftool, and bpftool_maps_acce= ss > and bpftool_metadata error out with "Failed to detect bpftool path", even > though bpftool itself built and installed fine. > > Explicitly install bpftool under tools/sbin/ in the installed tree > so its relative location matches what detect_bpftool_path() already > expects, restoring the pre-install layout instead of introducing a > new one. > > Fixes: f21fae577446 ("selftests/bpf: Add a few helpers for bpftool testin= g") > Signed-off-by: Ricardo B. Marli=C3=A8re I did not face the issue because I am running the selftests in-tree, and the CI seems to do the same, but for users using selftests after running `make install`, I guess the change makes sense. That's not the first fix aiming to improve bpftool detection/installation (eg the BPFTOOL env variable, see [1]), so it makes me wonder if we shouldn't just make bpftool part of TRUNNER_EXTRA_FILES for all flavours of test_progs, similarly to other binaries needed during tests (eg: urandom_read), instead of just adding some bpftool-specific details in this generic install rule, and just make the test runners assume that the needed binary is in the same directory. Alexis [1] https://lore.kernel.org/all/20260223191118.655185-2-ihor.solodrai@linux= .dev/ > --- > tools/testing/selftests/bpf/Makefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftes= ts/bpf/Makefile > index b642ee489ea6..47911c9b4977 100644 > --- a/tools/testing/selftests/bpf/Makefile > +++ b/tools/testing/selftests/bpf/Makefile > @@ -1055,6 +1055,8 @@ endif > DEFAULT_INSTALL_RULE :=3D $(INSTALL_RULE) > override define INSTALL_RULE > $(DEFAULT_INSTALL_RULE) > + @mkdir -p $(INSTALL_PATH)/tools/sbin > + @rsync -a $(if $(PERMISSIVE),--ignore-missing-args) $(TRUNNER_BPFTOOL) = $(INSTALL_PATH)/tools/sbin/ > @for DIR in $(TEST_INST_SUBDIRS); do \ > mkdir -p $(INSTALL_PATH)/$$DIR; \ > rsync -a $(if $(PERMISSIVE),--ignore-missing-args) \ --=20 Alexis Lothor=C3=A9, Bootlin Embedded Linux and Kernel engineering https://bootlin.com