summaryrefslogtreecommitdiffstats
path: root/src/testlib/qbenchmark_p.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-04-09 11:37:25 -0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-06 21:50:28 +0100
commit9d72259f943a3b31fa4e32aeb1c5a2de3d8ca611 (patch)
treebbe81012555fc1829592d66c186a2422321b60d0 /src/testlib/qbenchmark_p.h
parent24f059eed0be5b901bbb81ce921a942ca785fe1d (diff)
Add the skeleton Linux perf events counter for QtTest
Currently, it only prints "perf available" if you use the -perf option and perf is available. The implementation comes in the next commits. Change-Id: Ic6cdee70e21df25780799a4bc31ca2c2d923b9f8 Reviewed-by: Jason McDonald <macadder1@gmail.com>
Diffstat (limited to 'src/testlib/qbenchmark_p.h')
-rw-r--r--src/testlib/qbenchmark_p.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/testlib/qbenchmark_p.h b/src/testlib/qbenchmark_p.h
index 6b5d996966..9859ca973c 100644
--- a/src/testlib/qbenchmark_p.h
+++ b/src/testlib/qbenchmark_p.h
@@ -63,12 +63,21 @@
#undef QTESTLIB_USE_VALGRIND
#endif
+#if defined(Q_OS_LINUX) && !defined(QT_LINUXBASE)
+#define QTESTLIB_USE_PERF_EVENTS
+#else
+#undef QTESTLIB_USE_PERF_EVENTS
+#endif
+
#include <QtTest/private/qbenchmarkmeasurement_p.h>
#include <QtCore/QMap>
#include <QtTest/qtest_global.h>
#ifdef QTESTLIB_USE_VALGRIND
#include <QtTest/private/qbenchmarkvalgrind_p.h>
#endif
+#ifdef QTESTLIB_USE_PERF_EVENTS
+#include <QtTest/private/qbenchmarkperfevents_p.h>
+#endif
#include <QtTest/private/qbenchmarkevent_p.h>
#include <QtTest/private/qbenchmarkmetric_p.h>
@@ -137,7 +146,7 @@ public:
QBenchmarkGlobalData();
~QBenchmarkGlobalData();
- enum Mode { WallTime, CallgrindParentProcess, CallgrindChildProcess, TickCounter, EventCounter };
+ enum Mode { WallTime, CallgrindParentProcess, CallgrindChildProcess, PerfCounter, TickCounter, EventCounter };
void setMode(Mode mode);
Mode mode() const { return mode_; }
QBenchmarkMeasurerBase *createMeasurer();