Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp3027905rdd; Sat, 13 Jan 2024 11:50:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGq6xwx25CRAXtnMan7ZVjTPnI88fTA57sj9CZdO2asrIy6DgcUzCdRxJOxejzwZzSdfgk2 X-Received: by 2002:a05:6e02:219b:b0:360:5e76:4b4f with SMTP id j27-20020a056e02219b00b003605e764b4fmr5428023ila.47.1705175414821; Sat, 13 Jan 2024 11:50:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705175414; cv=none; d=google.com; s=arc-20160816; b=BMdOhGk4s0Ru6VlGVcGQtWGrshOqBLDd4ajhGP33qcu0VOr+tDX3hINq/3SPsZeVIO lzpwpt65qz2/B0HPowxo360Z6ulnQvAXkoyHPwAZ9H2jHTSwLHqr07DuDbDg91Hn4HUa 3hko4PUPc+1BvVr3rXajNI67JsFOsDNUJA75oKHgaIsdAGhxt88uKi3aqrtgSTIopNlR TeLgmuE48razhro9zxNHX6aH0ke8507FZddWXSiQOjNKo50ys2uPeMdzPsPo7AOISRrW pYjh7Or/0T4VOki8HxFYCr2FfCL6ROJmDahyVh+7zz/bTpsxzQgBoN8GjjW3wtr9oFf5 NtSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:date:from:dkim-signature; bh=1HammmbmKVZr2MOKZbNt/I1t0w3fHw/pSzTd2SPHXwE=; fh=R+8bQ2mQR4/6KGfTC3ms5R8sz8mfft4PwhwVJCRASUU=; b=I9qJxCe7tegE6vgKvQI4SXAXsUCWUKyolb06/C/tejtsZaNDpEXRz4Kf6L+2nAdLrO 6SoK7RzXXOdlYgfNJ6RbLEciDow+fsHoiK7P0x3AA/T141/fM2Gdacwr3ZFe+4BVoton 6rFoD/63u3nPYzC2K4ar1Bj2uViAqRYKdr+2JvE40XLZEk+twRjGvYjO8QpsIvslgka5 0pV4uhJ38d+7VZoyI181dr+heLtjbUrC+3yRjlsoYcF06uK5kntLo4zXs8uZFLP2zFyt EqpTcbihTMe7N/OLg+Dnre1HNlJEhC0MQxaLNP6nkWnnRNzsKZ25/yboyPj0X8IjI5G2 HveA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WwoW5vCB; spf=pass (google.com: domain of linux-kernel+bounces-25363-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25363-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id jx5-20020a170903138500b001d453cffba2si5612684plb.391.2024.01.13.11.50.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 11:50:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25363-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WwoW5vCB; spf=pass (google.com: domain of linux-kernel+bounces-25363-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25363-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 24D48B224AF for ; Sat, 13 Jan 2024 19:49:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0721910797; Sat, 13 Jan 2024 19:49:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WwoW5vCB" Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 BAE6B63CB; Sat, 13 Jan 2024 19:49:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-40e72d26a40so474075e9.2; Sat, 13 Jan 2024 11:49:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705175357; x=1705780157; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=1HammmbmKVZr2MOKZbNt/I1t0w3fHw/pSzTd2SPHXwE=; b=WwoW5vCBL3h7lbECyKBVHtgbzwX8+k72jbjt8QU74bmUO1szbPbgdDO2fFvvSTRwk5 h2rVvPFaFrRji/ACDztJZT5LswOYqwPWe8wymYmtiIWMiK+NI/aSeLx1y8hdURHAnvrb FNmxXQkmTwrvuiZhz/iieE7npT6qYW6fOoSFUga/2xaVHx0Jy+mG+6Sk32CvFn0DzxvF XJ1ecKOR4SVW3wlwtBD28G8pzpZ3fKy64CA8Sro3Xd0/AA/lHFNzS2juL7lXIrW1T0VK A6ast1EpGUSHvWqPhB0lC7A0ggroAGkpv+dWgIGji1BPEy2gZP3WgPy4GiIxi28Ta3xv jHaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705175357; x=1705780157; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1HammmbmKVZr2MOKZbNt/I1t0w3fHw/pSzTd2SPHXwE=; b=k9BaPTk8SaUyxVLcXhcaz6fRsC4/v34K2injmUrbNu9EJQBoJpqVsKOb76IrcaGAGy xswuPk8J37Ja8CHreJF/hJyNs8TBq6vcGQbgpbodVaH66bGmL/WDCgFAkV6aa2ZxtWNu RRwTrBgp6AQcY4gZt4VPnfITL4JSmJisPe1D1dBpp+LbJ0aGxutsX6W0PKfG3UWGtPjT JvKHxTATIIiROoPCwvgLmKkY2HVJLcAu3i6b7LJQz3MaO8aT/65qtgXGO2UuTZTvJswH GoBPiybL/B7n3mL+NfpR8BumsCEhNmAUKaMepUvjNwm2M0qQN+HJNLv/OC5txvKmsHq+ Qw0A== X-Gm-Message-State: AOJu0YzNTQ6x55Nk4ZEfkwC1BlhUPnX+k7juvmXuM9Z4qXIUVs9nNF3b WyQ8+3c5l6pFHsKpkCcWTvQ= X-Received: by 2002:a1c:7510:0:b0:40e:50e9:9b0c with SMTP id o16-20020a1c7510000000b0040e50e99b0cmr1665802wmc.181.1705175356706; Sat, 13 Jan 2024 11:49:16 -0800 (PST) Received: from krava (ip-94-113-247-30.net.vodafone.cz. [94.113.247.30]) by smtp.gmail.com with ESMTPSA id a22-20020a05600c349600b0040d83ab2ecdsm10412099wmq.21.2024.01.13.11.49.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 11:49:16 -0800 (PST) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Sat, 13 Jan 2024 20:49:14 +0100 To: Daniel Xu Cc: Jiri Olsa , linux-input@vger.kernel.org, coreteam@netfilter.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-trace-kernel@vger.kernel.org, fsverity@lists.linux.dev, bpf@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, cgroups@vger.kernel.org, alexei.starovoitov@gmail.com, quentin@isovalent.com, alan.maguire@oracle.com, memxor@gmail.com Subject: Re: [PATCH bpf-next v3 0/3] Annotate kfuncs in .BTF_ids section Message-ID: References: <2dhmwvfnnqnlrui2qcr5fob54gdsuse5caievct42trvvia6qe@p24nymz3uttv> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, Jan 13, 2024 at 09:17:44AM -0700, Daniel Xu wrote: > Hi Jiri, > > On Sat, Jan 13, 2024 at 02:57:40PM +0100, Jiri Olsa wrote: > > On Fri, Jan 12, 2024 at 01:03:59PM -0700, Daniel Xu wrote: > > > On Fri, Jan 12, 2024 at 05:20:39PM +0100, Jiri Olsa wrote: > > > > On Sat, Jan 06, 2024 at 11:24:07AM -0700, Daniel Xu wrote: > > > > > === Description === > > > > > > > > > > This is a bpf-treewide change that annotates all kfuncs as such inside > > > > > .BTF_ids. This annotation eventually allows us to automatically generate > > > > > kfunc prototypes from bpftool. > > > > > > > > > > We store this metadata inside a yet-unused flags field inside struct > > > > > btf_id_set8 (thanks Kumar!). pahole will be taught where to look. > > > > > > > > > > More details about the full chain of events are available in commit 3's > > > > > description. > > > > > > > > > > The accompanying pahole changes (still needs some cleanup) can be viewed > > > > > here on this "frozen" branch [0]. > > > > > > > > so the plan is to have bpftool support to generate header file > > > > with detected kfuncs? > > > > > > Yep, that's the major use case. But I see other use cases as well like > > > > ok, any chance you could already include it in the patchset? > > would be a great way to test this.. maybe we could change > > selftests to use that > > I haven't start working on that code yet, but I can. > > Here is my plan FWIW: > > 1. Bump minimum required pahole version up. Or feature probe for > kfunc decl tag support. Whatever is the standard practice here. > > 2. Teach bpftool to dump kfunc prototypes, guarded behind a flag. > > 3. Flip bpftool flag on in selftest build and remove all manual kfunc > prototypes atomically in 1 commit. > > I thought it'd be nicer to do it incrementally given all the moving > pieces. But if we want to land it all at once that is ok by me too. I think it'd be best to try the whole thing before we merge the change to pahole.. I guess the tests changes can come later, but would be great to try the kfunc dump and make sure it works as expected jirka