[igt-dev] [PATCH i-g-t] i915/perf: Make sure i915 is loaded before reading proc

Petri Latvala petri.latvala at intel.com
Mon Nov 2 09:48:04 UTC 2020


On Fri, Oct 30, 2020 at 03:55:48PM -0700, Umesh Nerlige Ramappa wrote:
> 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 at intel.com>
> Reviewed-by: Petri Latvala <petri.latvala at intel.com>
> Reviewed-by: Ashutosh Dixit <ashutosh.dixit at 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);
> +


Please use drm_load_module() instead, Chris's patch for exporting that
is now merged.


-- 
Petri Latvala


More information about the igt-dev mailing list