public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Antonio Argenziano <antonio.argenziano@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [RFC] igt/debugfs_test: Increase timeout for long open debugfs.
Date: Tue,  2 Oct 2018 15:29:21 -0700	[thread overview]
Message-ID: <20181002222921.11591-1-antonio.argenziano@intel.com> (raw)

While most debugFS's open is quick, guc_log_dump, when guc is loaded,
might take a long time. Increase the timeout for such debugFSs.

Sending this as an RFC because I am not sure it will apply to more debugfs or
if it would be best to just move the guc_* files into another subtest.

Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
---
 tests/debugfs_test.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c
index 2e87e442..5dfa4118 100644
--- a/tests/debugfs_test.c
+++ b/tests/debugfs_test.c
@@ -27,6 +27,23 @@
 #include <sys/types.h>
 #include <dirent.h>
 
+static bool is_long_open(const char *name)
+{
+	/* White list debugFSs that take a longer time to open. */
+	const char* slow_debugfs[] = {
+				"i915_guc_log_dump",
+				NULL
+	};
+	bool found = false;
+	int i = 0;
+
+	while (!found && slow_debugfs[i])	{
+		found = !!strncmp(name, slow_debugfs[i], sizeof(slow_debugfs[i++]));
+	}
+
+	return found;
+}
+
 static void read_and_discard_sysfs_entries(int path_fd, int indent)
 {
 	struct dirent *dirent;
@@ -63,7 +80,8 @@ static void read_and_discard_sysfs_entries(int path_fd, int indent)
 
 			igt_kmsg(KMSG_DEBUG "Reading file \"%s\"\n", dirent->d_name);
 			igt_debug("%sReading file \"%s\"\n", tabs, dirent->d_name);
-			igt_set_timeout(5, "reading sysfs entry");
+
+			igt_set_timeout(5 * (is_long_open(dirent->d_name) ? 10 : 1), "reading sysfs entry");
 
 			sub_fd = openat(path_fd, dirent->d_name, O_RDONLY);
 			if (sub_fd == -1) {
-- 
2.16.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2018-10-02 22:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-02 22:29 Antonio Argenziano [this message]
2018-10-02 23:02 ` [igt-dev] ✓ Fi.CI.BAT: success for igt/debugfs_test: Increase timeout for long open debugfs Patchwork
2018-10-03  8:40 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-10-03  8:51 ` [igt-dev] [RFC] " Chris Wilson

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=20181002222921.11591-1-antonio.argenziano@intel.com \
    --to=antonio.argenziano@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