COMPMID-1081: Introduced test-wide instruments
Change-Id: I5831241f3fc503717cc51136453c2bf96d4b420b
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/128484
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
diff --git a/tests/framework/Profiler.cpp b/tests/framework/Profiler.cpp
index 646c665..69ea527 100644
--- a/tests/framework/Profiler.cpp
+++ b/tests/framework/Profiler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -37,6 +37,14 @@
_instruments.emplace_back(std::move(instrument));
}
+void Profiler::test_start()
+{
+ for(auto &instrument : _instruments)
+ {
+ instrument->test_start();
+ }
+}
+
void Profiler::start()
{
for(auto &instrument : _instruments)
@@ -51,7 +59,6 @@
{
instrument->stop();
}
-
for(const auto &instrument : _instruments)
{
for(const auto &measurement : instrument->measurements())
@@ -61,6 +68,22 @@
}
}
+void Profiler::test_stop()
+{
+ for(auto &instrument : _instruments)
+ {
+ instrument->test_stop();
+ }
+
+ for(const auto &instrument : _instruments)
+ {
+ for(const auto &measurement : instrument->test_measurements())
+ {
+ _measurements[instrument->id() + "/" + measurement.first].push_back(measurement.second);
+ }
+ }
+}
+
const Profiler::MeasurementsMap &Profiler::measurements() const
{
return _measurements;