Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
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 i-g-t 10/28] tests/intel/xe_oa: Add first tests
Date: Sun, 30 Jun 2024 15:42:48 -0700	[thread overview]
Message-ID: <877ce6aw7r.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <ZnS3GWwaHI9Q6VJe@orsosgc001>

On Thu, 20 Jun 2024 16:11:21 -0700, Umesh Nerlige Ramappa wrote:
>

Hi Umesh,

> > +/**
> > + * SUBTEST: xe-ref-count
> > + * Description: Check that an open oa stream holds a reference on the xe module
> > + */
> > +static void
> > +test_xe_ref_count(void)
> > +{
> > +	uint64_t properties[] = {
> > +		DRM_XE_OA_PROPERTY_OA_UNIT_ID, 0,
> > +
> > +		/* Include OA reports in samples */
> > +		DRM_XE_OA_PROPERTY_SAMPLE_OA, true,
> > +
> > +		/* OA unit configuration */
> > +		DRM_XE_OA_PROPERTY_OA_METRIC_SET, 0 /* updated below */,
> > +		DRM_XE_OA_PROPERTY_OA_FORMAT, __ff(0), /* update below */
> > +		DRM_XE_OA_PROPERTY_OA_PERIOD_EXPONENT, 0, /* update below */
> > +	};
> > +	struct intel_xe_oa_open_prop param = {
> > +		.num_properties = ARRAY_SIZE(properties) / 2,
> > +		.properties_ptr = to_user_pointer(properties),
> > +	};
> > +	unsigned baseline, ref_count0, ref_count1;
> > +	uint32_t oa_report0[64];
> > +	uint32_t oa_report1[64];
> > +
> > +	/* This should be the first test before the first fixture so no drm_fd
> > +	 * should have been opened so far...
> > +	 */
> > +	igt_assert_eq(drm_fd, -1);
> > +
> > +	baseline = read_xe_module_ref();
> > +	igt_debug("baseline ref count (drm fd closed) = %u\n", baseline);
> > +
> > +	drm_fd = __drm_open_driver(DRIVER_XE);
> > +	if (is_xe_device(drm_fd))
> > +		xe_device_get(drm_fd);
> > +	devid = intel_get_drm_devid(drm_fd);
> > +	sysfs = igt_sysfs_open(drm_fd);
> > +
> > +	/* Note: these global variables are only initialized after calling
> > +	 * init_sys_info()...
> > +	 */
> > +	igt_require(init_sys_info());
> > +	properties[5] = default_test_set->perf_oa_metrics_set;
> > +	properties[7] = __ff(default_test_set->perf_oa_format);
> > +	properties[9] = oa_exp_1_millisec;
> > +
> > +	ref_count0 = read_xe_module_ref();
> > +	igt_debug("initial ref count with drm_fd open = %u\n", ref_count0);
> > +
> > +	stream_fd = __perf_open(drm_fd, &param, false);
> > +        set_fd_flags(stream_fd, O_CLOEXEC);
> > +	ref_count1 = read_xe_module_ref();
> > +	igt_debug("ref count after opening oa stream = %u\n", ref_count1);
> > +
> > +	drm_close_driver(drm_fd);
> > +	close(sysfs);
> > +	drm_fd = -1;
> > +	sysfs = -1;
> > +	ref_count0 = read_xe_module_ref();
> > +	igt_debug("ref count after closing drm fd = %u\n", ref_count0);
> > +
> > +	read_2_oa_reports(default_test_set->perf_oa_format,
> > +			  oa_exp_1_millisec,
> > +			  oa_report0,
> > +			  oa_report1,
> > +			  false); /* not just timer reports */
> > +
> > +	__perf_close(stream_fd);
> > +	ref_count0 = read_xe_module_ref();
> > +	igt_debug("ref count after closing oa stream fd = %u\n", ref_count0);
>
> Looks like the asserts are removed, so we will never know if this failed
> :). I think we should drop the test and create an issue to make it more
> robust.

Unfortunately I don't want to drop the test in this patch, since it will
mean moving several other functions called by this code to other patches
etc. (to make sure this patch continues to compile). It is a non trivial
amount of work, not worth it IMO. So instead, I have added a patch at the
end deleting the "xe-ref-count" subtest.

I have also created an issue to re-add the test back after making it
robust.

I have already merged the IGT library and tools. So it is just the Xe OA
IGT test patches left to merge. So now only the first and the second-last
patches don't have a R-b. You can see these here:

https://patchwork.freedesktop.org/series/130033/#rev5

Thanks.
--
Ashutosh

