From 9fb0cac961f70d1937c5fa3eafeaee1385c89768 Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Fri, 20 Apr 2018 15:46:21 +0100 Subject: COMPMID-1081: Introduced test-wide instruments Change-Id: I5831241f3fc503717cc51136453c2bf96d4b420b Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/128484 Tested-by: Jenkins Reviewed-by: Georgios Pinitas --- tests/framework/Profiler.cpp | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'tests/framework/Profiler.cpp') diff --git a/tests/framework/Profiler.cpp b/tests/framework/Profiler.cpp index 646c66556c..69ea527a80 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 @@ void Profiler::add(std::unique_ptr instrument) _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 @@ void Profiler::stop() { instrument->stop(); } - for(const auto &instrument : _instruments) { for(const auto &measurement : instrument->measurements()) @@ -61,6 +68,22 @@ void Profiler::stop() } } +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; -- cgit v1.2.1