From 144d2fff0e9a87050eafd856789683ab39f08eda Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Fri, 29 Sep 2017 10:46:08 +0100 Subject: 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 Reviewed-by: Georgios Pinitas Tested-by: Kaizen --- tests/framework/instruments/PMU.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'tests/framework/instruments/PMU.cpp') 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 -- cgit v1.2.1