>
> Ideally we should take a snapshot of the entire /proc/modules file and
> ensure that no new driver has added a reference to xe while we are running
> this test. That way, we know that an assert may fail due to a new driver
> taking up a drm ref or dropping one. If we can attribute the failure to
> such an event, we can re-run the test.

  reply	other threads:[~2024-06-30 22:59 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-20 20:00 [PATCH v4 i-g-t 00/28] Intel Xe OA IGT's Ashutosh Dixit
2024-06-20 20:00 ` [PATCH i-g-t 01/28] lib/xe/oa: Import OA metric generation files from i915 Ashutosh Dixit
2024-06-20 21:54   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 02/28] lib/xe/oa: Add LNL metric guids Ashutosh Dixit
2024-06-20 21:54   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 03/28] lib/xe/oa: Add OA LNL metrics (oa_lnl.xml) Ashutosh Dixit
2024-06-20 21:55   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 04/28] lib/xe/oa: Add truncated legacy Xe1 metrics XML's Ashutosh Dixit
2024-06-20 21:57   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 05/28] lib/xe/oa: Generate LNL metrics/registers files Ashutosh Dixit
2024-06-20 21:52   ` Umesh Nerlige Ramappa
2024-06-20 23:05     ` Dixit, Ashutosh
2024-06-20 20:00 ` [PATCH i-g-t 06/28] lib/xe/oa: Switch generated files to Xe namespace Ashutosh Dixit
2024-06-20 23:24   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 07/28] drm-uapi/xe: Sync with Perf/OA changes Ashutosh Dixit
2024-06-20 23:24   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 08/28] lib/xe: Complete xe_oa lib functionality Ashutosh Dixit
2024-06-20 23:24   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 09/28] tests/intel/xe_query: Add OA units query test Ashutosh Dixit
2024-06-20 23:25   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 10/28] tests/intel/xe_oa: Add first tests Ashutosh Dixit
2024-06-20 23:11   ` Umesh Nerlige Ramappa
2024-06-30 22:42     ` Dixit, Ashutosh [this message]
2024-06-20 20:00 ` [PATCH i-g-t 11/28] tests/intel/xe_oa: Add some negative tests Ashutosh Dixit
2024-06-20 23:12   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 12/28] tests/intel/xe_oa: Add "oa-formats" subtest Ashutosh Dixit
2024-06-20 23:15   ` Umesh Nerlige Ramappa
2024-06-30 22:43     ` Dixit, Ashutosh
2024-06-20 20:00 ` [PATCH i-g-t 13/28] tests/intel/xe_oa: Add oa exponent tests Ashutosh Dixit
2024-06-20 23:18   ` Umesh Nerlige Ramappa
2024-06-30 22:43     ` Dixit, Ashutosh
2024-06-20 20:00 ` [PATCH i-g-t 14/28] tests/intel/xe_oa: buffer-fill, non-zero-reason, enable-disable Ashutosh Dixit
2024-06-20 23:19   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 15/28] tests/intel/xe_oa: blocking and polling tests Ashutosh Dixit
2024-06-20 23:20   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 16/28] tests/intel/xe_oa: OAR/OAC tests Ashutosh Dixit
2024-06-20 23:46   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 17/28] tests/intel/xe_oa: Exclusive/concurrent access, rc6 and stress open close Ashutosh Dixit
2024-06-20 23:37   ` Umesh Nerlige Ramappa
2024-06-30 22:43     ` Dixit, Ashutosh
2024-06-20 20:00 ` [PATCH i-g-t 18/28] tests/intel/xe_oa: add remove OA config tests Ashutosh Dixit
2024-06-20 23:38   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 19/28] tests/intel/xe_oa: OA buffer mmap tests Ashutosh Dixit
2024-06-20 23:39   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 20/28] tests/intel/xe_oa: Register whitelisting and MMIO trigger tests Ashutosh Dixit
2024-06-20 23:39   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 21/28] lib/xe/oa: Add xe_oa_data_reader to IGT lib Ashutosh Dixit
2024-06-20 23:40   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 22/28] tools/xe-perf: Add xe_perf_recorder Ashutosh Dixit
2024-06-20 23:41   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 23/28] tools/xe-perf: xe_perf_reader, xe_perf_control and xe_perf_configs Ashutosh Dixit
2024-06-20 23:41   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 24/28] xe/oa: Fix invalid escape warnings Ashutosh Dixit
2024-06-20 23:43   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 25/28] xe/oa/mdapi-xml-convert: Add support for 576B_PEC64LL format Ashutosh Dixit
2024-06-20 23:43   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 26/28] xe/oa: Regenerate oa-lnl.xml now parsing all counters Ashutosh Dixit
2024-06-20 23:43   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 27/28] xe/oa/oa-metricset-codegen: Fix XE_OA_FORMAT_PEC64u64 offsets Ashutosh Dixit
2024-06-20 23:44   ` Umesh Nerlige Ramappa
2024-06-20 20:00 ` [PATCH i-g-t 28/28] HAX: Add Xe OA tests to xe-fast-feedback.testlist Ashutosh Dixit
2024-06-20 23:45   ` Umesh Nerlige Ramappa
2024-06-30 22:43     ` Dixit, Ashutosh
2024-06-20 20:19 ` ✗ GitLab.Pipeline: warning for Intel Xe OA IGT's (rev4) Patchwork
2024-06-20 20:36 ` ✓ CI.xeBAT: success " Patchwork
2024-06-20 20:43 ` ✓ Fi.CI.BAT: " Patchwork
2024-06-20 23:01 ` ✗ CI.xeFULL: failure " Patchwork
2024-06-21  5:51 ` ✗ Fi.CI.IGT: " 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=877ce6aw7r.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