diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-10-19 10:45:52 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-10-25 15:13:57 -0700 |
commit | e1089e0520482e62336a8d6efa40e064fd9796d8 (patch) | |
tree | 4db6bc471a4abc1bac54208561dd313214894309 /src/corelib/text/qlocale.cpp | |
parent | 5fcfacdb7f148ca81f43f9b1846483e61d26e7b2 (diff) |
QBenchlib/Perf: don't try to benchmark the kernel
The kernel has become more paranoid since 2013, when I originally wrote
this code. The kernel.perf_event_paranoid sysctl controls the paranoia
level[1]:
=== ==================================================================
-1 Allow use of (almost) all events by all users.
Ignore mlock limit after perf_event_mlock_kb without
``CAP_IPC_LOCK``.
>=0 Disallow ftrace function tracepoint by users without
``CAP_PERFMON``.
Disallow raw tracepoint access by users without ``CAP_PERFMON``.
>=1 Disallow CPU event access by users without ``CAP_PERFMON``.
>=2 Disallow kernel profiling by users without ``CAP_PERFMON``.
=== ==================================================================
Since the default is 2, we QBenchlib has been failing with EACCESS:
PASS : tst_MyClass::initTestCase()
QBenchmarkPerfEventsMeasurer::start: perf_event_open: Permission denied
[ChangeLog][QtTest] Fixed support of Linux performance counters for
QBENCHMARK, which used to fail with "Permission denied" errors in
default configurations. Now, QtTest will automatically fall back to
profiling only userspace, like the perf(1) tool does.
[1] https://github.com/torvalds/linux/blob/master/Documentation/admin-guide/sysctl/kernel.rst#perf-event-paranoid
Pick-to: 5.15 6.2 6.4
Change-Id: I3c79b7e08fa346988dfefffd171f897be7794935
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/corelib/text/qlocale.cpp')
0 files changed, 0 insertions, 0 deletions