BPF List
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: Jiri Olsa <olsajiri@gmail.com>, bpf@vger.kernel.org
Subject: Re: kfunc use newbie question
Date: Mon, 30 Oct 2023 14:19:41 +0100	[thread overview]
Message-ID: <ZT+tbVP29nH29gbh@krava> (raw)
In-Reply-To: <ZT+NNS1kgBRdfZnW@nanopsycho>

On Mon, Oct 30, 2023 at 12:02:13PM +0100, Jiri Pirko wrote:
> Mon, Oct 30, 2023 at 11:14:51AM CET, olsajiri@gmail.com wrote:
> >On Mon, Oct 30, 2023 at 10:35:59AM +0100, Jiri Pirko wrote:
> >> Hi BPF :)
> >> 
> >> I'm trying to use bpf_dynptr_from_skb() kfunc in my program. I compiled
> >> it with having following declaration in the bpf .c file:
> >> extern int bpf_dynptr_from_skb(struct __sk_buff *skb, __u64 flags,
> >>                                struct bpf_dynptr *ptr__uninit) __ksym;
> >> 
> >> I have all "BPF/BTF" kernel config options on. During load,
> >> I'm still getting:
> >> 
> >> libbpf: failed to find BTF for extern 'bpf_dynptr_from_skb': -3
> >
> >heya,
> >error -3 suggests there's no BTF generated, is there .BTF section
> >in the object ? did you compile with -g ?
> 
> w/o -g. If I compile with -g, I'm getting this:
> libbpf: failed to find valid kernel BTF
> libbpf: Error loading vmlinux BTF: -3

hum, this one seems straightforward missing vmlinux btf,
(check btf__load_vmlinux_btf in tools/lib/bpf/btf.c)
could you please send your .config?

jirka

> 
> 
> >
> >jirka
> >
> >> 
> >> I'm pretty much clueless about what may be wrong. Documentation didn't
> >> help me either :/
> >> 
> >> Any idea what I may be doing wrong?
> >> 
> >> Thanks
> >> 
> >> Jiri
> >> 

  reply	other threads:[~2023-10-30 13:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30  9:35 kfunc use newbie question Jiri Pirko
2023-10-30 10:14 ` Jiri Olsa
2023-10-30 11:02   ` Jiri Pirko
2023-10-30 13:19     ` Jiri Olsa [this message]
2023-10-30 13:45       ` Jiri Pirko

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=ZT+tbVP29nH29gbh@krava \
    --to=olsajiri@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=jiri@resnulli.us \
    /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