[igt-dev] [PATCH i-g-t] lib: Shut some excessive debug messages up

Janusz Krzysztofik janusz.krzysztofik at linux.intel.com
Wed Jun 7 12:09:50 UTC 2023


Hi Kamil,

On Monday, 5 June 2023 20:03:59 CEST Kamil Konieczny wrote:
> From: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>
> 
> In case of tests which extensively use debugfs, tons of useless debug
> messages about opening a debugfs directory are emitted.  If the test fails
> then important debug messages with details of the failure, interleaved
> with sequences of those useless messages, are hard to find and read.
> 
> Replace igt_debug() with conditional igt_debug_on_f() emitting a message
> about debugfs directory path only if open() fails.
> 
> v2: emit a message on NULL debugfs path
> 
> Cc: Chris Wilson <chris.p.wilson at intel.com>
> Cc: Marcin Bernatowicz <marcin.bernatowicz at linux.intel.com>
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>
> Signed-off-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

As an author, I'm probably not expected to provide any kind of an ack, but 
since nobody responded, I'm providing one, in case it helps you to apply the 
change to upstream.

Acked-by: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>

Thanks,
Janusz

> ---
>  lib/igt_debugfs.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
> index afde2da62..a7b54bae5 100644
> --- a/lib/igt_debugfs.c
> +++ b/lib/igt_debugfs.c
> @@ -208,13 +208,16 @@ char *igt_debugfs_path(int device, char *path, int 
pathlen)
>   */
>  int igt_debugfs_dir(int device)
>  {
> +	int debugfs_dir_fd;
>  	char path[200];
>  
> -	if (!igt_debugfs_path(device, path, sizeof(path)))
> +	if (igt_debug_on(!igt_debugfs_path(device, path, sizeof(path))))
>  		return -1;
>  
> -	igt_debug("Opening debugfs directory '%s'\n", path);
> -	return open(path, O_RDONLY);
> +	debugfs_dir_fd = open(path, O_RDONLY);
> +	igt_debug_on_f(debugfs_dir_fd < 0, "path: %s\n", path);
> +
> +	return debugfs_dir_fd;
>  }
>  
>  /**
> 






More information about the igt-dev mailing list