From: Simon Ser <simon.ser@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: martin.peres@intel.com
Subject: [igt-dev] [PATCH i-g-t] lib/igt_eld: print debug message when no ELD is found
Date: Tue, 2 Jul 2019 16:02:29 +0300 [thread overview]
Message-ID: <20190702130229.23742-1-simon.ser@intel.com> (raw)
When this happens, the logs were completely empty previously, which can be
quite confusing.
Signed-off-by: Simon Ser <simon.ser@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
next reply other threads:[~2019-07-02 13:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-02 13:02 Simon Ser [this message]
2019-07-02 13:14 ` [igt-dev] [PATCH i-g-t] lib/igt_eld: print debug message when no ELD is found Ville Syrjälä
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=20190702130229.23742-1-simon.ser@intel.com \
--to=simon.ser@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=martin.peres@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.