From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55DDE11CA9 for ; Wed, 29 Jul 2026 00:05:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785283524; cv=none; b=qqgkqJlU5Bgjd+my930Dz3drecqdz2gvfO4Uu6lnuPRcp2P41TOkBit6l36dlZGfl7TgsK2XwytXehlKy1U3ol+A2ihDhfIk7Mhzn11w4S5nFLQuRil/+w8ceeZuGQodiXidDksdYP+cvIqELjl76DJVWFBK0mfu8AIXPHQXAUY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785283524; c=relaxed/simple; bh=ClibS5VZr39Ynp5Nd4rI1331nrsI0ExSJ0GOmOu5A6U=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=Wg2D0WMpwDa4y4zqk05Pvpba6GqhCvTN0rPrEYmW41rdDPMSQCspoBK6NGhzwHmNsUlRga8bQkC4YO0WVTkIK1Q4S+t3vkVMLeA1VUYs2Tep3A1RMjun3kRKKmqQqQ84yRbPH0E9SWBaQpUsTo4iKUk5rwibU6Ft8eTsqGypWhY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=H/WVww8d; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="H/WVww8d" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D98341F000E9; Wed, 29 Jul 2026 00:05:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785283520; bh=sNJGYw11NQat18Tq9ou2uYUtVOtt+WvgyUudOywSXf0=; h=Date:From:To:Cc:Subject:References; b=H/WVww8d48grIjl0boIyDkOWY5km06cgIJHs3JcJ7cfvKic+aPflGAtb49FSOpKr9 C2lj7xSchqaVulOOahfVbKHk6enNZxzrA2lK9LYcx/aNIrBBxwWcvv15/q47DQy3fr gbu5ZWm1Z8Q0oCYGVlE7SqDv4gE7k9miBp6KIwRWAXyIpfA1DoidZSBq+mTRzFMe9D z5DQuAYcr+pXV6XbKRXsdReq9nkFImlWsWG4KSOKSB/JsTkkctUqyh6PuC5xYixaMA uqIQEAyoPU9ruGuv/q5/3iEQs7ybgj05gDurQg/PAgxP8EX5QJ9A1Y3uCPYRyU99IK p+XT4Wg2c8tyA== Received: from rostedt by gandalf with local (Exim 4.99.4) (envelope-from ) id 1woro3-00000006UaF-20UL; Tue, 28 Jul 2026 20:05:55 -0400 Message-ID: <20260729000555.333651156@kernel.org> User-Agent: quilt/0.69 Date: Tue, 28 Jul 2026 20:05:24 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Mykyta Yatsenko Subject: [for-next][PATCH 01/16] bpf: Make btf_get_module_btf() and btf_relocate_id() non-static References: <20260729000523.093060274@kernel.org> 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=UTF-8 From: Mykyta Yatsenko Drop the static qualifier and add prototypes to so the tracing core can look up module BTF and translate ids stored by resolve_btfids (which are local to a module's split BTF) into the runtime ids used by the kernel. Used by the upcoming events///btf_ids tracefs interface. Link: https://patch.msgid.link/20260518-generic_tracepoint-v2-1-b755a5cf67bb@meta.com Signed-off-by: Mykyta Yatsenko Signed-off-by: Steven Rostedt --- include/linux/btf.h | 2 ++ kernel/bpf/btf.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/btf.h b/include/linux/btf.h index c09b7994de4e..8f8d3f7a8929 100644 --- a/include/linux/btf.h +++ b/include/linux/btf.h @@ -235,6 +235,8 @@ int btf_check_and_fixup_fields(const struct btf *btf, struct btf_record *rec); bool btf_type_is_void(const struct btf_type *t); s32 btf_find_by_name_kind(const struct btf *btf, const char *name, u8 kind); s32 bpf_find_btf_id(const char *name, u32 kind, struct btf **btf_p); +struct btf *btf_get_module_btf(const struct module *module); +__u32 btf_relocate_id(const struct btf *btf, __u32 id); const struct btf_type *btf_type_skip_modifiers(const struct btf *btf, u32 id, u32 *res_id); const struct btf_type *btf_type_resolve_ptr(const struct btf *btf, diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index c4673a54c4ba..3dbf33c0799a 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -6467,7 +6467,7 @@ struct btf *btf_parse_vmlinux(void) * split BTF ids will need to be mapped to actual base/split ids for * BTF now that it has been relocated. */ -static __u32 btf_relocate_id(const struct btf *btf, __u32 id) +__u32 btf_relocate_id(const struct btf *btf, __u32 id) { if (!btf->base_btf || !btf->base_id_map) return id; @@ -8630,7 +8630,7 @@ struct module *btf_try_get_module(const struct btf *btf) /* Returns struct btf corresponding to the struct module. * This function can return NULL or ERR_PTR. */ -static struct btf *btf_get_module_btf(const struct module *module) +struct btf *btf_get_module_btf(const struct module *module) { #ifdef CONFIG_DEBUG_INFO_BTF_MODULES struct btf_module *btf_mod, *tmp; -- 2.53.0