public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Simon Ser <simon.ser@intel.com>
Cc: igt-dev@lists.freedesktop.org, martin.peres@intel.com
Subject: Re: [igt-dev] [PATCH i-g-t] lib/igt_eld: print debug message when no ELD is found
Date: Tue, 2 Jul 2019 16:14:11 +0300	[thread overview]
Message-ID: <20190702131411.GO5942@intel.com> (raw)
In-Reply-To: <20190702130229.23742-1-simon.ser@intel.com>

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@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@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@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-07-02 13:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-02 13:02 [igt-dev] [PATCH i-g-t] lib/igt_eld: print debug message when no ELD is found Simon Ser
2019-07-02 13:14 ` Ville Syrjälä [this message]
2019-07-02 14:57 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-07-03 11:35 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190702131411.GO5942@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=martin.peres@intel.com \
    --cc=simon.ser@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox