Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp121005rdh; Tue, 13 Feb 2024 11:09:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUusxwW5Pdja+jhTBNPS1M27EuAUDk+EoFo3HqeFHhEpf6yhTdZSsj+no+14e/QGrGxY1XPBNfrtWxmRAZY7hW+Ugqe1B6S2p6/RYy1Qw== X-Google-Smtp-Source: AGHT+IHHZwzlV2+VBHRmfpEF4/O9EsyL1KGQlhhOrglZvas5zy2VDPM4w5dQIr47t8AJtkiYB7k3 X-Received: by 2002:a17:906:718:b0:a39:d272:3715 with SMTP id y24-20020a170906071800b00a39d2723715mr270575ejb.37.1707851393265; Tue, 13 Feb 2024 11:09:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707851393; cv=pass; d=google.com; s=arc-20160816; b=OYaCcnRQUiIGJn4wasK5kgoHGrl4SRS3rfnFy0KoeO9H3yOJVUpigr3ceYtIWeyH4O YEM/E2ejROVQq9q7uqnNxo7sbj7pGNFtdR3AEHJ+yFmOHsvrBp9dKR+0fEZEZGM5WPdV ASTiNXBjnEgyuMv045D+MlsqNffSgEzfcwdM9rxq5JzV6w/G1QTteaN1Z/g7XiWHdhlX lmQE0H8IaHEKV+/xQhKOga0uuJKTr+kt/0IEwa1+nm77Cza+DPL74+HMmatcprdzDAwf 2rye/wf7DaKnBcMMcWAaDMK+TMk87qB6KqNTjyzg/w2cp81Sbohu1vGsIvPjSD5LrI3u Kx9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=8XH0yWsNKcUVsDPXca62EDjD6I/EfUDEuNnbhuflgzU=; fh=zjJtvRt0fvAc2wgEWlXOCgW2H3eCJ0GzhkJI7jLxnlk=; b=jVBYD35XfMma0ZTkwkfS6zxfbE0ec+PhftsczzIR8wv4T5u7IYgI0TsLx896S3UadD iMrha/l3XLgUYa186MwjjDzO0A0D9prg0cuIx4M9bQYanWavhj60iR8JPOh2tELCud3S +Czpgl4Ri/svYfVVvIKqLNrtC8Ls4MseIyQ1upAO8rni0E2Myep7TRnWwquWMA3jzjaV 0UXBlUSOWt8eoImp5SUk8pP/V8F+SyUKOvq5IVNaMyHgvDOtqYcnBQVgSD+BAceG7IVl lZLM2BTCQoWDv2PhjigE/+ll2NxDh1niPd946ximC/zveJE2FHsDi+xw8HYZ67ghCUgO Cnjg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=guqeijv6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-64137-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64137-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCUmceHIQckGfaF9wfzSzMoMvfDtVrwkExM4+AND888IZ3HPuf+AabormdG48Ep2pWoJGE4Om/JdkkgBpY1NCwB78HM0UTO4Xw6y6RZiTA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id j20-20020a170906475400b00a3cfb0102b3si906311ejs.41.2024.02.13.11.09.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 11:09:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64137-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=guqeijv6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-64137-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64137-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 am.mirrors.kernel.org (Postfix) with ESMTPS id D3E301F26927 for ; Tue, 13 Feb 2024 19:09:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0142A1CF9C; Tue, 13 Feb 2024 19:09:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="guqeijv6" Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (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 D416E5FEE5; Tue, 13 Feb 2024 19:09:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707851383; cv=none; b=VFMGR9dIz301poeZneucNZbR25Qdgof9GNp4vEH9Tw/Qg1LSRaitEe+qNXcxXOz+9p6tGqKoPvwCYhs3tcJn+U3zPdPtlPnvzblG9/jAua7P8/msw3IVB5VMCntDJarW4SxZrfBZ+Ie9a/PME4GfaUF+6M6Cq0ItGfxhsSbVAGY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707851383; c=relaxed/simple; bh=0Sm0s4Jm6aoUjproFL7WupviqfKH/hZAqv9IO+XvGAE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=rPOOylXYrOLNHKcVjGtwLWlWLsWbYYYJ3JMziHsPsehm6OQ23StzANnFAuDeW9DIFgg1RC5B8i5j+BoKTkPWyuVJ2UP/ZstgQa8ohr7GHJOQAFvqkxGeUHPvH+rh5rtcEXuEOeVG5fo1+BdfV+Tf9tdMiCVgHnb0GpiKvoUI4wo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=guqeijv6; arc=none smtp.client-ip=209.85.210.177 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-pf1-f177.google.com with SMTP id d2e1a72fcca58-6e10614c276so294526b3a.3; Tue, 13 Feb 2024 11:09:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707851381; x=1708456181; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8XH0yWsNKcUVsDPXca62EDjD6I/EfUDEuNnbhuflgzU=; b=guqeijv6HVF66yiJ+xpRPALOitiZXTqt2g27B9tdsHgDnfZVUzr3jExtv/wwE2PH3L mZ2fM0pwsmAFQbQecZMGaxWAtoXTpyeZhLv59fsEweerXYTcHALNldAmV0WAypMX2iQQ kd1jV6soC9EWR9JbgEbgUmt877obUwId6A2t9hETr//dV3h66Gpp3ruzw1NVj8xL9rrM pv2iV881o0isIvfuXBXacWQ2PTYTIU1RuCvPDcpvGMm46/o/d5nUg5Rwj7JwaeGB1F3Y kAtGxfEfwDqdvKCBfpLkSiNoAvVePyv47E0vm0Y/TgiPyX9U2Aoj62ylUPyMduwVVYs5 IWww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707851381; x=1708456181; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8XH0yWsNKcUVsDPXca62EDjD6I/EfUDEuNnbhuflgzU=; b=kTGodVtnXWf7FMv2az4Jpp9TaZbXb97zQNwx5HCTdZMICxR2a/ux/2hiEUKfmcUHJq /8wAiChtFvr+QJpOCrWEjAhmQP42Ep7mBcVvkdIT/6sAn1ONzlwCvITGZ7J5FkHRN0l1 P6bVIGhDCyHQetJ+uFZNXSJMcJq9lqxpqok6FtM1fKGvn8ibwbNozs3qCmx4R7TiI2lm K5Q0Gz99uJLCWOKVzB2/N3kbsKj+NJLDwNkl8GLRcA1cyEzJSnfWyeS1Y+mSR/lscxs+ 6MyCzMDJ/0Gq8CaZ02qqb2ZkmB/0f4jP0PcXqDlLg/L8a/IGZlP8uES6r8FsRSPbpF/p MNWA== X-Forwarded-Encrypted: i=1; AJvYcCXR2/hoUkTN5er7SS+fJJD6MYdnHkSjjwWHqLiQBKdIY9x8pCwaab21tKRvO1TSYdXFzTbucqVTTuOu07YJ8YuRhvIwza/cXvucVpXU X-Gm-Message-State: AOJu0YzlDwrPNr+5fBH2vbJBm35NlW5k9wIrNv61GeFN/NZKBKf9i316 o9tcO/iym45Y3TQBluoT9yaXNqJXaWbxyXLzBUKMt17OV+yBbYht+VRm6n8JiXxQwbyCD+mIhUZ //JLUvgYOauIT9zUjsdzV95B4gqQ= X-Received: by 2002:a05:6a21:1c87:b0:19e:b95e:16f2 with SMTP id sf7-20020a056a211c8700b0019eb95e16f2mr479511pzb.25.1707851381017; Tue, 13 Feb 2024 11:09:41 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Andrii Nakryiko Date: Tue, 13 Feb 2024 11:09:29 -0800 Message-ID: Subject: Re: [PATCH bpf-next v2 0/2] bpf, bpftool: Support dumping kfunc prototypes from BTF To: Daniel Xu Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, andrii@kernel.org, olsajiri@gmail.com, quentin@isovalent.com, alan.maguire@oracle.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Feb 4, 2024 at 1:06=E2=80=AFPM Daniel Xu wrote: > > This patchset enables dumping kfunc prototypes from bpftool. This is > useful b/c with this patchset, end users will no longer have to manually > define kfunc prototypes. For the kernel tree, this also means we can > drop kfunc prototypes from: > > tools/testing/selftests/bpf/bpf_kfuncs.h > tools/testing/selftests/bpf/bpf_experimental.h > > Example usage: > > $ make PAHOLE=3D/home/dxu/dev/pahole/build/pahole -j30 vmlinux > > $ ./tools/bpf/bpftool/bpftool btf dump file ./vmlinux format c | = rg "__ksym;" | head -3 > extern void cgroup_rstat_updated(struct cgroup *cgrp, int cpu) __= weak __ksym; > extern void cgroup_rstat_flush(struct cgroup *cgrp) __weak __ksym= ; > extern struct bpf_key *bpf_lookup_user_key(u32 serial, u64 flags)= __weak __ksym; > > Note that this patchset is only effective after the enabling pahole [0] > change is merged and the resulting feature enabled with > --btf_features=3Ddecl_tag_kfuncs. > > [0]: https://lore.kernel.org/bpf/cover.1707071969.git.dxu@dxuuu.xyz/ > > =3D=3D=3D Changelog =3D=3D=3D > > From v1: > * Add __weak annotation > * Use btf_dump for kfunc prototypes > * Update kernel bpf_rdonly_cast() signature > > Daniel Xu (2): > bpf: Have bpf_rdonly_cast() take a const pointer > bpftool: Support dumping kfunc prototypes from BTF I've applied patch #1 as it's a good change regardless. Please send v2 for patch #2. > > kernel/bpf/helpers.c | 4 ++-- > tools/bpf/bpftool/btf.c | 45 +++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 47 insertions(+), 2 deletions(-) > > -- > 2.42.1 >