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

From: Andi Kleen
Date: Thu Sep 21 2023 - 14:54:00 EST


> 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.

-Andi

[1] https://lore.kernel.org/lkml/ZPOIVmC6aY9GBtdJ@tassilo/