MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / wait_next_event

Method wait_next_event

tests/framework/instruments/MaliCounter.cpp:305–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303}
304
305void MaliCounter::wait_next_event()
306{
307 pollfd poll_fd; // NOLINT
308 poll_fd.fd = _hwc_fd;
309 poll_fd.events = POLLIN;
310
311 const int count = poll(&poll_fd, 1, -1);
312
313 if (count < 0)
314 {
315 ARM_COMPUTE_ERROR("poll() failed.");
316 }
317
318 if ((poll_fd.revents & POLLIN) != 0)
319 {
320 mali_userspace::kbase_hwcnt_reader_metadata meta; // NOLINT
321
322 if (ioctl(_hwc_fd, static_cast<int>(mali_userspace::KBASE_HWCNT_READER_GET_BUFFER), &meta) != 0) // NOLINT
323 {
324 ARM_COMPUTE_ERROR("Failed READER_GET_BUFFER.");
325 }
326
327 memcpy(_raw_counter_buffer.data(), _sample_data + _buffer_size * meta.buffer_idx, _buffer_size);
328 _timestamp = meta.timestamp;
329
330 if (ioctl(_hwc_fd, mali_userspace::KBASE_HWCNT_READER_PUT_BUFFER, &meta) != 0) // NOLINT
331 {
332 ARM_COMPUTE_ERROR("Failed READER_PUT_BUFFER.");
333 }
334 }
335 else if ((poll_fd.revents & POLLHUP) != 0)
336 {
337 ARM_COMPUTE_ERROR("HWC hung up.");
338 }
339}
340
341const uint32_t *MaliCounter::get_counters() const
342{

Callers

nothing calls this directly

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected