From: "Toke Høiland-Jørgensen" <toke@kernel.org>
To: Michael Zimmermann <sigmaepsilon92@gmail.com>,
Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: bpf <bpf@vger.kernel.org>
Subject: Re: BPF maps don't work without CONFIG_TRACING/CONFIG_FTRACE
Date: Thu, 12 May 2022 09:48:17 +0200 [thread overview]
Message-ID: <87czgji43i.fsf@toke.dk> (raw)
In-Reply-To: <CAN9vWDJHrYUVFtBU-cAz6trvJAx903hGgO2Yj6=3Bt2CjS61Yg@mail.gmail.com>
Michael Zimmermann <sigmaepsilon92@gmail.com> writes:
> On Thu, May 12, 2022 at 5:21 AM Andrii Nakryiko
> <andrii.nakryiko@gmail.com> wrote:
>>
>> On Mon, May 9, 2022 at 10:12 PM Michael Zimmermann
>> <sigmaepsilon92@gmail.com> wrote:
>> >
>> > Thank you for your answer.
>> > What I'm ultimately trying to do is: Use aya-rs to watch egress on a
>> > network interface and notify userspace through a map (for certain IPs
>> > only).
>> >
>> > In my actual use case, the userspace is supposed to do more complex
>> > stuff but for testing I simply logged the receival of a message
>> > through the BPF map on the console. And that is what I expect to
>> > happen and which does happen as long as CONFIG_TRACING/CONFIG_FTRACE
>> > are active. If not, I simply never receive any messages on any map.
>> >
>> > I've also tried this using an XDP program which sends a message every
>> > time it sees a packet. And while the program seemed to be
>> > working(since it did block certain traffic), I never saw any data in
>> > the map when those configs were disabled.
>> >
>> > Also, I'm giving you two configs(tracing and ftrace) since the other
>> > one seems to get y-selected automatically if one of them is active.
>>
>> Please don't top post, reply inline instead.
> Sorry for that, GMail does that by default and even hides that it's
> quoting at all.
>
>>
>> I don't think we have enough to investigate here, even "receive any
>> messages on any map" is so ambiguous that it's hard to even guess what
>> you are really trying to do. BPF maps are not sending/receiving
>> messages. So please provide some pieces of code and what you are doing
>> to check. CONFIG_TRACING and CONFIG_FTRACE shouldn't have any effect
>> on functioning of BPF maps, so it's most probably that you are doing
>> something besides BPF map update/lookup, but you don't provide enough
>> information to check anything.
>
> An aya project I tested where I don't receive any events:
> https://github.com/aya-rs/book/tree/6b52a6fac5fa3e5a1165f98591b2eaff9692048a/examples/myapp-03
It's using a PERF_EVENT_ARRAY map to send events to userspace. This
requires CONFIG_BPF_EVENTS to work, which depends on CONFIG_PERF_EVENTS.
Not sure if this depends on CONFIG_TRACING specifically, but maybe you
disabled PERF_EVENTS as well?
-Toke
next prev parent reply other threads:[~2022-05-12 7:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-03 8:03 BPF maps don't work without CONFIG_TRACING/CONFIG_FTRACE Michael Zimmermann
2022-05-10 0:00 ` Andrii Nakryiko
2022-05-10 5:12 ` Michael Zimmermann
2022-05-12 3:21 ` Andrii Nakryiko
2022-05-12 4:28 ` Michael Zimmermann
2022-05-12 7:48 ` Toke Høiland-Jørgensen [this message]
2022-05-12 8:36 ` Michael Zimmermann
2022-05-12 9:13 ` Toke Høiland-Jørgensen
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=87czgji43i.fsf@toke.dk \
--to=toke@kernel.org \
--cc=andrii.nakryiko@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=sigmaepsilon92@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.