On Sat, Oct 10, 2020 at 11:17 AM Daniel T. Lee <danieltimlee@xxxxxxxxx> 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. > > Instead of using the previous BPF MAP definition, this commit refactors > xdp_monitor and xdp_sample_pkts_kern MAP definition with the new > BTF-defined MAP format. > > Also, 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 <danieltimlee@xxxxxxxxx> > > --- > Changes in v2: > - revert BTF key/val type to default of BPF_MAP_TYPE_PERF_EVENT_ARRAY > Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx> > samples/bpf/xdp_monitor_kern.c | 60 +++++++++++++++--------------- > samples/bpf/xdp_sample_pkts_kern.c | 14 +++---- > samples/bpf/xdp_sample_pkts_user.c | 1 - > 3 files changed, 36 insertions(+), 39 deletions(-) > [...]