Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kamil Konieczny <kamil.konieczny@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Chris Wilson <chris.p.wilson@intel.com>
Subject: [igt-dev] [PATCH i-g-t] lib: Shut some excessive debug messages up
Date: Mon,  5 Jun 2023 20:03:59 +0200	[thread overview]
Message-ID: <20230605180359.39899-1-kamil.konieczny@linux.intel.com> (raw)

From: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>

In case of tests which extensively use debugfs, tons of useless debug
messages about opening a debugfs directory are emitted.  If the test fails
then important debug messages with details of the failure, interleaved
with sequences of those useless messages, are hard to find and read.

Replace igt_debug() with conditional igt_debug_on_f() emitting a message
about debugfs directory path only if open() fails.

v2: emit a message on NULL debugfs path

Cc: Chris Wilson <chris.p.wilson@intel.com>
Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
 lib/igt_debugfs.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index afde2da62..a7b54bae5 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -208,13 +208,16 @@ char *igt_debugfs_path(int device, char *path, int pathlen)
  */
 int igt_debugfs_dir(int device)
 {
+	int debugfs_dir_fd;
 	char path[200];
 
-	if (!igt_debugfs_path(device, path, sizeof(path)))
+	if (igt_debug_on(!igt_debugfs_path(device, path, sizeof(path))))
 		return -1;
 
-	igt_debug("Opening debugfs directory '%s'\n", path);
-	return open(path, O_RDONLY);
+	debugfs_dir_fd = open(path, O_RDONLY);
+	igt_debug_on_f(debugfs_dir_fd < 0, "path: %s\n", path);
+
+	return debugfs_dir_fd;
 }
 
 /**
-- 
2.39.2

             reply	other threads:[~2023-06-05 18:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05 18:03 Kamil Konieczny [this message]
2023-06-05 19:47 ` [igt-dev] ✓ Fi.CI.BAT: success for lib: Shut some excessive debug messages up Patchwork
2023-06-06 20:44 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-06-07  6:26 ` [igt-dev] [PATCH i-g-t] " Zbigniew Kempczyński
2023-06-07 12:09 ` Janusz Krzysztofik

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=20230605180359.39899-1-kamil.konieczny@linux.intel.com \
    --to=kamil.konieczny@linux.intel.com \
    --cc=chris.p.wilson@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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