* Wangnan (F) <wangnan0@xxxxxxxxxx> wrote:[SNIP]
What do you mean, as this does not parse for me.
In summary, your either-or logic doesn't hold in BPF world. A BPF
program can only access perf event in a highly restricted way. We
don't allow it calling perf_event_read_local() across core, so it
can't.
Urgh, that's still horridly inconsistent. Can we please come up with aBPF program and kernel module are two different worlds as I said before.
consistent interface to perf?
I don't think making them to share a common interface is a good idea because
such sharing will give BPF programs too much freedom than it really need, then
it will be hard prevent them to do something bad. If we really need kernel
interface, I think what we need is kernel module, not BPF program.
We obviously can (and very likely should) make certain perf functionality
available to BPF programs.
It should still be a well defined yet flexible iterface, with safe behavior,
obviously - all in line with existing BPF sandboxing principles.
'Kernel modules' don't enter this consideration at all, not sure why you mention
them - all this functionality is also available if CONFIG_MODULES is turned off
completely.
Thanks,
Ingo