From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.232 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795560769; b=nzZSRU68hRzVwFQ/zR+zBo/u3Sj/5VdocIq6O23LiWrKW46ym8BONCXL1yDkX3u66kYh oUfwIbNdpmBgJVIF0g/4ybGfsbLGT80jiHeCByIugySDQBbKFPYDAnA6aE75IO5y51+s+ 8O7W/OpXWeMVjDiRUI+6ijsFSNc55Vd9AE1YlmIicg6Zou7mioO6lotjVJOMYGwefjXpH ExWTLIRDFklSnDuY5ape/JnfChdAdiGBHwghYMsrolQbBJAnndqZ/p8pZRdeYd8p5ZccP NjcCmjtiKrcpfG95jZeGM/iG/g/Or9spF2c1nztVoncpGKjLDpR9Yu3eDGAFdl6kzdQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795560769; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=yQKyOvawwuO1atA3WB4zRh3RGdgT+yLKezQY+myigjY=; b=D8NW6yiQfwjDMZ2cUlWSqoHaXvoB1LP+AIStHD78aWZXnNovyEsQvfYLMC5//3Irmghr +P1rTd01IaQA/h2+YXNTD0u14l5cK8easNYvUI55Xnch/2mlOFWhHcLezx9qhCyCK89qf FtmYW3PJkfZn3ywepcJTRxl7brmgqAGsl60bOl6PWFgLsA7h9dKKh12dY/xG5vHI5xGfl bnAj/ukerem9ZhfyTPHk1yCeJpiJDobsoBr6hLjn0Mnii+my1zw6crhZ2cWpuUkaSW6gm Xsx+9wg73wZTG20DgLw1c5aR6cUXSjg9pYolzILfrnRR8T58C54vbe6uATY466ECtmQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=xBNIXxBk; arc=none smtp.remote-ip=91.218.175.232 Received: from mta0.migadu.com (out-232.mta0.migadu.com [91.218.175.232]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DC17606A321 for ; Tue, 24 Nov 2026 22:52:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3DC17606A321 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=xBNIXxBk X-Envelope-To: sched-ext@lists.linux.dev DKIM-Signature: a=rsa-sha256; bh=7c2eK5ZRoYhnY7geiYrgE1DFXHDzKCbM54tHz+l+sEo=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795560767; v=1; x=1796165567; b=xBNIXxBk2CRHLR+Tp+h7cgJ9NofnLvGZsK2zRJb3ARl2dQR72hbn/La/SJFu0TnvSwZ5/W4n YzCcEYqNb3g8+RXTI6wF1rBrtBl/Q3rh1raWwGpoK4AkqKgdKYm28iuMQFiBzo+/sUMu3pQMmvA gv9F0NioGN3bRnZGcEoI7enw= X-Envelope-To: sched-ext@lists.linux.dev Received: by smtp.migadu.com with ESMTPS id 2315a5e7c2c7fbb3; Tue, 24 Nov 2026 22:52:47 +0000 X-Mizu-Trace-ID: 2315a5e7c2c7fbb3 X-Migadu-Flow: FLOW_OUT Message-ID: Date: Tue, 24 Nov 2026 15:52:42 -0700 X-Mailing-List: sched-ext@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH bpf-next v2 1/6] libbpf: Separate interfaces shared with in-tree tools To: Andrii Nakryiko Cc: Quentin Monnet , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Eduard Zingerman , Kumar Kartikeya Dwivedi , Alan Maguire , Emil Tsalapatis , Jiri Olsa , Song Liu , Tejun Heo , Yonghong Song , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, sched-ext@lists.linux.dev References: <20261121003403.2928928-1-ihor.solodrai@linux.dev> <20261121003403.2928928-2-ihor.solodrai@linux.dev> Content-Language: en-US From: Ihor Solodrai In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2026-11-24 3:47 p.m., Andrii Nakryiko wrote: > On Mon, Nov 23, 2026 at 9:44 AM Ihor Solodrai wrote: >> >> On 2026-11-23 7:55 a.m., Quentin Monnet wrote: >>> 2026-11-20 17:33 UTC-0700 ~ Ihor Solodrai >>>> resolve_btfids links libbpf statically and uses its BTF header >>>> accessor, field iterator and SHA-256 helper. libbpf_internal.h >>>> also defines logging macros and poisons kernel integer typedefs, >>>> so resolve_btfids wraps the hash helper in a separate source file. >>>> >>>> Move the shared declarations to libbpf_tools.h and use them >>>> directly in resolve_btfids. The header is for in-tree tools and >>>> stays uninstalled. No shared-library symbols change. >>> >>> >>> Hi Ihor, the change in bpftool's Makefile looks OK and I understand the >>> motivation for libbpf_tools.h for resolve_btfids. But I find it a bit >>> confusing to move away from libbpf_internal.h only partially for >>> bpftool, and to have a split dependency on both libbpf_internal.h and >>> libbpf_tools.h. Have you considered moving the other objects that >>> bpftool requires from libbpf_internal.h to libbpf_tools.h as well? >> >> Hi Quentin, thank you for taking a look. >> >> I haven't considered that, and it seems like a good idea to me. >> >> The way I thought about this is that in practice libbpf has at least >> three levels of (userspace, non-BPF) API: >> - public API defined in the symbols map >> - internal API, shared helpers and such >> - API for the in-tree users, that doesn't make sense to make >> public Hi, Andrii. Just saw your comment after posting. Please see: https://lore.kernel.org/bpf/10ad779b-708b-4b0b-b6af-54f3d7414f82@linux.dev/ > > well, I don't think encouraging this with extra "libbpf_tools.h" is a > good thing. I'd prefer to keep stuff like that in libbpf_internal.h > (because it is meant to be internal to libbpf, with bpftool and > resolve_btfids being a special case) > > Do I understand correctly that the problem is mostly in poisoning? > should we just guard those pragmas with #ifdef check and let > resolve_btfids disable that, if desired? Yes, this appears to be the root cause so to speak. An #ifdef may help as well, yes. > >> >> I felt like the last one needs a header to reduce the amount of >> copy-paste. I don't like "libbpf_tools.h", it gives me "10k loc >> utils file" vibes, but I couldn't come up with a better name. Open >> to suggestions. >> >> I need to look into bots' feedback, and I expect there will be a v3, >> so I'll see what bpftool parts can be moved to the new header as well. >> >> Thanks! >> >>> >>> Thanks, >>> Quentin >> >>