From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B6663D1CA5 for ; Wed, 15 Jul 2026 21:41:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784151664; cv=none; b=qDM0r5SIiqD5Cs1xXs1jfIhGWHkMjQpR+9JOh0xo69JH/Mk9vgjpUdEo/F7sCXJH08Czs6BwQaWFAIILsvNOmrGUKwKtbBPRV1RZA03UQ/i7yWmBR/bVVCkjDaXPlxCeDOVXVk8wIXUV/21z7U6Srt6zhiazV35vNqZY+r+VoZ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784151664; c=relaxed/simple; bh=zq0I5qk5hP0VPhPf04laI8HrhxkLl8p5PZFWdIVIm5c=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=FH76/9T2v9SiieJgq1AI9bxwRskTozCPz1UCaHuummTLW2WQN1CEaOb43EGGdy7FQFgwLWM0iC8Mo1XezCKAajB0t0mCsi0Xs7sDJIgCBhCYunqpaCbVkxar8kJEXQHarUdxdKpaQtyrw0iPUXRv7tBdYnQfvYlMOhhqr4C6WEA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=YYcPa0DH; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="YYcPa0DH" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-47d70879764so4130955f8f.2 for ; Wed, 15 Jul 2026 14:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1784151660; x=1784756460; darn=vger.kernel.org; h=in-reply-to:references:from:to:cc:subject:message-id:date :content-type:content-transfer-encoding:mime-version:from:to:cc :subject:date:message-id:reply-to:content-type; bh=VBgodXPKQuUMriRytvZ6LOP5ecvhprUS0jAzk/7/d7Q=; b=YYcPa0DHg5SS1Cky/Xx8E1VCRfZnJbebLEDO4EEsviQxyFv+AEjo71p97iXce/D2vL 1gDWg7Mf5IImaDQSvqVxtSwWwIwkaAWjI3ZX12dXOrAJx4InnzJgkyA6NsOJStAJD2Gj NhWmMB7ycCsvOyjNHwDhzNydRgLKK4eZg55835SCpB+ln1m1qFNeQ0pIyt6D1BH4DEdF 9ezKcdsJH2ZfHWP9jvmrmqOWJC0utVqccMlHvN8/Gt90VGh+efa/AyihKhxKvA8S0vOr h2E0/5Fnc3zEhlwD9Rk6NF8huUMA02ZwY7VKnPsKext/Es+pMc6xBDdtuBmUb6xhA+bz VK2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784151660; x=1784756460; h=in-reply-to:references:from:to:cc:subject:message-id:date :content-type:content-transfer-encoding:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=VBgodXPKQuUMriRytvZ6LOP5ecvhprUS0jAzk/7/d7Q=; b=SQaNqvnZmrlNZOzCAx9L7qDRD3+FvcIOOkTKXSASuL8z34T+cYDYAY54o0lqthfOCA cSR1SqV5u6Yon479TW8GoxsMse27JlyZ/YCaM96sU+QFmWq3FrmJKikwBOnT7DNsVUb/ gU5HmbyXf8qoE6uague5q79m9hhbnUVQPHUZFw+zECAj924jNjSOmZqYqiXWV6lrgCBF e4W7RKgkLysaUAWfCBvGPU81FjbU1FsS0lSqXnQGbujuMJJbLFCzBVxaBqe6wmsF1vZe K/I3jgpvq4SBkjaDKxB9+BAM18lji7vBiRJDbXDmi8B8gbS+WO1tdL31h605dQh4AFy+ ugoA== X-Forwarded-Encrypted: i=1; AHgh+RqdJrkTkh6l/HfLrRQX7pPUtASHIUv+U82SIuZylLFxBbwcLCM4MEhYe8S/rfHMEhJiSIl4uQfAD3gU0Qs=@vger.kernel.org X-Gm-Message-State: AOJu0YwreSITVyL7zML2G1IM+MU+yAdrZd6ZeIeJOKt3AT1IBniaaSdP UomrCyaK2mQgwvcwkeBU8/6OqUapzi0tY7neQfrSDbPPVLtXqN8ESh3O/iNAMRWoRTA= X-Gm-Gg: AfdE7cmDrgN68OsDutRjLgTGM8xcFswspz1mRHXoZtfir/sWyxX9Aaol7eUdaQRKVUq 5ZbnZuDCYnunWtDBR3x+q0Ju4/LE8OyvNOc9+wVzTF+0RgxdoG2ZOX2YL0gBCUHKYcswtZ1TKKH RH332ynf/xKsePDtyNMSPGq15ekXSTHfDFYEVnx9IO0bzbsNBDTyblIstQlZGlFg1JalHr4f8rS VuGKUPwqOyEBT+0W795ZQWAXawk5rfJcvZSk0bwyLU8W6oiZdkHSPywBEKmeKVGZjendfCvjebF OZSQMzq5JbNkkuRa7BAiSQfqEWhKdHvSUvdaVXVLcoNh59KBU6YXKS3LSzTuVBB1wAlsXfxPMOJ BwGOU/QoWqa/jOtqCObL46PJj6pGjj+DNjOfxgS/zxZx0woT6QbNtv1gmaJ8YsLzo X-Received: by 2002:a05:600c:350a:b0:493:bb23:152a with SMTP id 5b1f17b1804b1-4953c28868emr49257555e9.34.1784151660586; Wed, 15 Jul 2026 14:41:00 -0700 (PDT) Received: from localhost ([2804:7f0:b765:c3e:eeab:5970:313d:2132]) by smtp.gmail.com with ESMTPSA id 00721157ae682-81e7cb44c06sm155311497b3.25.2026.07.15.14.40.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 14:40:59 -0700 (PDT) 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: Wed, 15 Jul 2026 18:40:57 -0300 Message-Id: Subject: Re: [PATCH 1/4] selftests/bpf: Install bpftool where test_progs expects to find it Cc: , , To: =?utf-8?q?Alexis_Lothor=C3=A9?= , =?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" , "Ihor Solodrai" , "Christian Brauner" From: =?utf-8?b?UmljYXJkbyBCLiBNYXJsacOocmU=?= X-Mailer: aerc 0.21.0-146-g87073a0460e3 References: <20260710-selftests-bpf_fixes-v1-0-aa24dfd6f4f9@suse.com> <20260710-selftests-bpf_fixes-v1-1-aa24dfd6f4f9@suse.com> In-Reply-To: On Mon Jul 13, 2026 at 12:32 PM -03, Alexis Lothor=C3=A9 wrote: > 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, match= ing >> the build directory layout where bpftool sits at >> $(OUTPUT)/tools/sbin/bpftool. >> >> INSTALL_RULE installs bpftool through the generic TEST_GEN_PROGS_EXTENDE= D >> 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_acc= ess >> and bpftool_metadata error out with "Failed to detect bpftool path", eve= n >> 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 testi= ng") >> 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. I'm not sure TRUNNER_EXTRA_FILES can be used like that, because it gets reset in test_maps definition. But maybe we can use a symlink like what's done in $(USE_BOOTSTRAP)bpftool > > Alexis > > [1] https://lore.kernel.org/all/20260223191118.655185-2-ihor.solodrai@lin= ux.dev/ > >> --- >> tools/testing/selftests/bpf/Makefile | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selfte= sts/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) \