On Thu, Jun 10, 2021 at 9:27 PM Alexei Starovoitov
[off-list ref] wrote:
// Initialize the timer to call 'callback_fn' static function
// First 4 bits of 'flags' specify clockid.
// Only CLOCK_MONOTONIC, CLOCK_REALTIME, CLOCK_BOOTTIME are allowed.
long bpf_timer_init(struct bpf_timer *timer, void *callback_fn, int flags);
Another unpopular point of view:
This init() is not suitable for bpf programs, because unlike kernel modules,
there is no init or exit functions for a bpf program. And timer init
is typically
called during module init.
(bpf spinlock is different, because it can be simply initialized as UNLOCKED.)