of BPF MAP definition.
But this commit solves the problem by fixing this from 'queue_stats' map
struct hvm_queue_stats -> hbm_queue_stats.
Fixes: 36b5d471135c ("selftests/bpf: samples/bpf: Split off legacy stuff from
bpf_helpers.h")
Signed-off-by: Daniel T. L
not used on this program.
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- add static at global variable and drop {}
- fix return error code on exit
samples/bpf/Makefile | 2 +-
samples/bpf/ibumad_kern.c | 26 +++---
samples/bpf/ibumad_user.c | 71
his commit add the executable permission to shell script
files.
Fixes: f74599f7c5309 ("bpf: Add tests and samples for LWT-BPF")
Signed-off-by: Daniel T. Lee
---
samples/bpf/lwt_len_hist.sh | 2 ++
samples/bpf/test_lwt_bpf.sh | 0
2 files changed, 2 insertions(+)
mode change 100644 =
with the latest kernel BPF and causes confusion.
Also, this commit removes the unused trace_helper and bpf_load from
samples/bpf target objects from Makefile.
Signed-off-by: Daniel T. Lee
Acked-by: Jesper Dangaard Brouer
Acked-by: Andrii Nakryiko
---
Changes in v2:
- merge commit with changing
code, this commit
uses the number of available cpus with _SC_NPROCESSORS_ONLN.
Signed-off-by: Daniel T. Lee
Acked-by: Andrii Nakryiko
---
Changes in v2:
- add static at global variable and drop {}
samples/bpf/Makefile | 2 +-
samples/bpf/test_overhead_user.c | 82
probe events, O_TRUNC
flag has been used to clear 'uprobe_events' interface.
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- add static at global variable and drop {}
- fix return error code on exit
- restore DEBUGFS macro to absolute string path
samples/bpf/Makefile
oblem that
shell script cannot find the binary object from the current path,
relative path './' has been added in front of binary.
Fixes: 554ae6e792ef3 ("samples/bpf: add userspace example for prohibiting
sockets")
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- cha
d variable
- change to destroy link even after link__pin()
- fix return error code on exit
- merge commit with changing Makefile
Changes in v3:
- cleanup bpf_link, bpf_object and cgroup fd both on success and error
Daniel T. Lee (7):
samples: bpf: refactor hbm program with libbpf
samples: bpf
Sorry for the late reply.
On Sat, Nov 21, 2020 at 11:34 AM Martin KaFai Lau wrote:
>
> On Thu, Nov 19, 2020 at 03:06:11PM +, Daniel T. Lee wrote:
> [ ... ]
>
> > static int run_bpf_prog(char *prog, int cg_id)
> > [ ... ]
> > if (!o
his commit add the executable permission to shell script
files.
Fixes: f74599f7c5309 ("bpf: Add tests and samples for LWT-BPF")
Signed-off-by: Daniel T. Lee
---
samples/bpf/lwt_len_hist.sh | 2 ++
samples/bpf/test_lwt_bpf.sh | 0
2 files changed, 2 insertions(+)
mode change 100644 =
with the latest kernel BPF and causes confusion.
Also, this commit removes the unused trace_helper and bpf_load from
samples/bpf target objects from Makefile.
Signed-off-by: Daniel T. Lee
Acked-by: Jesper Dangaard Brouer
Acked-by: Andrii Nakryiko
---
Changes in v2:
- merge commit with changing
code, this commit
uses the number of available cpus with _SC_NPROCESSORS_ONLN.
Signed-off-by: Daniel T. Lee
Acked-by: Andrii Nakryiko
---
Changes in v2:
- add static at global variable and drop {}
samples/bpf/Makefile | 2 +-
samples/bpf/test_overhead_user.c | 82
probe events, O_TRUNC
flag has been used to clear 'uprobe_events' interface.
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- add static at global variable and drop {}
- fix return error code on exit
- restore DEBUGFS macro to absolute string path
samples/bpf/Makefile |
not used on this program.
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- add static at global variable and drop {}
- fix return error code on exit
samples/bpf/Makefile | 2 +-
samples/bpf/ibumad_kern.c | 26 +++---
samples/bpf/ibumad_user.c | 71
d variable
- change to destroy link even after link__pin()
- fix return error code on exit
- merge commit with changing Makefile
Daniel T. Lee (7):
samples: bpf: refactor hbm program with libbpf
samples: bpf: refactor test_cgrp2_sock2 program with libbpf
samples: bpf: refactor task_fd_query pr
of BPF MAP definition.
But this commit solves the problem by fixing this from 'queue_stats' map
struct hvm_queue_stats -> hbm_queue_stats.
Fixes: 36b5d471135c ("selftests/bpf: samples/bpf: Split off legacy stuff from
bpf_helpers.h")
Signed-off-by: Daniel T. L
oblem that
shell script cannot find the binary object from the current path,
relative path './' has been added in front of binary.
Fixes: 554ae6e792ef3 ("samples/bpf: add userspace example for prohibiting
sockets")
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- cha
On Wed, Nov 18, 2020 at 11:10 AM Martin KaFai Lau wrote:
>
> On Tue, Nov 17, 2020 at 02:56:37PM +, Daniel T. Lee wrote:
> [ ... ]
>
> > +
> > +cleanup:
> > + if (rc != 0)
> so this test can be avoided.
>
Thanks for pointing
On Wed, Nov 18, 2020 at 2:58 PM Martin KaFai Lau wrote:
>
> On Tue, Nov 17, 2020 at 02:56:38PM +, Daniel T. Lee wrote:
> [ ... ]
>
> > + err = bpf_link__pin(link, link_pin_path);
> > + if (err < 0) {
> > + printf("err : %d\n&
On Wed, Nov 18, 2020 at 12:10 PM Andrii Nakryiko
wrote:
>
> On Tue, Nov 17, 2020 at 7:05 PM Daniel T. Lee wrote:
> >
> > On Wed, Nov 18, 2020 at 11:52 AM Andrii Nakryiko
> > wrote:
> > >
> > > On Tue, Nov 17, 2020 at 6:57 AM Daniel T. Lee
> > &g
On Wed, Nov 18, 2020 at 12:02 PM Andrii Nakryiko
wrote:
>
> On Tue, Nov 17, 2020 at 6:57 AM Daniel T. Lee wrote:
> >
> > This commit refactors the existing cgroup program with libbpf bpf
> > loader. The original test_cgrp2_sock2 has keeped the bpf program
> > at
On Wed, Nov 18, 2020 at 11:58 AM Andrii Nakryiko
wrote:
>
> On Tue, Nov 17, 2020 at 6:57 AM Daniel T. Lee wrote:
> >
> > This commit refactors the existing kprobe program with libbpf bpf
> > loader. To attach bpf program, this uses generic bpf_program__attach()
> &
On Wed, Nov 18, 2020 at 11:52 AM Andrii Nakryiko
wrote:
>
> On Tue, Nov 17, 2020 at 6:57 AM Daniel T. Lee wrote:
> >
> > This commit refactors the existing ibumad program with libbpf bpf
> > loader. Attach/detach of Tracepoint bpf programs has been mana
On Wed, Nov 18, 2020 at 11:49 AM Andrii Nakryiko
wrote:
>
> On Tue, Nov 17, 2020 at 6:58 AM Daniel T. Lee wrote:
> >
> > Numerous refactoring that rewrites BPF programs written with bpf_load
> > to use the libbpf loader was finally completed, resulting in BPF
> >
On Wed, Nov 18, 2020 at 10:58 AM Andrii Nakryiko
wrote:
>
> On Tue, Nov 17, 2020 at 6:57 AM Daniel T. Lee wrote:
> >
> > Under the samples/bpf directory, similar tracing helpers are
> > fragmented around. To keep consistent of tracing programs, this commit
> &g
On Wed, Nov 18, 2020 at 10:19 AM Martin KaFai Lau wrote:
>
> On Tue, Nov 17, 2020 at 02:56:36PM +, Daniel T. Lee wrote:
> > Under the samples/bpf directory, similar tracing helpers are
> > fragmented around. To keep consistent of tracing programs, this commit
> > mov
Under the samples/bpf directory, similar tracing helpers are
fragmented around. To keep consistent of tracing programs, this commit
moves the helper and define locations to increase the reuse of each
helper function.
Signed-off-by: Daniel T. Lee
---
samples/bpf/Makefile
ed to control uprobe events.
Furthermore, to prevent conflict of same named uprobe events, O_TRUNC
flag has been used to clear 'uprobe_events' interface.
Signed-off-by: Daniel T. Lee
---
samples/bpf/Makefile | 2 +-
samples/bpf/task_fd_query_user.c | 101 +++
with the latest kernel BPF and causes confusion.
Signed-off-by: Daniel T. Lee
---
samples/bpf/bpf_load.c | 667
samples/bpf/bpf_load.h | 57 ---
samples/bpf/xdp2skb_meta_kern.c | 2 +-
3 files changed, 1 insertion(+), 725 deletions(-)
delete
bpf_load, an outdated bpf loader that is difficult
to keep up with the latest kernel BPF and causes confusion.
Daniel T. Lee (9):
selftests: bpf: move tracing helpers to trace_helper.h
samples: bpf: refactor hbm program with libbpf
samples: bpf: refactor test_cgrp2_sock2 program with libbpf
his commit add the executable permission to shell script
files.
Fixes: f74599f7c5309 ("bpf: Add tests and samples for LWT-BPF")
Signed-off-by: Daniel T. Lee
---
samples/bpf/lwt_len_hist.sh | 2 ++
samples/bpf/test_lwt_bpf.sh | 0
2 files changed, 2 insertions(+)
mode change 100644 =
not used on this program.
Signed-off-by: Daniel T. Lee
---
samples/bpf/Makefile | 2 +-
samples/bpf/ibumad_kern.c | 26 +++
samples/bpf/ibumad_user.c | 66 ++-
3 files changed, 65 insertions(+), 29 deletions(-)
diff --git a/samples/bpf
code, this commit
uses the number of available cpus with _SC_NPROCESSORS_ONLN.
Signed-off-by: Daniel T. Lee
---
samples/bpf/Makefile | 2 +-
samples/bpf/test_overhead_user.c | 82 +++-
2 files changed, 60 insertions(+), 24 deletions(-)
diff --git a/samples
6b5d471135c ("selftests/bpf: samples/bpf: Split off legacy stuff from
bpf_helpers.h")
Signed-off-by: Daniel T. Lee
---
samples/bpf/.gitignore | 3 ++
samples/bpf/Makefile | 2 +-
samples/bpf/hbm.c | 96 +-
samples/bpf/hbm_kern.h | 2 +
oblem that
shell script cannot find the binary object from the current path,
relative path './' has been added in front of binary.
Signed-off-by: Daniel T. Lee
---
samples/bpf/Makefile| 2 +-
samples/bpf/test_cgrp2_sock2.c | 63 -
samples/
This commit removes the unused trace_helper and bpf_load from
samples/bpf target objects from Makefile.
Signed-off-by: Daniel T. Lee
---
samples/bpf/Makefile | 10 --
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index
ff-by: Daniel T. Lee
---
Changes in v2:
- added cleanup logic for bpf_link and bpf_object
- split increment into seperate satement
- refactor pointer array initialization
samples/bpf/Makefile | 2 +-
samples/bpf/xdp_monitor_user.c | 159 +
2 files changed
, this commit removes the max_entries attribute at PERF_EVENT_ARRAY
map type. The libbpf's bpf_object__create_map() will automatically
set max_entries to the maximum configured number of CPUs on the host.
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- revert BTF key/val type to defau
inter array initialization
- error code cleanup
Daniel T. Lee (3):
samples: bpf: Refactor xdp_monitor with libbpf
samples: bpf: Replace attach_tracepoint() to attach() in
xdp_redirect_cpu
samples: bpf: refactor XDP kern program maps with BTF-defined map
samples/bpf/Mak
ff-by: Daniel T. Lee
---
Changes in v2:
- added cleanup logic for bpf_link and bpf_object
- split increment into seperate satement
- refactor pointer array initialization
samples/bpf/Makefile | 2 +-
samples/bpf/xdp_monitor_user.c | 159 +
2 files changed
On Sat, Oct 10, 2020 at 3:30 AM Andrii Nakryiko
wrote:
>
> On Fri, Oct 9, 2020 at 9:04 AM Daniel T. Lee wrote:
> >
> > To avoid confusion caused by the increasing fragmentation of the BPF
> > Loader program, this commit would like to convert the previous bpf_load
&g
, this commit removes the max_entries attribute at PERF_EVENT_ARRAY
map type. The libbpf's bpf_object__create_map() will automatically
set max_entries to the maximum configured number of CPUs on the host.
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- revert BTF key/val type to defau
On Sat, Oct 10, 2020 at 3:23 AM Andrii Nakryiko
wrote:
>
> On Fri, Oct 9, 2020 at 9:04 AM Daniel T. Lee wrote:
> >
> > From commit d7a18ea7e8b6 ("libbpf: Add generic bpf_program__attach()"),
> > for some BPF programs, it is now possible to attach BPF progr
ethod. In addition, this refactors the logic of setting
the map FD to simplify the code. Also, the missing removal of
bpf_load.o in Makefile has been fixed.
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- program section match with bpf_program__is_ instead of strncmp
- refactor pointer ar
inter array initialization
- error code cleanup
Daniel T. Lee (3):
samples: bpf: Refactor xdp_monitor with libbpf
samples: bpf: Replace attach_tracepoint() to attach() in
xdp_redirect_cpu
samples: bpf: refactor XDP kern program maps with BTF-defined map
samples/bpf/Mak
ethod. In addition, this refactors the logic of setting
the map FD to simplify the code. Also, the missing removal of
bpf_load.o in Makefile has been fixed.
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- program section match with bpf_program__is_ instead of strncmp
- refactor pointer ar
On Sat, Oct 10, 2020 at 3:25 AM Andrii Nakryiko
wrote:
>
> On Fri, Oct 9, 2020 at 9:04 AM Daniel T. Lee wrote:
> >
> > Most of the samples were converted to use the new BTF-defined MAP as
> > they moved to libbpf, but some of the samples were missing.
> >
> &g
On Sat, Oct 10, 2020 at 3:17 AM Andrii Nakryiko
wrote:
>
> On Fri, Oct 9, 2020 at 9:04 AM Daniel T. Lee wrote:
> >
> > To avoid confusion caused by the increasing fragmentation of the BPF
> > Loader program, this commit would like to change to the libbpf loader
> >
, this commit removes the max_entries attribute at PERF_EVENT_ARRAY
map type. The libbpf's bpf_object__create_map() will automatically
set max_entries to the maximum configured number of CPUs on the host.
Signed-off-by: Daniel T. Lee
---
samples/bpf/xdp_monitor_kern.c
o BTF-defined map.
Daniel T. Lee (3):
samples: bpf: Refactor xdp_monitor with libbpf
samples: bpf: Replace attach_tracepoint() to attach() in
xdp_redirect_cpu
samples: bpf: refactor XDP kern program maps with BTF-defined map
samples/bpf/Makefile| 4 +-
sample
ff-by: Daniel T. Lee
---
samples/bpf/Makefile | 2 +-
samples/bpf/xdp_monitor_user.c | 144 -
2 files changed, 108 insertions(+), 38 deletions(-)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 4f1ed0e3cf9f..0cee2aa8970f 100644
--- a/sample
ethod. In addition, this refactors the logic of setting
the map FD to simplify the code. Also, the missing removal of
bpf_load.o in Makefile has been fixed.
Signed-off-by: Daniel T. Lee
---
samples/bpf/Makefile| 2 +-
samples/bpf/xdp_redirect_cpu_user.c | 138 +--
On Wed, Sep 9, 2020 at 8:24 AM Andrii Nakryiko
wrote:
>
> On Sat, Sep 5, 2020 at 8:41 AM Daniel T. Lee wrote:
> >
> > Most of the samples were converted to use the new BTF-defined MAP as
> > they moved to libbbpf, but some of the samples were missing.
> >
> &g
On Mon, Sep 7, 2020 at 10:02 PM Michal Rostecki wrote:
>
> Daniel T. Lee writes:
> > Most of the samples were converted to use the new BTF-defined MAP as
> > they moved to libbbpf, but some of the samples were missing.
> >
> > Instead of using the previous B
T. Lee
---
samples/bpf/xdp_sample_pkts_kern.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/samples/bpf/xdp_sample_pkts_kern.c
b/samples/bpf/xdp_sample_pkts_kern.c
index 33377289e2a8..b15172b7d455 100644
--- a/samples/bpf/xdp_sample_pkts_kern.c
+++ b/samples
f_program__section_name(). Due to
this commit, the compilation warning issue has also been resolved.
Fixes: 521095842027 ("libbpf: Deprecate notion of BPF program "title" in favor
of "section name"")
Signed-off-by: Daniel T. Lee
---
samples/bpf/sockex3_user
This commit adds xsk_fwd test file to .gitignore which is newly added
to samples/bpf.
Signed-off-by: Daniel T. Lee
---
samples/bpf/.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/samples/bpf/.gitignore b/samples/bpf/.gitignore
index 034800c4d1e6..b2f29bc8dc43 100644
--- a/samples
f_program__section_name(). Due to
this commit, the compilation warning issue has also been resolved.
Fixes: 521095842027 ("libbpf: Deprecate notion of BPF program "title" in favor
of "section name"")
Signed-off-by: Daniel T. Lee
---
samples/bpf/sockex3_user
This commit adds xsk_fwd test file to .gitignore which is newly added
to samples/bpf.
Signed-off-by: Daniel T. Lee
---
samples/bpf/.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/samples/bpf/.gitignore b/samples/bpf/.gitignore
index 034800c4d1e6..b2f29bc8dc43 100644
--- a/samples
trace_common.h was used.
- Adding a kprobe event and attaching a bpf program to it was done
through bpf_program_attach().
- Instead of using the existing BPF MAP definition, MAP definition
has been refactored with the new BTF-defined MAP format.
Signed-off-by: Daniel T. Lee
through bpf_program_attach().
- Instead of using the existing BPF MAP definition, MAP definition
has been refactored with the new BTF-defined MAP format.
Signed-off-by: Daniel T. Lee
---
samples/bpf/Makefile | 6 ++--
samples/bpf/cpustat_kern.c | 36
erformance test with
libbpf")
Signed-off-by: Daniel T. Lee
---
samples/bpf/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index f87ee02073ba..0cac89230c6d 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Mak
() macro in
trace_common.h was used.
- Adding a kprobe/tracepoint event and attaching a bpf program to it
was done through bpf_program_attach().
- Instead of using the existing BPF MAP definition, MAP definition
has been refactored with the new BTF-defined MAP format.
Daniel T. Lee (3
attach kprobe events to blk_account_io_done()
to modify them to perform the same behavior as before.
Signed-off-by: Daniel T. Lee
---
samples/bpf/task_fd_query_kern.c | 2 +-
samples/bpf/task_fd_query_user.c | 2 +-
samples/bpf/tracex3_kern.c | 2 +-
3 files changed, 3 insertions(+), 3 delet
itializing btf pointer as NULL.
Fixes: 94a1fedd63ed ("libbpf: Add btf__parse_raw() and generic btf__parse()
APIs")
Signed-off-by: Daniel T. Lee
---
tools/lib/bpf/btf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.
On Wed, Jul 8, 2020 at 4:00 AM Andrii Nakryiko
wrote:
>
> On Tue, Jul 7, 2020 at 11:49 AM Daniel T. Lee wrote:
> >
> > samples/bpf no longer use bpf_map_def_legacy and instead use the
> > libbpf's bpf_map_def or new BTF-defined MAP format. This commit removes
> &g
samples/bpf no longer use bpf_map_def_legacy and instead use the
libbpf's bpf_map_def or new BTF-defined MAP format. This commit removes
unused bpf_map_def_legacy struct from selftests/bpf/bpf_legacy.h.
Signed-off-by: Daniel T. Lee
---
tools/testing/selftests/bpf/bpf_legacy.h
directive.
__array(values, struct inner_map)
This commit refactors map in map test program with libbpf by explicitly
defining inner map with BTF-defined format.
Signed-off-by: Daniel T. Lee
---
Changes in V2:
- fix wrong error check logic with bpf_program
samples/bpf/Makefile
_load, the inner map definition has
been explicitly declared with BTF-defined format. Also, the element of
ARRAY_OF_MAPS was also statically specified using the BTF format. And
for this reason some logic in fixup_map() was not needed and changed
or removed.
Signed-off-by: Daniel T. Lee
---
Changes in V2
ARRAY_OF_MAPS element with '.values'
Daniel T. Lee (4):
samples: bpf: fix bpf programs with kprobe/sys_connect event
samples: bpf: refactor BPF map in map test with libbpf
samples: bpf: refactor BPF map performance test with libbpf
selftests: bpf: remove unused bpf_map_def_leg
.
Fixes: 34745aed515c ("samples/bpf: fix kprobe attachment issue on x64")
Signed-off-by: Daniel T. Lee
---
Changes in V2:
- instead of changing event from __x64_sys_connect to __sys_connect,
fetch and set register values directly
samples/bpf/map_perf_test_kern.c | 9
On Tue, Jul 7, 2020 at 2:15 PM Andrii Nakryiko
wrote:
>
> On Mon, Jul 6, 2020 at 7:33 PM Daniel T. Lee wrote:
> >
> > On Tue, Jul 7, 2020 at 8:50 AM Andrii Nakryiko
> > wrote:
> > >
> > > On Mon, Jul 6, 2020 at 3:28 AM Daniel T. Lee
> > > wr
On Tue, Jul 7, 2020 at 8:50 AM Andrii Nakryiko
wrote:
>
> On Mon, Jul 6, 2020 at 3:28 AM Daniel T. Lee wrote:
> >
> > On Fri, Jul 3, 2020 at 1:04 AM Yonghong Song wrote:
> > >
> > >
> > >
> > > On 7/2/20 4:13 AM, Daniel T. Lee wrote:
>
On Fri, Jul 3, 2020 at 1:04 AM Yonghong Song wrote:
>
>
>
> On 7/2/20 4:13 AM, Daniel T. Lee wrote:
> > On Thu, Jul 2, 2020 at 2:13 PM Yonghong Song wrote:
> >>
> >>
> >>
> >> On 7/1/20 7:16 PM, Daniel T. Lee wrote:
> >>> Curr
On Thu, Jul 2, 2020 at 1:34 PM Andrii Nakryiko
wrote:
>
> On Wed, Jul 1, 2020 at 7:17 PM Daniel T. Lee wrote:
> >
> > Previously, in order to set the numa_node attribute at the time of map
> > creation using "libbpf", it was necessary to call bpf_create_map_node
On Thu, Jul 2, 2020 at 2:13 PM Yonghong Song wrote:
>
>
>
> On 7/1/20 7:16 PM, Daniel T. Lee wrote:
> > Currently, BPF programs with kprobe/sys_connect does not work properly.
> >
> > Commit 34745aed515c ("samples/bpf: fix kprobe attachment issue on x64"
On Thu, Jul 2, 2020 at 1:26 PM Andrii Nakryiko
wrote:
>
> On Wed, Jul 1, 2020 at 7:17 PM Daniel T. Lee wrote:
> >
> > From commit 646f02ffdd49 ("libbpf: Add BTF-defined map-in-map
> > support"), a way to define internal map in BTF-defined map has been
> >
directive.
__array(values, struct inner_map)
This commit refactors map in map test program with libbpf by explicitly
defining inner map with BTF-defined format.
Signed-off-by: Daniel T. Lee
---
samples/bpf/Makefile | 2 +-
samples/bpf/test_map_in_map_kern.c | 85 +++-
samples/bpf no longer use bpf_map_def_legacy and instead use the
libbpf's bpf_map_def or new BTF-defined MAP format. This commit removes
unused bpf_map_def_legacy struct from selftests/bpf/bpf_legacy.h.
Signed-off-by: Daniel T. Lee
---
tools/testing/selftests/bpf/bpf_legacy.h
.
Daniel T. Lee (4):
samples: bpf: fix bpf programs with kprobe/sys_connect event
samples: bpf: refactor BPF map in map test with libbpf
samples: bpf: refactor BPF map performance test with libbpf
selftests: bpf: remove unused bpf_map_def_legacy struct
samples/bpf/Makefile
sys_connect event by
specifying the __sys_connect directly and this will bypass the
"__x64_" appending rule of bpf_load.
Fixes: 34745aed515c ("samples/bpf: fix kprobe attachment issue on x64")
Signed-off-by: Daniel T. Lee
---
samples/bpf/map_perf_test_kern.c
ject_load() has been added.
By using libbpf instead of bpf_load, the inner map definition has
been explicitly declared with BTF-defined format. And for this reason
some logic in fixup_map() was not needed and changed or removed.
Signed-off-by: Daniel T. Lee
---
samples/bpf/Makefile |
On Sat, Jun 27, 2020 at 7:19 AM Andrii Nakryiko
wrote:
>
> On Fri, Jun 26, 2020 at 3:14 PM Daniel T. Lee wrote:
> >
> > On Sat, Jun 27, 2020 at 5:30 AM Andrii Nakryiko
> > wrote:
> > >
> > > On Fri, Jun 26, 2020 at 1:18 AM Daniel T. Lee
> > &
On Sat, Jun 27, 2020 at 5:30 AM Andrii Nakryiko
wrote:
>
> On Fri, Jun 26, 2020 at 1:18 AM Daniel T. Lee wrote:
> >
> > From commit 646f02ffdd49 ("libbpf: Add BTF-defined map-in-map
> > support"), a way to define internal map in BTF-defined map has been
&
2020년 6월 27일 (토) 05:25, Andrii Nakryiko 님이 작성:
>
> On Fri, Jun 26, 2020 at 1:18 AM Daniel T. Lee wrote:
> >
> > Libbpf has its own helper function to check for errors in the bpf
> > data structure (pointer). And Some codes do not use this libbbpf
> > helper function
Libbpf has its own helper function to check for errors in the bpf
data structure (pointer). And Some codes do not use this libbbpf
helper function and check the pointer's error directly.
This commit clean up the existing pointer error check logic with
libbpf.
Signed-off-by: Daniel T
directive.
__array(values, struct inner_map)
This commit refactors map in map test program with libbpf by explicitly
defining inner map with BTF-defined format.
Signed-off-by: Daniel T. Lee
---
samples/bpf/Makefile | 2 +-
samples/bpf/test_map_in_map_kern.c | 85 +++-
sys_connect event by
specifying the __sys_connect directly and this will bypass the
"__x64_" appending rule of bpf_load.
Fixes: 34745aed515c ("samples/bpf: fix kprobe attachment issue on x64")
Signed-off-by: Daniel T. Lee
---
samples/bpf/map_perf_test_kern.c
of them to PROG_ARRAY, and it's much more intuitive than the
traditional approach.
This commit refactors user programs with the PROG_ARRAY type MAP with
libbpf instead of using bpf_load.
Signed-off-by: Daniel T. Lee
---
Changes in V2:
- refactor pointer error check with libbpf_get_error
- on
This commit adds tracex7 test file (testfile.img) to .gitignore which
comes from test_override_return.sh.
Signed-off-by: Daniel T. Lee
---
samples/bpf/.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/samples/bpf/.gitignore b/samples/bpf/.gitignore
index 23837f2ed458..034800c4d1e6
with bpf_load.
Signed-off-by: Daniel T. Lee
---
samples/bpf/sampleip_kern.c| 12 +--
samples/bpf/sockex3_kern.c | 36
samples/bpf/trace_event_kern.c | 24 ++---
samples/bpf/tracex2_kern.c | 24 ++---
sample
ith
libbpf using bpf_link interface and bpf_program__attach.
tracex2_kern.c, which tracks system calls (sys_*), has been modified to
append prefix depending on architecture.
Signed-off-by: Daniel T. Lee
---
Changes in V2:
- refactor pointer error check with libbpf_get_error
- on bpf object op
Current method of checking pointer error is not user friendly.
Especially the __must_check define makes this less intuitive.
Since, libbpf has an API libbpf_get_error() which checks pointer error,
this commit refactors existing pointer error check logic with libbpf.
Signed-off-by: Daniel T. Lee
macro for adding architecture prefix to system calls (sys_*)
Daniel T. Lee (5):
samples: bpf: refactor pointer error check with libbpf
samples: bpf: refactor kprobe tracing user progs with libbpf
samples: bpf: refactor tail call user progs with libbpf
samples: bpf: add tracex7 test file to
On Thu, May 14, 2020 at 12:29 AM Yonghong Song wrote:
>
>
>
> On 5/12/20 11:51 PM, Daniel T. Lee wrote:
> > On Wed, May 13, 2020 at 10:40 AM Yonghong Song wrote:
> >>
> >>
> >>
> >> On 5/12/20 7:43 AM, Daniel T. Lee wrote:
> >>> C
On Wed, May 13, 2020 at 10:40 AM Yonghong Song wrote:
>
>
>
> On 5/12/20 7:43 AM, Daniel T. Lee wrote:
> > Currently, the kprobe BPF program attachment method for bpf_load is
> > quite old. The implementation of bpf_load "directly" controls and
> > mana
of them to PROG_ARRAY, and it's much more intuitive than the
traditional approach.
This commit refactors user programs with the PROG_ARRAY type MAP with
libbpf instead of using bpf_load.
Signed-off-by: Daniel T. Lee
---
samples/bpf/Makefile | 4 +--
samples/bpf/sock
ith
libbpf using bpf_link interface and bpf_program__attach.
tracex2_kern.c, which tracks system calls (sys_*), has been modified to
append prefix depending on architecture.
Signed-off-by: Daniel T. Lee
---
samples/bpf/Makefile | 12 +++
samples/bpf/tracex1_u
with bpf_load.
Signed-off-by: Daniel T. Lee
---
samples/bpf/sampleip_kern.c| 12 +--
samples/bpf/sockex3_kern.c | 36
samples/bpf/trace_event_kern.c | 24 ++---
samples/bpf/tracex2_kern.c | 24 ++---
sample
r bpf_link interface)
This patchset refactors kprobe tracing programs with using libbpf API
for loading bpf program instead of previous bpf_load implementation.
Daniel T. Lee (3):
samples: bpf: refactor kprobe tracing user progs with libbpf
samples: bpf: refactor tail call user progs with libbpf
sa
1 - 100 of 212 matches
Mail list logo