linux/tools/include/uapi
Dmitrii Banshchikov d055126180 bpf: Add bpf_ktime_get_coarse_ns helper
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() saves ~15-20
ns in time required for event logging.

bpf_ktime_get_ns():
EgressLogByRemoteEndpoint                              113.82ns    8.79M

bpf_ktime_get_coarse_ns():
EgressLogByRemoteEndpoint                               95.40ns   10.48M

Signed-off-by: Dmitrii Banshchikov <me@ubique.spb.ru>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20201117184549.257280-1-me@ubique.spb.ru
2020-11-18 23:25:32 +01:00
..
asm tools: Fix off-by 1 relative directory includes 2020-03-06 08:36:46 -03:00
asm-generic tools headers UAPI: Update process_madvise affected files 2020-11-03 08:29:30 -03:00
drm tools headers UAPI: Sync drm/i915_drm.h with the kernel sources 2020-11-03 08:35:13 -03:00
linux bpf: Add bpf_ktime_get_coarse_ns helper 2020-11-18 23:25:32 +01:00
sound tools include UAPI: Sync sound/asound.h copy 2020-02-12 11:04:23 -03:00