Re: [PATCH 3/4] tests/intel/xe_oa: Enable capture just prior to reading OA data
"Dixit, Ashutosh" <[email protected]>
| Newsgroups | org.freedesktop.lists.igt-dev |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 17 Jul 2026 14:00:31 -0700, Umesh Nerlige Ramappa wrote: > > When running the test in a loop, sometimes the buffer overflow error was > seen with smaller buffer sizes. > To make the non-zero-reason test more robust, enable capture just before > reading the data and surround the read with the load helper calls. Hmm, not sure why this patch should make a difference... Anyway, since you seem to be saying it does, and because it is mostly equivalent to previous code, this is: Reviewed-by: Ashutosh Dixit <[email protected]> > > Signed-off-by: Umesh Nerlige Ramappa <[email protected]> > --- > tests/intel/xe_oa.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c > index 98f00d377a86..4f652b187bae 100644 > --- a/tests/intel/xe_oa.c > +++ b/tests/intel/xe_oa.c > @@ -2678,6 +2678,7 @@ test_non_zero_reason(const struct drm_xe_oa_unit *oau, size_t oa_buffer_size) > DRM_XE_OA_PROPERTY_OA_METRIC_SET, test_set->perf_oa_metrics_set, > DRM_XE_OA_PROPERTY_OA_FORMAT, __ff(fmt), > DRM_XE_OA_PROPERTY_OA_PERIOD_EXPONENT, oa_exponent, > + DRM_XE_OA_PROPERTY_OA_DISABLED, true, > DRM_XE_OA_PROPERTY_OA_BUFFER_SIZE, oa_buffer_size ?: buffer_fill_size > }; > struct intel_xe_oa_open_prop param = { > @@ -2705,16 +2706,16 @@ test_non_zero_reason(const struct drm_xe_oa_unit *oau, size_t oa_buffer_size) > igt_assert(buf); > > igt_debug("Ready to read about %u bytes\n", buf_size); > - > - load_helper_init(); > - load_helper_run(HIGH); > - > if (!oa_buffer_size) > param.num_properties = param.num_properties - 1; > > stream_fd = __perf_open(drm_fd, ¶m, true /* prevent_pm */); > set_fd_flags(stream_fd, O_CLOEXEC); > > + load_helper_init(); > + load_helper_run(HIGH); > + > + do_ioctl(stream_fd, DRM_XE_OBSERVATION_IOCTL_ENABLE, 0); > while (total_len < buf_size && > ((len = read(stream_fd, &buf[total_len], buf_size - total_len)) > 0 || > (len == -1 && (errno == EINTR || errno == EIO)))) { > -- > 2.51.0 >