From ce58a9f8f8504c165ca4527bfd991a4029437cba Mon Sep 17 00:00:00 2001 From: Giorgio Arena Date: Tue, 31 Oct 2017 17:59:17 +0000 Subject: COMPMID-622 Let the user choose the units for the instruments Change-Id: Ic6ac4cd6df6970593a5e2e6310b6d61951c88898 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/93887 Tested-by: Kaizen Reviewed-by: Anthony Barbier --- tests/framework/instruments/Instruments.cpp | 30 +++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'tests/framework/instruments/Instruments.cpp') diff --git a/tests/framework/instruments/Instruments.cpp b/tests/framework/instruments/Instruments.cpp index eca6d6f437..641e6305cd 100644 --- a/tests/framework/instruments/Instruments.cpp +++ b/tests/framework/instruments/Instruments.cpp @@ -34,18 +34,28 @@ namespace test { namespace framework { -InstrumentType instrument_type_from_name(const std::string &name) +InstrumentsDescription instrument_type_from_name(const std::string &name) { - static const std::map types = + static const std::map types = { - { "all", InstrumentType::ALL }, - { "none", InstrumentType::NONE }, - { "wall_clock", InstrumentType::WALL_CLOCK_TIMER }, - { "pmu", InstrumentType::PMU }, - { "pmu_cycles", InstrumentType::PMU_CYCLE_COUNTER }, - { "pmu_instructions", InstrumentType::PMU_INSTRUCTION_COUNTER }, - { "mali", InstrumentType::MALI }, - { "opencl_timer", InstrumentType::OPENCL_TIMER }, + { "all", std::pair(InstrumentType::ALL, ScaleFactor::NONE) }, + { "none", std::pair(InstrumentType::NONE, ScaleFactor::NONE) }, + { "wall_clock", std::pair(InstrumentType::WALL_CLOCK_TIMER, ScaleFactor::NONE) }, + { "wall_clock_timer", std::pair(InstrumentType::WALL_CLOCK_TIMER, ScaleFactor::NONE) }, + { "wall_clock_timer_ms", std::pair(InstrumentType::WALL_CLOCK_TIMER, ScaleFactor::TIME_MS) }, + { "wall_clock_timer_s", std::pair(InstrumentType::WALL_CLOCK_TIMER, ScaleFactor::TIME_S) }, + { "pmu", std::pair(InstrumentType::PMU, ScaleFactor::NONE) }, + { "pmu_k", std::pair(InstrumentType::PMU, ScaleFactor::SCALE_1K) }, + { "pmu_m", std::pair(InstrumentType::PMU, ScaleFactor::SCALE_1M) }, + { "pmu_cycles", std::pair(InstrumentType::PMU_CYCLE_COUNTER, ScaleFactor::NONE) }, + { "pmu_instructions", std::pair(InstrumentType::PMU_INSTRUCTION_COUNTER, ScaleFactor::NONE) }, + { "mali", std::pair(InstrumentType::MALI, ScaleFactor::NONE) }, + { "mali_k", std::pair(InstrumentType::MALI, ScaleFactor::SCALE_1K) }, + { "mali_m", std::pair(InstrumentType::MALI, ScaleFactor::SCALE_1M) }, + { "opencl_timer", std::pair(InstrumentType::OPENCL_TIMER, ScaleFactor::NONE) }, + { "opencl_timer_us", std::pair(InstrumentType::OPENCL_TIMER, ScaleFactor::TIME_US) }, + { "opencl_timer_ms", std::pair(InstrumentType::OPENCL_TIMER, ScaleFactor::TIME_MS) }, + { "opencl_timer_s", std::pair(InstrumentType::OPENCL_TIMER, ScaleFactor::TIME_S) }, }; try -- cgit v1.2.1