OSDN Git Service

selftests/bpf: Add absolute timer test
authorTero Kristo <tero.kristo@linux.intel.com>
Thu, 2 Mar 2023 11:46:14 +0000 (13:46 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 3 Mar 2023 06:41:32 +0000 (22:41 -0800)
commit944459e88b4f5c71683b56710f96e39756afae31
tree97f2964ecc250c23440651af0a9c5b800f77c4bc
parentf71f8530494bb5ab43d3369ef0ce8373eb1ee077
selftests/bpf: Add absolute timer test

Add test for the absolute BPF timer under the existing timer tests. This
will run the timer two times with 1us expiration time, and then re-arm
the timer at ~35s in the future. At the end, it is verified that the
absolute timer expired exactly two times.

Signed-off-by: Tero Kristo <tero.kristo@linux.intel.com>
Link: https://lore.kernel.org/r/20230302114614.2985072-3-tero.kristo@linux.intel.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/timer.c
tools/testing/selftests/bpf/progs/timer.c