diff --git a/src/testlib/qbenchmarkperfevents.cpp b/src/testlib/qbenchmarkperfevents.cpp index 6350c777cd..1b9101e854 100644 --- a/src/testlib/qbenchmarkperfevents.cpp +++ b/src/testlib/qbenchmarkperfevents.cpp @@ -17,8 +17,9 @@ #include #include -#include #include +#include +#include #include "3rdparty/linux_perf_event_p.h" @@ -504,15 +505,13 @@ void QBenchmarkPerfEventsMeasurer::start() // enable the counters for (int fd : std::as_const(fds)) ::ioctl(fd, PERF_EVENT_IOC_RESET); - for (int fd : std::as_const(fds)) - ::ioctl(fd, PERF_EVENT_IOC_ENABLE); + prctl(PR_TASK_PERF_EVENTS_ENABLE); } QList QBenchmarkPerfEventsMeasurer::stop() { // disable the counters - for (int fd : std::as_const(fds)) - ::ioctl(fd, PERF_EVENT_IOC_DISABLE); + prctl(PR_TASK_PERF_EVENTS_DISABLE); const QList &counters = *eventTypes; QList result(counters.size(), {});