[PATCH] tests/intel/xe_fault_injection: Ignore expected errors

Kamil Konieczny kamil.konieczny at linux.intel.com
Thu Nov 7 17:53:50 UTC 2024


Hi Jonathan,
On 2024-11-06 at 20:02:44 +0000, Jonathan Cavitt wrote:
> The following errors can be observed when running the xe_fault_injection
> subtests:
> 
> [drm] *ERROR* GT0: GuC init failed with -ENOMEM
> [drm] *ERROR* GT0: Failed to initialize uC (-ENOMEM)
> probe with driver xe failed with error -12
> 
> Add these messages to the dmesg ignore regex to the applicable tests
> (specifically, all tests for the last error, and all tests that target
> GuC subsystems for the first two errors).
> 
> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3343
> Signed-off-by: Jonathan Cavitt <jonathan.cavitt at intel.com>
> CC: Francois Dugast <francois.dugast at intel.com>
> CC: Lucas De Marchi <lucas.demarchi at intel.com>
> CC: Matthew Brost <matthew.brost at intel.com>
> CC: Rodrigo Vivi <rodrigo.vivi at intel.com>
> CC: Michal Wajdeczko <michal.wajdeczko at intel.com>
> CC: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> ---
>  tests/intel/xe_fault_injection.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/tests/intel/xe_fault_injection.c b/tests/intel/xe_fault_injection.c
> index d1c8b25307..5bdc3d09e6 100644
> --- a/tests/intel/xe_fault_injection.c
> +++ b/tests/intel/xe_fault_injection.c
> @@ -30,6 +30,27 @@ enum injection_list_action {
>  	INJECTION_LIST_REMOVE,
>  };
>  
> +static bool function_is_part_of_guc(char function_name[])
> +{
> +	return strstr(function_name, "_guc_") != NULL ||
> +	       strstr(function_name, "_uc_") != NULL ||
> +	       strstr(function_name, "_wopcm_") != NULL;
> +}
> +
> +static void ignore_faults_in_dmesg(char function_name[])
> +{
> +	/* Driver probe is expected to fail in all cases, so ignore in igt_runner */
> +	igt_emit_ignore_dmesg_regex("probe with driver xe failed with error -12");
> +
> +	/*
> +	 * If GuC module fault is injected, GuC is expected to fail,
> +	 * so also ignore GuC init failures in igt_runner.
> +	 */
> +	if (function_is_part_of_guc(function_name))
> +		igt_emit_ignore_dmesg_regex("GT0: GuC init failed with -ENOMEM"
> +					    "|GT0: Failed to initialize uC (-ENOMEM)");

imho zero in 'GT0' should be replaced with digits, like:

GT[0-9a-fA-F]*: GuC init failed with -ENOMEM"

Also do not use '(', replace it with dot:

"|GT[0-9a-fA-F]*: Failed to initialize uC .-ENOMEM"

You cannot emit string one after another now, as first regex will be lost,
so this should be concatenated into one big string and then emitted.

static char *probe_err_12 = "Probe...";
static char *guc_failed = "Probe..."
			  "|GT..."
			  "|GT...";

and use one of them. Or concatenate before emit.

Regards,
Kamil

> +}
> +
>  /*
>   * The injectable file requires CONFIG_FUNCTION_ERROR_INJECTION in kernel.
>   */
> @@ -175,6 +196,7 @@ igt_main
>  			if (regexec(&regex, line, 2, pmatch, 0) == 0) {
>  				strcpy(function_name, line);
>  				function_name[pmatch[1].rm_eo - 1] = '\0';
> +				ignore_faults_in_dmesg(function_name);
>  				igt_dynamic_f("function-%s", function_name)
>  					inject_fault_try_bind(fd, pci_slot, function_name);
>  			}
> -- 
> 2.43.0
> 


More information about the igt-dev mailing list