[PATCH i-g-t] tests/intel/xe_oa: Get stream status on read error

Dixit, Ashutosh ashutosh.dixit at intel.com
Mon Apr 14 23:19:11 UTC 2025


On Mon, 14 Apr 2025 15:19:12 -0700, Umesh Nerlige Ramappa wrote:
>
> On Thu, Apr 10, 2025 at 01:33:44PM -0700, Dixit, Ashutosh wrote:
> > On Wed, 09 Apr 2025 16:34:41 -0700, Umesh Nerlige Ramappa wrote:
> >>
> >> Whenever read fails, get stream status so we know the state of OA status
> >> bits.
> >>
> >> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>
> >> ---
> >>  tests/intel/xe_oa.c | 6 ++++++
> >>  1 file changed, 6 insertions(+)
> >>
> >> diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c
> >> index 67acc74b3279..f3521c3d602e 100644
> >> --- a/tests/intel/xe_oa.c
> >> +++ b/tests/intel/xe_oa.c
> >> @@ -2294,6 +2294,7 @@ static void test_polling_small_buf(void)
> >>	errno = 0;
> >>	ret = read(stream_fd, buf, sizeof(buf));
> >>	igt_assert_eq(ret, -1);
> >> +	get_stream_status(stream_fd);
> >>	igt_assert_eq(errno, ENOSPC);
> >>
> >>	/* Poll with 0 timeout and expect POLLIN flag to be set */
> >> @@ -2568,6 +2569,7 @@ test_enable_disable(const struct drm_xe_engine_class_instance *hwe)
> >>	errno = 0;
> >>	ret = read(stream_fd, buf, sizeof(buf));
> >>	igt_assert_eq(ret, -1);
> >> +	get_stream_status(stream_fd);
> >>	igt_assert_eq(errno, EINVAL);
> >>
> >>	do_ioctl(stream_fd, DRM_XE_OBSERVATION_IOCTL_ENABLE, 0);
> >> @@ -2584,6 +2586,7 @@ test_enable_disable(const struct drm_xe_engine_class_instance *hwe)
> >>	/* Ensure num_reports can be read */
> >>	while ((ret = read(stream_fd, buf, sizeof(buf))) < 0 && errno == EINTR)
> >>		;
> >> +	get_stream_status(stream_fd);
> >>	igt_assert_eq(ret, sizeof(buf));
> >
> > Here read() is not failing, so maybe we should drop this one? Otherwise:
>
> But here we could get an EIO for some strange reason and would be good to
> know if a specific status bit was set. The idea was to call
> get_stream_status in all places where read was called.

It's fine, I went ahead and merged this along with some other patches.

> Thanks,
> Umesh
>
> >
> > Reviewed-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
> >
> >>
> >>	__perf_close(stream_fd);
> >> @@ -2727,6 +2730,7 @@ test_non_sampling_read_error(void)
> >>
> >>	ret = read(stream_fd, buf, sizeof(buf));
> >>	igt_assert_eq(ret, -1);
> >> +	get_stream_status(stream_fd);
> >>	igt_assert_eq(errno, EINVAL);
> >>
> >>	__perf_close(stream_fd);
> >> @@ -2768,6 +2772,7 @@ test_disabled_read_error(void)
> >>
> >>	ret = read(stream_fd, buf, sizeof(buf));
> >>	igt_assert_eq(ret, -1);
> >> +	get_stream_status(stream_fd);
> >>	igt_assert_eq(errno, EINVAL);
> >>
> >>	__perf_close(stream_fd);
> >> @@ -2786,6 +2791,7 @@ test_disabled_read_error(void)
> >>
> >>	ret = read(stream_fd, buf, sizeof(buf));
> >>	igt_assert_eq(ret, -1);
> >> +	get_stream_status(stream_fd);
> >>	igt_assert_eq(errno, EINVAL);
> >>
> >>	do_ioctl(stream_fd, DRM_XE_OBSERVATION_IOCTL_ENABLE, 0);
> >> --
> >> 2.43.0
> >>


More information about the igt-dev mailing list