Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] i915/perf: Make sure i915 is loaded before reading proc
@ 2020-10-30 22:55 Umesh Nerlige Ramappa
  2020-10-30 23:06 ` Dixit, Ashutosh
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Umesh Nerlige Ramappa @ 2020-10-30 22:55 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The previous test may have unloaded i915 or failed to load it back. To
combat such cases, each test fixture is supposed to ensure that i915 is
loaded prior to running the subtests. In most fixtures this happens
automatically when we try to get a handle to i915. In perf OA, we stat
some proc/sys files even before getting a handle to i915. Occassionally,
perf tests fail trying to stat these files. Fix perf OA by checking and
loading i915 if it's not loaded.

v2: Remove the if check (Ashutosh)

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/405
Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 tests/i915/perf.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/i915/perf.c b/tests/i915/perf.c
index a5c4adc3..bd8281bd 100644
--- a/tests/i915/perf.c
+++ b/tests/i915/perf.c
@@ -41,6 +41,7 @@
 #include "i915/gem.h"
 #include "i915/perf.h"
 #include "igt.h"
+#include "igt_kmod.h"
 #include "igt_sysfs.h"
 #include "drm.h"
 
@@ -4806,6 +4807,13 @@ igt_main
 	igt_fixture {
 		struct stat sb;
 
+		/*
+		 * Prior tests may have unloaded i915 or failed while
+		 * loading/unloading i915. Load i915 here before we stat the
+		 * files.
+		 */
+		igt_i915_driver_load(NULL);
+
 		igt_require(stat("/proc/sys/dev/i915/perf_stream_paranoid", &sb)
 			    == 0);
 		igt_require(stat("/proc/sys/dev/i915/oa_max_sample_rate", &sb)
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 12+ messages in thread
* [igt-dev] [PATCH i-g-t] i915/perf: Make sure i915 is loaded before reading proc
@ 2020-11-02 19:49 Umesh Nerlige Ramappa
  2020-11-03  8:06 ` Petri Latvala
  0 siblings, 1 reply; 12+ messages in thread
From: Umesh Nerlige Ramappa @ 2020-11-02 19:49 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

The previous test may have unloaded i915 or failed to load it back. To
combat such cases, each test fixture is supposed to ensure that i915 is
loaded prior to running the subtests. In most fixtures this happens
automatically when we try to get a handle to i915. In perf OA, we stat
some proc/sys files even before getting a handle to i915. Occassionally,
perf tests fail trying to stat these files. Fix perf OA by checking and
loading i915 if it's not loaded.

v2: Use drm_load_module() (Petri)

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/405
Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 tests/i915/perf.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/i915/perf.c b/tests/i915/perf.c
index a5c4adc3..caeabd62 100644
--- a/tests/i915/perf.c
+++ b/tests/i915/perf.c
@@ -4806,6 +4806,13 @@ igt_main
 	igt_fixture {
 		struct stat sb;
 
+		/*
+		 * Prior tests may have unloaded i915 or failed while
+		 * loading/unloading i915. Load i915 here before we stat the
+		 * files.
+		 */
+		drm_load_module(DRIVER_INTEL);
+
 		igt_require(stat("/proc/sys/dev/i915/perf_stream_paranoid", &sb)
 			    == 0);
 		igt_require(stat("/proc/sys/dev/i915/oa_max_sample_rate", &sb)
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 12+ messages in thread
* [igt-dev] [PATCH i-g-t] i915/perf: Make sure i915 is loaded before reading proc
@ 2020-10-30  0:39 Umesh Nerlige Ramappa
  2020-10-30 10:16 ` Petri Latvala
  0 siblings, 1 reply; 12+ messages in thread
From: Umesh Nerlige Ramappa @ 2020-10-30  0:39 UTC (permalink / raw)
  To: igt-dev

The previous test may have unloaded i915 or failed to load it back. To
combat such cases, each test fixture is supposed to ensure that i915 is
loaded prior to running the subtests. In most fixtures this happens
automatically when we try to get a handle to i915. In perf OA, we stat
some proc/sys files even before getting a handle to i915. Occassionally,
perf tests fail trying to stat these files. Fix perf OA by checking and
loading i915 if it's not loaded.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/405
Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
---
 tests/i915/perf.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/i915/perf.c b/tests/i915/perf.c
index a5c4adc3..a5bd63c2 100644
--- a/tests/i915/perf.c
+++ b/tests/i915/perf.c
@@ -41,6 +41,7 @@
 #include "i915/gem.h"
 #include "i915/perf.h"
 #include "igt.h"
+#include "igt_kmod.h"
 #include "igt_sysfs.h"
 #include "drm.h"
 
@@ -4806,6 +4807,14 @@ igt_main
 	igt_fixture {
 		struct stat sb;
 
+               /*
+		* Prior tests may have unloaded i915 or failed while
+		* loading/unloading i915. Load i915 here before we stat the
+		* files.
+                */
+               if (!igt_kmod_is_loaded("i915"))
+                       igt_assert(!igt_i915_driver_load(NULL));
+
 		igt_require(stat("/proc/sys/dev/i915/perf_stream_paranoid", &sb)
 			    == 0);
 		igt_require(stat("/proc/sys/dev/i915/oa_max_sample_rate", &sb)
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-11-04 10:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-30 22:55 [igt-dev] [PATCH i-g-t] i915/perf: Make sure i915 is loaded before reading proc Umesh Nerlige Ramappa
2020-10-30 23:06 ` Dixit, Ashutosh
2020-10-30 23:58 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/perf: Make sure i915 is loaded before reading proc (rev2) Patchwork
2020-10-31  2:07 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-11-02  9:48 ` [igt-dev] [PATCH i-g-t] i915/perf: Make sure i915 is loaded before reading proc Petri Latvala
  -- strict thread matches above, loose matches on Subject: below --
2020-11-02 19:49 Umesh Nerlige Ramappa
2020-11-03  8:06 ` Petri Latvala
2020-11-04  0:15   ` Umesh Nerlige Ramappa
2020-11-04 10:35     ` Petri Latvala
2020-10-30  0:39 Umesh Nerlige Ramappa
2020-10-30 10:16 ` Petri Latvala
2020-10-30 22:39   ` Umesh Nerlige Ramappa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox