summaryrefslogtreecommitdiff
path: root/tools/bpf/bpftool/gen.c
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2022-02-09 15:19:58 -0800
committerDaniel Borkmann <daniel@iogearbox.net>2022-02-10 23:31:51 +0100
commit6fe65f1b4db3fff305896e997c2804b7b42236ce (patch)
tree3ce3bc5eba4cef9417e0416db1cfec1fc1f24c8e /tools/bpf/bpftool/gen.c
parentb1d18a7574d0df5eb4117c14742baf8bc2b9bb74 (diff)
libbpf: Prepare light skeleton for the kernel.
Prepare light skeleton to be used in the kernel module and in the user space. The look and feel of lskel.h is mostly the same with the difference that for user space the skel->rodata is the same pointer before and after skel_load operation, while in the kernel the skel->rodata after skel_open and the skel->rodata after skel_load are different pointers. Typical usage of skeleton remains the same for kernel and user space: skel = my_bpf__open(); skel->rodata->my_global_var = init_val; err = my_bpf__load(skel); err = my_bpf__attach(skel); // access skel->rodata->my_global_var; // access skel->bss->another_var; Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Yonghong Song <yhs@fb.com> Acked-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20220209232001.27490-3-alexei.starovoitov@gmail.com
Diffstat (limited to 'tools/bpf/bpftool/gen.c')
0 files changed, 0 insertions, 0 deletions