From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Cc: <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH 2/4] tests/intel/xe_oa: Do not assume OA buffer is prefilled with zeroes
Date: Mon, 20 Jul 2026 12:42:44 -0700 [thread overview]
Message-ID: <87h5ltxxaj.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20260717210027.2008255-8-umesh.nerlige.ramappa@intel.com>
On Fri, 17 Jul 2026 14:00:30 -0700, Umesh Nerlige Ramappa wrote:
>
> The tail address test assumes that the OA buffer is preset to zeroes. Modify
> logic to be independent of this assumption.
Are we going to stop memset'ing OA buffer to 0 in the kernel? Even
otherwise, because this patch is a generalization of the OA buffer being 0:
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
>
> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
> ---
> tests/intel/xe_oa.c | 29 ++++++++++++++++++-----------
> 1 file changed, 18 insertions(+), 11 deletions(-)
>
> diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c
> index e7e4f5601b61..98f00d377a86 100644
> --- a/tests/intel/xe_oa.c
> +++ b/tests/intel/xe_oa.c
> @@ -4634,7 +4634,7 @@ static void closed_fd_and_unmapped_access(const struct drm_xe_oa_unit *oau)
> * format size is not a power of 2. This means that the last report will not be
> * broken down across the OA buffer end. Instead it will be written to the
> * beginning of the OA buffer. We will check the end of the buffer to ensure it
> - * has zeroes in it.
> + * has not been written into.
> */
> static void
> test_tail_address_wrap(const struct drm_xe_oa_unit *oau, size_t oa_buffer_size)
> @@ -4649,6 +4649,7 @@ test_tail_address_wrap(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, exponent,
> + DRM_XE_OA_PROPERTY_OA_DISABLED, true,
> DRM_XE_OA_PROPERTY_OA_BUFFER_SIZE, buffer_size,
> };
> struct intel_xe_oa_open_prop param = {
> @@ -4656,25 +4657,31 @@ test_tail_address_wrap(const struct drm_xe_oa_unit *oau, size_t oa_buffer_size)
> .properties_ptr = to_user_pointer(properties),
> };
> u32 fmt_size = get_oa_format(fmt).size;
> - u32 zero_size = buffer_size % fmt_size;
> - u32 *zero_area, *buffer_end, *buffer_start;
> + u32 area_size = buffer_size % fmt_size;
> + u32 *area, *buffer_end, *buffer_start;
> + u32 *content = malloc(area_size);
>
> - igt_require(zero_size);
> + igt_require(area_size);
> + igt_require(content);
igt_assert(content);
>
> stream_fd = __perf_open(drm_fd, ¶m, false);
> set_fd_flags(stream_fd, O_CLOEXEC);
> -
> - wait_for_oa_buffer_overflow(stream_fd, 100);
> -
> buffer_start = mmap(0, buffer_size, PROT_READ, MAP_PRIVATE, stream_fd, 0);
> igt_assert(buffer_start);
>
> - zero_area = buffer_start + (buffer_size - zero_size) / 4;
> + area = buffer_start + (buffer_size - area_size) / 4;
> buffer_end = buffer_start + buffer_size / 4;
>
> - dump_report(zero_area, zero_size / 4, "zero_area");
> - while (zero_area < buffer_end)
> - igt_assert_eq(*zero_area++, 0);
> + memcpy(content, area, area_size);
> + dump_report(area, area_size / 4, "contents before");
> +
> + do_ioctl(stream_fd, DRM_XE_OBSERVATION_IOCTL_ENABLE, 0);
> + wait_for_oa_buffer_overflow(stream_fd, 100);
> + do_ioctl(stream_fd, DRM_XE_OBSERVATION_IOCTL_DISABLE, 0);
> +
> + dump_report(area, area_size / 4, "contents after");
> + while (area < buffer_end)
> + igt_assert_eq(*area++, *content++);
>
> munmap(buffer_start, buffer_size);
>
> --
> 2.51.0
>
next prev parent reply other threads:[~2026-07-20 19:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 21:00 [PATCH 0/4] Update some OA tests Umesh Nerlige Ramappa
2026-07-17 21:00 ` [PATCH 1/4] tests/intel/xe_oa: Allow disabling load helper from command line Umesh Nerlige Ramappa
2026-07-20 19:37 ` Dixit, Ashutosh
2026-07-17 21:00 ` [PATCH 2/4] tests/intel/xe_oa: Do not assume OA buffer is prefilled with zeroes Umesh Nerlige Ramappa
2026-07-20 19:42 ` Dixit, Ashutosh [this message]
2026-07-21 17:19 ` Umesh Nerlige Ramappa
2026-07-17 21:00 ` [PATCH 3/4] tests/intel/xe_oa: Enable capture just prior to reading OA data Umesh Nerlige Ramappa
2026-07-20 20:22 ` Dixit, Ashutosh
2026-07-17 21:00 ` [PATCH 4/4] tests/intel/xe_oa: Cleanup blocking and polling tests Umesh Nerlige Ramappa
2026-07-20 21:08 ` Dixit, Ashutosh
2026-07-21 17:26 ` Umesh Nerlige Ramappa
2026-07-17 22:49 ` ✓ Xe.CI.BAT: success for Update some OA tests Patchwork
2026-07-17 23:08 ` ✓ i915.CI.BAT: " Patchwork
2026-07-18 5:41 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-18 14:11 ` ✗ i915.CI.Full: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h5ltxxaj.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=umesh.nerlige.ramappa@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox