diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-04-09 11:37:25 -0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-06 21:50:28 +0100 |
commit | 9d72259f943a3b31fa4e32aeb1c5a2de3d8ca611 (patch) | |
tree | bbe81012555fc1829592d66c186a2422321b60d0 /src/testlib/qbenchmark_p.h | |
parent | 24f059eed0be5b901bbb81ce921a942ca785fe1d (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.h | 11 |
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(); |