Re: [PATCH bpf-next] bpf: Add bpf_ktime_get_coarse_ns helper

2020-11-17 Thread Martin KaFai Lau
On Tue, Nov 17, 2020 at 06:45:49PM +, Dmitrii Banshchikov wrote: > The helper uses CLOCK_MONOTONIC_COARSE source of time that is less > accurate but more performant. > > We have a BPF CGROUP_SKB firewall that supports event logging through > bpf_perf_event_output(). Each event has a timestamp

[PATCH bpf-next] bpf: Add bpf_ktime_get_coarse_ns helper

2020-11-17 Thread Dmitrii Banshchikov
The helper uses CLOCK_MONOTONIC_COARSE source of time that is less accurate but more performant. We have a BPF CGROUP_SKB firewall that supports event logging through bpf_perf_event_output(). Each event has a timestamp and currently we use bpf_ktime_get_ns() for it. Use of bpf_ktime_get_coarse_ns(