public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/igt_eld: improve logging
@ 2019-06-05  9:51 Simon Ser
  2019-06-05  9:53 ` Peres, Martin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Simon Ser @ 2019-06-05  9:51 UTC (permalink / raw)
  To: igt-dev; +Cc: martin.peres

- Print a log line when a monitor isn't present
- Print a log line when a non-IGT ELD is parsed (rejigger the code flow to make
  skips uniform)
- Print the ELD path on read failure, just in case

Signed-off-by: Simon Ser <simon.ser@intel.com>
---
 lib/igt_eld.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/lib/igt_eld.c b/lib/igt_eld.c
index 1bb294e3fb2a..8b602796b23c 100644
--- a/lib/igt_eld.c
+++ b/lib/igt_eld.c
@@ -191,12 +191,14 @@ static bool eld_parse_entry(const char *path, struct eld_entry *eld)
 	}

 	if (ferror(f) != 0) {
-		igt_debug("Failed to read ELD file: %d\n", ferror(f));
+		igt_debug("Failed to read ELD file %s: %d\n", path, ferror(f));
 		return false;
 	}

 	fclose(f);

+	if (!monitor_present)
+		igt_debug("Monitor not present in ELD: %s\n", path);
 	return monitor_present;
 }

@@ -233,10 +235,15 @@ bool eld_has_igt(void)
 				continue;
 			}

-			if (strcmp(eld.monitor_name, "IGT") == 0) {
-				closedir(dir);
-				return true;
+			if (strcmp(eld.monitor_name, "IGT") != 0) {
+				igt_debug("Skipping non-IGT ELD: %s "
+					  "(monitor name: %s)\n",
+					  path, eld.monitor_name);
+				continue;
 			}
+
+			closedir(dir);
+			return true;
 		}
 		closedir(dir);
 	}
--
2.21.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-06-06 15:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-05  9:51 [igt-dev] [PATCH i-g-t] lib/igt_eld: improve logging Simon Ser
2019-06-05  9:53 ` Peres, Martin
2019-06-05 11:21 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-06-06 15:12 ` [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