[igt-dev] [PATCH i-g-t] lib/igt_eld: print debug message when no ELD is found

Ville Syrjälä ville.syrjala at linux.intel.com
Tue Jul 2 13:14:11 UTC 2019


On Tue, Jul 02, 2019 at 04:02:29PM +0300, Simon Ser wrote:
> When this happens, the logs were completely empty previously, which can be
> quite confusing.
> 
> Signed-off-by: Simon Ser <simon.ser at intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

> ---
>  lib/igt_eld.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/igt_eld.c b/lib/igt_eld.c
> index 3d7fd4dd0a82..16c4ac06c6f6 100644
> --- a/lib/igt_eld.c
> +++ b/lib/igt_eld.c
> @@ -207,10 +207,11 @@ bool eld_get_igt(struct eld_entry *eld)
>  {
>  	DIR *dir;
>  	struct dirent *dirent;
> -	int i;
> +	int i, n_elds;
>  	char card[64];
>  	char path[PATH_MAX];
> 
> +	n_elds = 0;
>  	for (i = 0; i < 8; i++) {
>  		snprintf(card, sizeof(card), "/proc/asound/card%d", i);
>  		dir = opendir(card);
> @@ -222,6 +223,8 @@ bool eld_get_igt(struct eld_entry *eld)
>  				    strlen(ELD_PREFIX)) != 0)
>  				continue;
> 
> +			n_elds++;
> +
>  			snprintf(path, sizeof(path), "%s/%s", card,
>  				 dirent->d_name);
>  			if (!eld_parse_entry(path, eld)) {
> @@ -246,6 +249,9 @@ bool eld_get_igt(struct eld_entry *eld)
>  		closedir(dir);
>  	}
> 
> +	if (n_elds == 0)
> +		igt_debug("Found zero ELDs\n");
> +
>  	return false;
>  }
> 
> --
> 2.22.0
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Ville Syrjälä
Intel


More information about the igt-dev mailing list