summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-07-19 13:43:30 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-21 04:06:21 +0200
commitbad93acfba492954543a293dbf87769a6953d630 (patch)
tree4ac618d31e35401eb3380f0b180826193356f856 /src/testlib
parent2ff2a7c32d76b9e58b800f12469f112cfdb6ad3c (diff)
Fix compilation of QtTest on Linux systems with old kernel headers
Hardcode our perf_event_open(2) function to simply return -1 and set errno to ENOSYS. This will disable the functionality. People compiling Qt with such old headers will probably carry quite a bit of dead code in QtTest. They should upgrade. Task-number: QTBUG-32507 Change-Id: I774b4a81bee5c3e2ddc75fa52520d123a6bebed9 Reviewed-by: Jason McDonald <macadder1@gmail.com>
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qbenchmarkperfevents.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/testlib/qbenchmarkperfevents.cpp b/src/testlib/qbenchmarkperfevents.cpp
index e3034d1f94..acc11b09ac 100644
--- a/src/testlib/qbenchmarkperfevents.cpp
+++ b/src/testlib/qbenchmarkperfevents.cpp
@@ -130,7 +130,17 @@ static void initPerf()
static int perf_event_open(perf_event_attr *attr, pid_t pid, int cpu, int group_fd, unsigned long flags)
{
+#ifdef SYS_perf_event_open
return syscall(SYS_perf_event_open, attr, pid, cpu, group_fd, flags);
+#else
+ Q_UNUSED(attr);
+ Q_UNUSED(pid);
+ Q_UNUSED(cpu);
+ Q_UNUSED(group_fd);
+ Q_UNUSED(flags);
+ errno = ENOSYS;
+ return -1;
+#endif
}
bool QBenchmarkPerfEventsMeasurer::isAvailable()