This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Getting systemtap examples working with --bpf backend
On Wed, May 22, 2019 at 5:12 PM William Cohen <wcohen@redhat.com> wrote:
> We can create/update, delete and lookup map information, both in BPF programs and in user-space. User-space map interactions are done via the BPF syscall. Their function signatures are slightly different to those of their in-kernel BPF program equivalents. In tools/lib/bpf/bpf.c wrappers for these actions are present:
Yep. You can see in bpfinterp.cxx how the BPF-level helpers are then
implemented in terms of the syscalls.
> This technique might also be useful for initialization information like syscall numbers<->names and other constants rather than trying to put everything into space constrained bpf code. However, not sure how that is going to be managed if multiple systemtap scripts are kicked off.
Each stapbpf invocation creates its own separate set of maps to track
global variables, so there is no conflict. (What would be more
difficult is if you wanted to share a map between different stapbpf
processes for some reason.)
There was an upcoming BPF extension being discussed at LPC 2018 which
would allow loading constant data sections into the BPF program's
address space. Having that would simplify things a lot.