[igt-dev] [PATCH i-g-t] lib/igt_eld: improve logging
Simon Ser
simon.ser at intel.com
Wed Jun 5 09:51:27 UTC 2019
- 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 at 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
More information about the igt-dev
mailing list