public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/igt_eld: print debug message when no ELD is found
@ 2019-07-02 13:02 Simon Ser
  2019-07-02 13:14 ` Ville Syrjälä
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Simon Ser @ 2019-07-02 13:02 UTC (permalink / raw)
  To: igt-dev; +Cc: martin.peres

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-03 11:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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ä
2019-07-02 14:57 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-07-03 11:35 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox