public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
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: improve logging
Date: Wed,  5 Jun 2019 12:51:27 +0300	[thread overview]
Message-ID: <20190605095127.31279-1-simon.ser@intel.com> (raw)

- 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

             reply	other threads:[~2019-06-05  9:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05  9:51 Simon Ser [this message]
2019-06-05  9:53 ` [igt-dev] [PATCH i-g-t] lib/igt_eld: improve logging 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

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=20190605095127.31279-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox