COMPMID-1777: Add option to make instruments output timestamps instead of duration
Change-Id: Iafc1d6cd8003de64a3439ad807f4002036c73a73
diff --git a/tests/framework/instruments/Instruments.h b/tests/framework/instruments/Instruments.h
index 77c74b7..370db8d 100644
--- a/tests/framework/instruments/Instruments.h
+++ b/tests/framework/instruments/Instruments.h
@@ -54,6 +54,9 @@
OPENCL_TIMER = 0x0400,
SCHEDULER_TIMER = 0x0500,
OPENCL_MEMORY_USAGE = 0x0600,
+ WALL_CLOCK_TIMESTAMPS = 0x0700,
+ OPENCL_TIMESTAMPS = 0x0800,
+ SCHEDULER_TIMESTAMPS = 0x0900,
};
using InstrumentsDescription = std::pair<InstrumentType, ScaleFactor>;
@@ -72,6 +75,22 @@
{
switch(instrument.first)
{
+ case InstrumentType::WALL_CLOCK_TIMESTAMPS:
+ switch(instrument.second)
+ {
+ case ScaleFactor::NONE:
+ stream << "WALL_CLOCK_TIMESTAMPS";
+ break;
+ case ScaleFactor::TIME_MS:
+ stream << "WALL_CLOCK_TIMESTAMPS_MS";
+ break;
+ case ScaleFactor::TIME_S:
+ stream << "WALL_CLOCK_TIMESTAMPS_S";
+ break;
+ default:
+ throw std::invalid_argument("Unsupported instrument scale");
+ }
+ break;
case InstrumentType::WALL_CLOCK_TIMER:
switch(instrument.second)
{
@@ -88,6 +107,22 @@
throw std::invalid_argument("Unsupported instrument scale");
}
break;
+ case InstrumentType::SCHEDULER_TIMESTAMPS:
+ switch(instrument.second)
+ {
+ case ScaleFactor::NONE:
+ stream << "SCHEDULER_TIMESTAMPS";
+ break;
+ case ScaleFactor::TIME_MS:
+ stream << "SCHEDULER_TIMESTAMPS_MS";
+ break;
+ case ScaleFactor::TIME_S:
+ stream << "SCHEDULER_TIMESTAMPS_S";
+ break;
+ default:
+ throw std::invalid_argument("Unsupported instrument scale");
+ }
+ break;
case InstrumentType::SCHEDULER_TIMER:
switch(instrument.second)
{
@@ -142,6 +177,25 @@
throw std::invalid_argument("Unsupported instrument scale");
}
break;
+ case InstrumentType::OPENCL_TIMESTAMPS:
+ switch(instrument.second)
+ {
+ case ScaleFactor::NONE:
+ stream << "OPENCL_TIMESTAMPS";
+ break;
+ case ScaleFactor::TIME_US:
+ stream << "OPENCL_TIMESTAMPS_US";
+ break;
+ case ScaleFactor::TIME_MS:
+ stream << "OPENCL_TIMESTAMPS_MS";
+ break;
+ case ScaleFactor::TIME_S:
+ stream << "OPENCL_TIMESTAMPS_S";
+ break;
+ default:
+ throw std::invalid_argument("Unsupported instrument scale");
+ }
+ break;
case InstrumentType::OPENCL_TIMER:
switch(instrument.second)
{