From: Alan Maguire <alan.maguire@oracle.com>
To: Kui-Feng Lee <sinquersw@gmail.com>,
Jason Ling <jasonling@google.com>,
bpf@vger.kernel.org
Subject: Re: Is fentry/fexit support possible with an external BTF?
Date: Tue, 24 Jan 2023 23:15:10 +0000 [thread overview]
Message-ID: <7f2372c1-73c9-cd8a-c0e8-30d3fef8c23e@oracle.com> (raw)
In-Reply-To: <296fcfac-9acd-9462-871c-b450fd140fa3@gmail.com>
On 24/01/2023 18:26, Kui-Feng Lee wrote:
> On 1/23/23 16:21, Jason Ling wrote:
>> Some context:
>>
>> The devices I am interested in have a small kernel partition (~16MB).
>> Building the kernel with CONFIG_DEBUG_INFO_BTF=y increases the kernel
>> size by about ~1.7M.
Would it help in this environment if vmlinux BTF was in a module?
I've been exploring supporting CONFIG_DEBUG_INFO_BTF=m which
would involve having a vmlinux_btf module that could be loaded
on demand.
Alan
>> So I've tried to use an external BTF (generating my own vmlinux BTF
>> and placing it on a more spacious partition) but it seems like my
>> eBPFs that attach to fexit hooks now fail loading. According to some
>> comments in libbpf this seems to be expected.
>>
>> e.g an eBPF program that looks like this
>>
>> SEC("fexit/ksys_unshare")
>> int BPF_PROG(handle_exit, unsigned long unshare_flags, int rv) {
>> }
>>
>> fails the loading process.
>>
>>
>> My guess is that there is additional debug/BTF information beyond what
>> is available in vmlinux BTF that gets linked into vmlinuz and without
>> this information the attaching to certain hooks fail.
>
> IIRC, the verifier running in the kernel also needs BTF to verify the code.
>
> That means you need a way to load BTF to kernel manually as well.
>
>
>>
>> So my question is:
>>
>> is there a way to achieve my goal of using a kernel that has been
>> built with CONFIG_DEBUG_INFO_BTF=n and still be able to use
>> fentry/fexit type hooks?
next prev parent reply other threads:[~2023-01-24 23:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-24 0:21 Is fentry/fexit support possible with an external BTF? Jason Ling
2023-01-24 18:26 ` Kui-Feng Lee
2023-01-24 23:15 ` Alan Maguire [this message]
2023-01-24 23:17 ` Jason Ling
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7f2372c1-73c9-cd8a-c0e8-30d3fef8c23e@oracle.com \
--to=alan.maguire@oracle.com \
--cc=bpf@vger.kernel.org \
--cc=jasonling@google.com \
--cc=sinquersw@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox