Re: [PATCH v7 1/3] x86/fpu: Measure the Latency of XSAVE and XRSTOR

From: Yi Sun
Date: Thu Sep 21 2023 - 23:46:27 EST


On 21.09.2023 09:52, Andi Kleen wrote:
It seems unnecessarily complex: why does it have to measure latency
directly? Tracepoints *by default* come with event timestamps. A latency
measurement tool should be able to subtract two timestamps to extract the
latency between two tracepoints...

In fact, function tracing is enabled on all major Linux distros:

kepler:~/tip> grep FUNCTION_TRACER /boot/config-6.2.0-33-generic
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_FUNCTION_TRACER=y

Why not just enable function tracing for the affected FPU context switching
functions?

Or use PT address filters to get it even accurately, as described
in [1]. In any case I agree the trace points are not needed.

Hi Andi,

Here, we have implemented latency measurement for all x86 platforms, not
just for Intel but also for other vendors like AMD. This allows us to obtain comparable data.

Thanks
--Sun, Yi