Re: [PATCH bpf-next 6/9] samples: bpf: refactor test_overhead program with libbpf
Andrii Nakryiko <[email protected]>
| Newsgroups | org.kernel.vger.xdp-newbies,org.kernel.vger.bpf,org.kernel.vger.netdev |
|---|---|
| Message-ID | <CAEf4BzaF9Uqfq1vQey6wBMjcfbg6aGUQfNk5Yj=vtzsfAb3WsQ@mail.gmail.com> |
On Tue, Nov 17, 2020 at 6:57 AM Daniel T. Lee <[email protected]> wrote: > > This commit refactors the existing program with libbpf bpf loader. > Since the kprobe, tracepoint and raw_tracepoint bpf program can be > attached with single bpf_program__attach() interface, so the > corresponding function of libbpf is used here. > > Rather than specifying the number of cpus inside the code, this commit > uses the number of available cpus with _SC_NPROCESSORS_ONLN. > > Signed-off-by: Daniel T. Lee <[email protected]> > --- > samples/bpf/Makefile | 2 +- > samples/bpf/test_overhead_user.c | 82 +++++++++++++++++++++++--------- > 2 files changed, 60 insertions(+), 24 deletions(-) > LGTM. Acked-by: Andrii Nakryiko <[email protected]> [...]