summaryrefslogtreecommitdiffstats
path: root/src/testlib/qbenchmarkmeasurement_p.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2022-10-21 11:04:26 -0700
committerThiago Macieira <thiago.macieira@intel.com>2022-11-09 02:18:44 -0700
commit985b94215276eebf4acdd2625829d90a27213d64 (patch)
tree9ba8425bb4aa20f5be8478accd694099416331d7 /src/testlib/qbenchmarkmeasurement_p.h
parent0f55580ec5e48d1e56e31de3b264d0f4a336245c (diff)
QBenchlib: pass the metric type alongside the measurement value
And pass the value in a qreal, which is what QBenchlib stores anyway. This increases the code size a little because the conversion from integer to qreal is in multiple places, but doesn't meaningfully increase the overhead: in the SysV ABI, we still return Measurement in registers and even using the floating point registers where applicable. This is the first step in allowing the Perf benchmarker to benchmark more than one event. Change-Id: I3c79b7e08fa346988dfefffd172027a8677f17c0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/testlib/qbenchmarkmeasurement_p.h')
-rw-r--r--src/testlib/qbenchmarkmeasurement_p.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/testlib/qbenchmarkmeasurement_p.h b/src/testlib/qbenchmarkmeasurement_p.h
index 1e13a9be3d..459a1d5c90 100644
--- a/src/testlib/qbenchmarkmeasurement_p.h
+++ b/src/testlib/qbenchmarkmeasurement_p.h
@@ -23,15 +23,19 @@ QT_BEGIN_NAMESPACE
class QBenchmarkMeasurerBase
{
public:
+ struct Measurement
+ {
+ qreal value;
+ QTest::QBenchmarkMetric metric;
+ };
virtual ~QBenchmarkMeasurerBase() = default;
virtual void init() {}
virtual void start() = 0;
- virtual qint64 stop() = 0;
- virtual bool isMeasurementAccepted(qint64 measurement) = 0;
+ virtual Measurement stop() = 0;
+ virtual bool isMeasurementAccepted(Measurement m) = 0;
virtual int adjustIterationCount(int suggestion) = 0;
virtual int adjustMedianCount(int suggestion) = 0;
virtual bool needsWarmupIteration() { return false; }
- virtual QTest::QBenchmarkMetric metricType() = 0;
};
QT_END_NAMESPACE