diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2016-02-16 15:57:15 +0100 |
---|---|---|
committer | Milian Wolff <milian.wolff@kdab.com> | 2016-03-03 09:55:22 +0000 |
commit | fe04aba46df291389e462d9e89387a4e4547b33f (patch) | |
tree | 5cbf9222551bc6887e25f8e63ff570cfce0b83c5 /src/testlib/qbenchmarkmetric.cpp | |
parent | 9c1d3bc253abd4418f3050d19ec5f05bef3ada97 (diff) |
Enable support for ref-cycles perf counter in QtTestLib.
The ref-cycles counter corresponds to the monotonic timestamp counter
that can be read using the RDTSC assembler instruction. Using it
instead of the default cycles counter is useful as it removes the
effect of dynamic frequency scaling on the measurement.
[ChangeLog][QtTest] The ref-cycles perf counter can now be used.
Change-Id: Id7d56576db362706c20f9a399e5acea35ee799f2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/testlib/qbenchmarkmetric.cpp')
-rw-r--r-- | src/testlib/qbenchmarkmetric.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/testlib/qbenchmarkmetric.cpp b/src/testlib/qbenchmarkmetric.cpp index 0a9072907f..0ba55dbeb7 100644 --- a/src/testlib/qbenchmarkmetric.cpp +++ b/src/testlib/qbenchmarkmetric.cpp @@ -56,6 +56,7 @@ \value CPUTicks CPU time \value CPUMigrations Process migrations between CPUs \value CPUCycles CPU cycles + \value RefCPUCycles Reference CPU cycles \value BusCycles Bus cycles \value StalledCycles Cycles stalled \value InstructionReads Instruction reads @@ -108,6 +109,8 @@ const char * QTest::benchmarkMetricName(QBenchmarkMetric metric) return "CPUMigrations"; case CPUCycles: return "CPUCycles"; + case RefCPUCycles: + return "RefCPUCycles"; case BusCycles: return "BusCycles"; case StalledCycles: @@ -180,6 +183,8 @@ const char * QTest::benchmarkMetricUnit(QBenchmarkMetric metric) return "CPU migrations"; case CPUCycles: return "CPU cycles"; + case RefCPUCycles: + return "Reference CPU cycles"; case BusCycles: return "bus cycles"; case StalledCycles: |