aboutsummaryrefslogtreecommitdiff
path: root/tests/framework/instruments/PMU.cpp
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2017-09-29 10:46:08 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commit144d2fff0e9a87050eafd856789683ab39f08eda (patch)
treeb4ad1bb9466e9cb1e5ca6f107843472c60184c4d /tests/framework/instruments/PMU.cpp
parentd6d57e2249cafb7dc4f150090fa9e3d46b71d20f (diff)
downloadComputeLibrary-144d2fff0e9a87050eafd856789683ab39f08eda.tar.gz
COMPMID-417 Minor documentation fixes and error handling in instruments
Fixed some Doxygen issues in the introduction and tests sections Switched MaliCounter to use ARM_COMPUTE_ERROR in order to get more context in case of failure Switched to use ARM_COMPUTE_ERROR instead of ERROR_ON in PMU and MaliCounter so that checks work in release mode too. (As these checks are to detect platform issues rather than programming errors) Change-Id: Ibbefa5a87d93c5c3aa5e190680052e4e99987dfe Reviewed-on: http://mpd-gerrit.cambridge.arm.com/89662 Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'tests/framework/instruments/PMU.cpp')
-rw-r--r--tests/framework/instruments/PMU.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/framework/instruments/PMU.cpp b/tests/framework/instruments/PMU.cpp
index 0594e96cb2..d0cacbba73 100644
--- a/tests/framework/instruments/PMU.cpp
+++ b/tests/framework/instruments/PMU.cpp
@@ -74,9 +74,10 @@ void PMU::open(const perf_event_attr &perf_config)
ARM_COMPUTE_ERROR_ON_MSG(_fd < 0, "perf_event_open failed");
const int result = ioctl(_fd, PERF_EVENT_IOC_ENABLE, 0);
-
- ARM_COMPUTE_ERROR_ON_MSG(result == -1, "Failed to enable PMU counter: %d", errno);
- ARM_COMPUTE_UNUSED(result);
+ if(result == -1)
+ {
+ ARM_COMPUTE_ERROR("Failed to enable PMU counter: %d", errno);
+ }
}
void PMU::close()
@@ -91,8 +92,10 @@ void PMU::close()
void PMU::reset()
{
const int result = ioctl(_fd, PERF_EVENT_IOC_RESET, 0);
- ARM_COMPUTE_ERROR_ON_MSG(result == -1, "Failed to reset PMU counter: %d", errno);
- ARM_COMPUTE_UNUSED(result);
+ if(result == -1)
+ {
+ ARM_COMPUTE_ERROR("Failed to reset PMU counter: %d", errno);
+ }
}
} // namespace framework
} // namespace test