On Wed, Oct 23, 2024 at 02:56:51PM +0200, Richard Biener wrote: > On Wed, Oct 9, 2024 at 6:18 PM Andi Kleen <a...@linux.intel.com> wrote: > > > > From: Andi Kleen <a...@gcc.gnu.org> > > > > Retrieving sys/user time in timevars is quite expensive because it > > always needs a system call. Only getting the wall time is much > > cheaper because operating systems have optimized paths for this. > > > > The sys time isn't that interesting for a compiler and wall time > > is usually close to user time except when the system is overloaded. > > On the other hand when it is not wall time is more accurate because > > it has less overhead. > > > > For building tramp3d with -O0 the -ftime-report overhead drops from > > 18% to 3%. For -O2 it drops from 8% to not measurable. > > > > I changed the code to use gettimeofday as a fallback for clock_gettime > > CLOCK_MONOTONIC. If a host has neither of those the time will not > > be measured. Previously clock was the fallback. > > OK for trunk if there's no serious objection until mid next week.
I committed the patch now. -Andi