Re: [PATCH v3 05/18] rv: Add generic monitor event tracepoints and BPF kfuncs
From: Gabriele Monaco
Date: Wed Dec 02 2026 - 11:41:27 EST
On Tue, 2026-12-01 at 21:25 +0000, Alexei Starovoitov wrote:
> Porbably no need for copies.
> If your names are in rodata than __str suffix on kfunc args will do. Like:
>
> void bpf_rv_da_event(const char *mon__str, const int *id__nullable,
> const char *state__str, const char *event__str,
> const char *next_state__str);
I tried that but since the exact rodata string isn't known (I do something like
states[id] with variable id) the verifier didn't quite like it.
I'm not too familiar with the verifier so I should play more. Or I can probably
think of some other alternative. (e.g. let the kernel know about the list of
string in some RO variable/map and pass only the id). Or again, memcpys.
> > If you don't have anything against using kfuncs themselves and passing a
> > bunch of (structured) strings, I can start drafting that and see how it
> > behaves.
>
> No objections. I still feel you're too attached to printk-like output.
> You could have used existing ringbuf and passed binary data to user daemon.
> With event_monitor(state, event, next) you kinda doing one step in that
> direction.
Alright, fair.
I'm going to try that way.
Thanks,
Gabriele