diff options
author | Simon Ser <simon.ser@intel.com> | 2019-06-05 12:38:42 +0300 |
---|---|---|
committer | Simon Ser <simon.ser@intel.com> | 2019-06-07 13:52:34 +0300 |
commit | 8bc590d578e2178c0f372d1762716aa74d1f6f41 (patch) | |
tree | b029ad67d1b77f73beafab6296377ba98da8c3e6 /lib/igt_eld.c | |
parent | 02545be0f5d6e989ecb9b66668503bf687107cc6 (diff) |
lib/igt_eld: improve logging
- 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>
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
Diffstat (limited to 'lib/igt_eld.c')
-rw-r--r-- | lib/igt_eld.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/igt_eld.c b/lib/igt_eld.c index 1bb294e3..8b602796 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); } |