Re: [igt-dev] [PATCH i-g-t 3/4] tests/perf: new tests for OA interrupt

Chris Wilson
2019-01-16T23:31:11Z

Quoting Lionel Landwerlin (2019-01-16 15:37:31)
> + if (use_polling) {
> + while ((ret = poll(&pollfd, 1, -1)) < 0 &&
> + errno == EINTR)
> + ;

Hmm, are we sending signals to ourself? Just wondering if EINTR here is
a kernel bug...

> + igt_assert_eq(ret, 1);
> + igt_assert(pollfd.revents & POLLIN);
> + }
> +
> + while ((ret = read(stream_fd, buf, MAX_OA_BUF_SIZE)) < 0 &&
> + errno == EINTR)
> + ;
> +
> + if (ret < 0)
> + igt_debug("Unexpected error when reading after poll = %d\n", errno);
> + igt_assert_neq(ret, -1);

igt_assert_f(ret != -1,
"Unexpected error when reading after poll, %m\n");
-Chris