Files
android_kernel_fxtec_sm6115/include/uapi/linux
Dmitrii Banshchikov 94a767b958 UPSTREAM: 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

Change-Id: I63aee280613cf00335dd3e60a02448213a7a80a6
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
2026-05-31 11:15:42 +01:00
..
2020-06-07 13:17:54 +02:00
2020-04-24 15:19:09 -07:00
2020-06-17 06:00:22 +05:30
2021-06-28 10:09:35 +05:30
2020-07-07 12:09:16 +05:30
2020-03-26 10:50:04 +05:30
2023-09-23 10:48:08 +02:00
2026-05-31 11:15:33 +01:00