From: Remi Gacogne Date: Thu, 23 Sep 2021 08:42:17 +0000 (+0200) Subject: speedtest: Count the system time as well as the user time X-Git-Tag: rec-4.6.0-alpha1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F10755%2Fhead;p=thirdparty%2Fpdns.git speedtest: Count the system time as well as the user time Our tests are designed to run for 100 ms of CPU time, but this is currently measured with `ITIMER_VIRTUAL` which means only when the process is executing in userspace. Switching to `ITIMER_PROF` would also account for the time spent when the system is running on behalf of the process, which seems closer to what we want. --- diff --git a/pdns/speedtest.cc b/pdns/speedtest.cc index 50f40cb119..e3f181068e 100644 --- a/pdns/speedtest.cc +++ b/pdns/speedtest.cc @@ -36,8 +36,8 @@ template void doRun(const C& cmd, int mseconds=100) it.it_interval.tv_sec=0; it.it_interval.tv_usec=0; - signal(SIGVTALRM, alarmHandler); - setitimer(ITIMER_VIRTUAL, &it, 0); + signal(SIGPROF, alarmHandler); + setitimer(ITIMER_PROF, &it, 0); unsigned int runs=0; g_stop=false;