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

Lionel Landwerlin
2019-01-17T11:03:50Z

On 16/01/2019 23:30, Chris Wilson wrote:
> 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...

Hmm nope. I just assumed anything could interrupt us.

I think igt_ioctl() does the same right?

>
>> + 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
>