Re: [PATCH i-g-t 01/11] tests/perf: make stream_fd a global variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Lionel Landwerlin (2017-08-04 12:20:30)
> When debugging unstable tests on new platforms we currently we don't
> cleanup everything well in between different tests. Since only a
> single OA stream fd can be opened at a time, having the stream_fd as a
> global variable helps us cleanup the state between tests.

We don't have constructors/destructors per-se, but we do have
igt_subtest_group which can contain fixtures to alloc/dealloc resources.

A more igt-esque approach would be

igt_subtest_group {
	int perf_fd = -1;

	igt_fixture {
		perf_fd = __perf_open();
	}

	igt_subtest
	... How ever many you want in the one group

	igt_fixture {
		__perf_close(perf_fd);
	}
}

Just my 2c. You can of course join the petition for more igt
infrastructure to make writing robust tests easier... :)
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux