Re: [PATCH bpf-next v5 2/4] bpf: add bpf_cpu_cycles_to_ns helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2024-11-08 at 16:41 -0800, Vadim Fedorenko wrote:
> The new helper should be used to convert cycles received by
> bpf_get_cpu_cycle() into nanoseconds.
> 
> Signed-off-by: Vadim Fedorenko <vadfed@xxxxxxxx>
> ---

Tried this with and without invtsc flag for qemu,
the switch between call / inlined version occurs as expected.

In the off-list discussion Vadim explained that:
- mult and shift constants are not updated after boot if constant_tsc
  feature is present for CPU.
- despite gettimeofday.h:vdso_calc_ns() doing more complex
  calculations to avoid negative time motion, we again assume that
  this is not needed for BPF use-case (two measurements close in time).
  (If there would be a v6, it would be nice to have a comment about
   these differences, I think).

Reviewed-by: Eduard Zingerman <eddyz87@xxxxxxxxx>

[...]






[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux