From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796324252; b=2CKPUV7kaj7yHoaBFwd3LsulbD27mXOUrD3K1d2umzWKEY7qzpd7qvEqmFSJceTddrj/ HVhkdrrnVwcy6D2P8bXKovRsCGlomc78B7vhiRybELzkB09HWQW7RlsK8+toyRVFACOaN gbSTqV5MVqYGPZ3exS6LKp6vJF0qHBIzyKbDnE2mHLJR3l/KgERTI4PBQuG6Bp45sBf0v xHR6gGL5irSWmnq1CvKf/JfABJocGkJyymy7RW7yHIe9an5supLSkNNfPEG+zcA+Vj42j u07lpOxx0+1vDupEOAGjbE/7BA51Pfq8RkFxg7Gxd8VeVNLrI9yIw6cxcZ9JGQmMVNA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796324252; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=ckBUJE8Asi849IccneYcYGMMbEo7eLR+8pZIwj3vugc=; b=prBg0HOnfcPFVg1um9lPm7yOsR2oRjevd97j0lAnSDfEWIT/Rti/1WZ9KQzy5xr7iR/r Lnh/Z7QB2uspyu2L2G38faBMg1o5GXUD8DDDsfbqiyfcoC0QMuMLmu7oEVD0bUcOFJzBF pWn+e0D3BeMHcaQzD7o+5HWpa4eKQqSKOvwKTMVr8bRq+p6qwveFC11pAlndD1oZ/gren iSM2YPWE7O5/SGYhMh8Jf3oh9BrYVB7f+giWnx2eZvKBw25hLNL99Go6BWOvQ7p9VgTAK zwidJ//63DvVCe/9qUNPEDGsn0qBrfyqlbk8Ta2YrsQCdaqK+Q8M7BjKzQH0kbJlsPQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ICu1MZzN; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D656606A322 for ; Thu, 3 Dec 2026 18:57:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ICu1MZzN Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04E491F0089F; Thu, 3 Dec 2026 18:57:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796324252; bh=ckBUJE8Asi849IccneYcYGMMbEo7eLR+8pZIwj3vugc=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=ICu1MZzNwQgVP6iJzE6OnHhb8NIvvTJU8Z9XAQ8eK2cXw6qO0rPC9EbBRE+zrmJG6 LyzplsH5u/+++9OnWg60D4SZcDbaqwkmvj97gvPFmjvH64We5fM2kdiH98E0WZUPj0 5vdp8RAeLpWA38P1x8VY7wWOEqpXIgjJUJQV2ktx4dihSUu/lwl0s00PJEeE/SkQTw keGzsm1POcei9AZg8I2Whj7+ugPOyGFmdco8RH2L3DAYtEuo0DZ8kkQo/Qc3XaZkJC rFuv0ymmjdc8TsCFDr+eBtZqLDXro11pHtYMjDZX0OsAXttqgpdtt0KpT6W7qfDzk8 dToj1i/Kpv8wg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v1 bpf-next 3/4] libbpf: Look up the functions of a module first Reply-To: sashiko-reviews@lists.linux.dev To: "Anton Protopopov" , bpf@vger.kernel.org In-Reply-To: <20261203172617.1137735-4-a.s.protopopov@gmail.com> References: <20261203172617.1137735-1-a.s.protopopov@gmail.com> <20261203172617.1137735-4-a.s.protopopov@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 18:57:31 +0000 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] libbpf: redundant own-BTF scan on miss in find_btf_by_prefix_kind() -- commit 22c83c9c42525589b71bc7e58f2a6c4584fceb13 Author: Anton Protopopov libbpf: Look up the functions of a module first This commit changes libbpf to search a module's own BTF types before falling back to vmlinux BTF when resolving tracing targets and tracing multi globs. > diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c > index 8ed4786e0e512..b75b94add2276 100644 > --- a/tools/lib/bpf/libbpf.c > +++ b/tools/lib/bpf/libbpf.c > @@ -11869,6 +11869,13 @@ static int find_btf_by_prefix_kind(const struct = btf *btf, const char *prefix, > */ > if (ret < 0 || ret >=3D sizeof(btf_type_name)) > return -ENAMETOOLONG; > + /* > + * A function of a module first, then the one of vmlinux, which the > + * dedup of BTF merges a module function of the same prototype into > + */ > + ret =3D btf__find_by_name_kind_own(btf, btf_type_name, kind); > + if (ret > 0 || !btf__base_btf(btf)) > + return ret; > return btf__find_by_name_kind(btf, btf_type_name, kind); > } [Severity: Low] Should the fallback call btf__find_by_name_kind() on the base BTF rather th= an btf? When the symbol is absent from both btf and its base BTF, btf__find_by_name_kind(btf, ...) searches base_btf and then scans btf's own types a second time. For an unqualified attach name, find_kernel_btf_id() iterates over all loaded module BTFs, doubling the own-BTF scan for every non-matching module. Saving base_btf =3D btf__base_btf(btf) and falling back to btf__find_by_name_kind(base_btf, btf_type_name, kind) avoids the second sca= n. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203172617.1137= 735-1-a.s.protopopov@gmail.com?part=3D3