Re: [PATCH v7 bpf-next 3/3] bpf: add selftest for BPF_ENABLE_STATS

2020-04-28 Thread Song Liu
> On Apr 28, 2020, at 9:57 PM, Alexei Starovoitov > wrote: > > On Tue, Apr 28, 2020 at 08:58:41PM -0700, Song Liu wrote: >> + >> +skel = test_enable_stats__open_and_load(); >> +if (CHECK(!skel, "skel_open_and_load", "skeleton open/load failed\n")) >> +return; >> + >> +

Re: [PATCH v7 bpf-next 3/3] bpf: add selftest for BPF_ENABLE_STATS

2020-04-28 Thread Alexei Starovoitov
On Tue, Apr 28, 2020 at 08:58:41PM -0700, Song Liu wrote: > + > + skel = test_enable_stats__open_and_load(); > + if (CHECK(!skel, "skel_open_and_load", "skeleton open/load failed\n")) > + return; > + > + stats_fd = bpf_enable_stats(BPF_STATS_RUNTIME_CNT); Just realized that

[PATCH v7 bpf-next 3/3] bpf: add selftest for BPF_ENABLE_STATS

2020-04-28 Thread Song Liu
Add test for BPF_ENABLE_STATS, which should enable run_time_ns stats. ~/selftests/bpf# ./test_progs -t enable_stats -v test_enable_stats:PASS:skel_open_and_load 0 nsec test_enable_stats:PASS:get_stats_fd 0 nsec test_enable_stats:PASS:attach_raw_tp 0 nsec test_enable_stats:PASS:get_prog_info 0 nse