bpf: Compute program stats for sleepable programs
authorAlexei Starovoitov <ast@kernel.org>
Wed, 10 Feb 2021 03:36:28 +0000 (19:36 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 11 Feb 2021 15:19:06 +0000 (16:19 +0100)
commitf2dd3b39467411c53703125a111f45b3672c1771
tree08e6354a8eca6c7749242864638975a46d36f642
parent031d6e02ddbb8dea747c1abb697d556901f07dd4
bpf: Compute program stats for sleepable programs

Since sleepable programs don't migrate from the cpu the excution stats can be
computed for them as well. Reuse the same infrastructure for both sleepable and
non-sleepable programs.

run_cnt     -> the number of times the program was executed.
run_time_ns -> the program execution time in nanoseconds including the
               off-cpu time when the program was sleeping.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: KP Singh <kpsingh@kernel.org>
Link: https://lore.kernel.org/bpf/20210210033634.62081-4-alexei.starovoitov@gmail.com
arch/x86/net/bpf_jit_comp.c
include/linux/bpf.h
kernel/bpf/trampoline.c