All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [RFC PATCH i-g-t 1/6] tests/sw_sync: use igt_fork_helper
@ 2018-02-21 15:19 Petri Latvala
  2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t 2/6] lib/core: make logging pthread vs. fork safe Petri Latvala
                   ` (8 more replies)
  0 siblings, 9 replies; 16+ messages in thread
From: Petri Latvala @ 2018-02-21 15:19 UTC (permalink / raw)
  To: igt-dev; +Cc: Robert Foss, Daniel Vetter

From: Daniel Vetter <daniel.vetter@ffwll.ch>

I'll need to wrap a bit of magic around all the fork() calls in our
tests. Simplest way to get there is to roll out the existing helpers,
which even saves a bit of boilerplate code.

Cc: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 tests/sw_sync.c | 54 ++++++++++++++++++------------------------------------
 1 file changed, 18 insertions(+), 36 deletions(-)

diff --git a/tests/sw_sync.c b/tests/sw_sync.c
index 20dfbbb9..24974a2f 100644
--- a/tests/sw_sync.c
+++ b/tests/sw_sync.c
@@ -175,6 +175,7 @@ static void test_sync_busy_fork_unixsocket(void)
 	int timeline;
 	int skip = 0;
 	int sv[2];
+	struct igt_helper_process proc;
 
 
 	timeline = sw_sync_timeline_create();
@@ -185,9 +186,7 @@ static void test_sync_busy_fork_unixsocket(void)
 		goto out;
 	}
 
-	switch (fork()) {
-	case 0:
-	{
+	igt_fork_helper(&proc) {
 		/* Child process */
 		int socket = sv[1];
 		int socket_timeline;
@@ -213,17 +212,8 @@ static void test_sync_busy_fork_unixsocket(void)
 
 		/* Advance timeline from 0 -> 1 */
 		sw_sync_timeline_inc(socket_timeline, 1);
-
-		_Exit(0);
-		break;
-	}
-	case -1:
-	{
-		/* Failed fork */
-		skip = 1;
-		break;
 	}
-	default:
+
 	{
 		/* Parent process */
 		int socket = sv[0];
@@ -252,15 +242,14 @@ static void test_sync_busy_fork_unixsocket(void)
 
 		if (sendmsg(socket, &msg, 0) < 0) {
 		    skip = 1;
-		    goto out;
+		} else {
+			igt_assert_f(sync_fence_wait(fence, 2*1000) == 0,
+				     "Fence not signaled (timeline value 1 fence seqno 1)\n");
 		}
-
-		igt_assert_f(sync_fence_wait(fence, 2*1000) == 0,
-			     "Fence not signaled (timeline value 1 fence seqno 1)\n");
-		break;
-	}
 	}
 
+	igt_stop_helper(&proc);
+
 out:
 	close(fence);
 	close(timeline);
@@ -272,32 +261,25 @@ static void test_sync_busy_fork(void)
 	int fence;
 	int timeline;
 	int skip = 0;
+	struct igt_helper_process proc;
 
 	timeline = sw_sync_timeline_create();
 	fence = sw_sync_timeline_create_fence(timeline, 1);
 
-	switch (fork()) {
-	case 0:
-		/* Child process */
+	igt_fork_helper(&proc) {
 		usleep(1*1000*1000);
 		/* Advance timeline from 0 -> 1 */
 		sw_sync_timeline_inc(timeline, 1);
-		_Exit(0);
-		break;
-	case -1:
-		/* Failed fork */
-		skip = 1;
-		break;
-	default:
-		/* Parent process */
-		igt_assert_f(sync_fence_wait(fence, 0) == -ETIME,
-			     "Fence signaled (it should not have been signalled yet)\n");
-
-		igt_assert_f(sync_fence_wait(fence, 2*1000) == 0,
-			     "Fence not signaled (timeline value 1 fence seqno 1)\n");
-		break;
 	}
 
+	igt_assert_f(sync_fence_wait(fence, 0) == -ETIME,
+		     "Fence signaled (it should not have been signalled yet)\n");
+
+	igt_assert_f(sync_fence_wait(fence, 2*1000) == 0,
+		     "Fence not signaled (timeline value 1 fence seqno 1)\n");
+
+	igt_stop_helper(&proc);
+
 	close(fence);
 	close(timeline);
 	igt_require(!skip);
-- 
2.14.1

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

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [igt-dev] [RFC PATCH i-g-t 2/6] lib/core: make logging pthread vs. fork safe
  2018-02-21 15:19 [igt-dev] [RFC PATCH i-g-t 1/6] tests/sw_sync: use igt_fork_helper Petri Latvala
@ 2018-02-21 15:19 ` Petri Latvala
  2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t 3/6] lib/core: Don't hide non-debug message when filtering for a debug log domain Petri Latvala
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: Petri Latvala @ 2018-02-21 15:19 UTC (permalink / raw)
  To: igt-dev; +Cc: Daniel Vetter

From: Daniel Vetter <daniel.vetter@ffwll.ch>

fork() is a pretty thing in a multithreaded program, it's essentially
as bad as handling signals: When we fork the memory snapshot we can
interrupts all other threads at any place, including while they're
holding mutexes and other fun stuff.

libc itself has some internal fork handlers to clear caches and make
sure locks stay in a safe place (we've had plenty of fun with e.g. the
pid/tid caches when a signal happens too fast).

I want to put dmesg capture into igt, into a separate thread (so that
dmesg capture nicely interleaves what the test is doing, +/- races),
and stuff all the dmesg output into the igt logger. Which means we
need to make sure that the log_buffer_mutex is in a predictable state.

Since we have 2 calls to fork() extract a little helper for this.

v2: Stop using fflush(NULL) - somehow this manages to hit a bug in
libc when using a FILE in a separate thread (for capturing dmesg).
Instead explicitly flush stderr and stdout only.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 lib/igt_core.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 558a538d..8e7f0da8 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1518,6 +1518,21 @@ static void fork_helper_exit_handler(int sig)
 	assert(helper_process_count == 0);
 }
 
+static pid_t __igt_fork_wrapper(void)
+{
+	pid_t ret;
+
+	/* ensure any buffers are flushed before fork */
+	fflush(stdout);
+	fflush(stderr);
+
+	pthread_mutex_lock(&log_buffer_mutex);
+	ret = fork();
+	pthread_mutex_unlock(&log_buffer_mutex);
+
+	return ret;
+}
+
 bool __igt_fork_helper(struct igt_helper_process *proc)
 {
 	pid_t pid;
@@ -1540,10 +1555,7 @@ bool __igt_fork_helper(struct igt_helper_process *proc)
 	tmp_count = exit_handler_count;
 	exit_handler_count = 0;
 
-	/* ensure any buffers are flushed before fork */
-	fflush(NULL);
-
-	switch (pid = fork()) {
+	switch (pid = __igt_fork_wrapper()) {
 	case -1:
 		exit_handler_count = tmp_count;
 		igt_assert(0);
@@ -1642,10 +1654,7 @@ bool __igt_fork(void)
 		igt_assert(test_children);
 	}
 
-	/* ensure any buffers are flushed before fork */
-	fflush(NULL);
-
-	switch (test_children[num_test_children++] = fork()) {
+	switch (test_children[num_test_children++] = __igt_fork_wrapper()) {
 	case -1:
 		igt_assert(0);
 	case 0:
-- 
2.14.1

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

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [igt-dev] [RFC PATCH i-g-t 3/6] lib/core: Don't hide non-debug message when filtering for a debug log domain
  2018-02-21 15:19 [igt-dev] [RFC PATCH i-g-t 1/6] tests/sw_sync: use igt_fork_helper Petri Latvala
  2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t 2/6] lib/core: make logging pthread vs. fork safe Petri Latvala
@ 2018-02-21 15:19 ` Petri Latvala
  2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t v5 4/6] igt/core: Initial simple interleaved kmsg filtering Petri Latvala
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: Petri Latvala @ 2018-02-21 15:19 UTC (permalink / raw)
  To: igt-dev

From: Daniel Vetter <daniel.vetter@ffwll.ch>

I think this is the more sensible semantics, since this allows you to
still follow what's going on with the test at a high level, while
filtering for a specific (or multiple specific) debug log domains.

For non-debug messages log-domains technically exist, but we're not
making much use of them really.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 lib/igt_core.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 8e7f0da8..aaafc1df 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -291,7 +291,7 @@ enum {
 static int igt_exitcode = IGT_EXIT_SUCCESS;
 static const char *command_str;
 
-static char* igt_log_domain_filter;
+static char* igt_debug_log_domain_filter;
 static struct {
 	char *entries[256];
 	uint8_t start, end;
@@ -757,7 +757,7 @@ static int common_init(int *argc, char **argv,
 		case OPT_DEBUG:
 			igt_log_level = IGT_LOG_DEBUG;
 			if (optarg && strlen(optarg) > 0)
-				igt_log_domain_filter = strdup(optarg);
+				igt_debug_log_domain_filter = strdup(optarg);
 			break;
 		case OPT_LIST_SUBTESTS:
 			if (!run_single_subtest)
@@ -2104,12 +2104,12 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format,
 		goto out;
 
 	/* check domain filter */
-	if (igt_log_domain_filter) {
+	if (level == IGT_LOG_DEBUG && igt_debug_log_domain_filter) {
 		/* if null domain and filter is not "application", return */
-		if (!domain && strcmp(igt_log_domain_filter, "application"))
+		if (!domain && strcmp(igt_debug_log_domain_filter, "application"))
 			goto out;
 		/* else if domain and filter do not match, return */
-		else if (domain && strcmp(igt_log_domain_filter, domain))
+		else if (domain && strcmp(igt_debug_log_domain_filter, domain))
 			goto out;
 	}
 
-- 
2.14.1

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

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [igt-dev] [RFC PATCH i-g-t v5 4/6] igt/core: Initial simple interleaved kmsg filtering
  2018-02-21 15:19 [igt-dev] [RFC PATCH i-g-t 1/6] tests/sw_sync: use igt_fork_helper Petri Latvala
  2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t 2/6] lib/core: make logging pthread vs. fork safe Petri Latvala
  2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t 3/6] lib/core: Don't hide non-debug message when filtering for a debug log domain Petri Latvala
@ 2018-02-21 15:19 ` Petri Latvala
  2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t 5/6] lib/core: report subtests that hit an igt_warning as WARNING Petri Latvala
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: Petri Latvala @ 2018-02-21 15:19 UTC (permalink / raw)
  To: igt-dev

From: Daniel Vetter <daniel.vetter@ffwll.ch>

Needs to be beefed up so that dmesg warning (and worse) are re-emmitted
as IGT_LOG_WARN. But only if they match one of our filters (which we
should probably allow to be extended, e.g. depending upon which driver
has been openened). This also requires that we at least parse the
basic of kmsg lines (adjusting the timestamp to match our own would be
real cool).

v2:
- Seek to the end of the kmsg buffer before starting the capturing.
- Increase linebuffer to avoid dmesg drowning out all the tests
  messages.

v3: Unlazy slightly and implement semi-correct kmsg parsing.

v4 (Petri): Handle continuation lines instead of crashing on them

v5 (Petri): Handle EPIPE, handle fragment continuations, point to
 format docs

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 lib/igt_core.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 86 insertions(+), 1 deletion(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index aaafc1df..86f18a21 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -293,7 +293,7 @@ static const char *command_str;
 
 static char* igt_debug_log_domain_filter;
 static struct {
-	char *entries[256];
+	char *entries[2000];
 	uint8_t start, end;
 } log_buffer;
 static pthread_mutex_t log_buffer_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -581,6 +581,89 @@ static void oom_adjust_for_doom(void)
 
 }
 
+static void *kmsg_capture(void *arg)
+{
+	/*
+	 * See Documentation/ABI/testing/dev-kmsg in the kernel
+	 * sources for documentation on the message format.
+	 */
+
+	int kmsg_capture_fd = (uintptr_t) arg;
+	FILE *kmsg_file = fdopen(kmsg_capture_fd, "r");
+	char *line = NULL;
+	size_t line_len = 0;
+	ssize_t read;
+
+	while ((read = getline(&line, &line_len, kmsg_file))) {
+		int s;
+		unsigned flags;
+		unsigned long long seq, ts_usec;
+		char continuation;
+		enum igt_log_level level;
+
+		if (read < 0) {
+			if (errno == EPIPE)
+				/* We can get EPIPE on buffer overflow */
+				continue;
+			else
+				break;
+		}
+
+		s = sscanf(line, "%u,%llu,%llu,%c;", &flags,
+			   &seq, &ts_usec, &continuation);
+
+		if (s == 4) {
+			if ((flags & 0x7) <= 4)
+				level = IGT_LOG_WARN;
+			else
+				level = IGT_LOG_DEBUG;
+
+			if (continuation == 'c')
+				/*
+				 * KERN_CONT fragment, log level in
+				 * this log record is the default log
+				 * level instead of the one the
+				 * fragment continues.
+				 */
+				level = IGT_LOG_DEBUG;
+
+			igt_log("dmesg", level, "[%llu.%06llu], %s",
+				ts_usec / 1000000,
+				ts_usec % 1000000,
+				index(line, ';') + 1);
+		} else if (line[0] == ' ') {
+			/* Machine readable key/value pairs, ignore */
+		} else {
+			igt_warn("Cannot parse kmsg line: %s\n", line);
+		}
+	}
+
+	igt_warn("ran out of dmesg, this shouldn't happen\n");
+
+	free(line);
+	fclose(kmsg_file);
+	return NULL;
+}
+
+static void start_kmsg_recording(void)
+{
+	static pthread_t kmsg_capture_thread;
+	int kmsg_capture_fd;
+
+	kmsg_capture_fd = open("/dev/kmsg",
+			       O_RDONLY | O_CLOEXEC);
+
+	if (kmsg_capture_fd < 0) {
+		igt_info("no dmesg capturing\n");
+		return;
+	}
+
+	lseek(kmsg_capture_fd, 0, SEEK_END);
+
+	pthread_create(&kmsg_capture_thread, NULL,
+		       kmsg_capture, (void *)(uintptr_t) kmsg_capture_fd);
+}
+
 #ifdef HAVE_GLIB
 static void common_init_config(void)
 {
@@ -814,6 +897,8 @@ out:
 		kmsg(KERN_INFO "[IGT] %s: executing\n", command_str);
 		print_version();
 
+		start_kmsg_recording();
+
 		sync();
 		oom_adjust_for_doom();
 		ftrace_dump_on_oops(true);
-- 
2.14.1

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

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [igt-dev] [RFC PATCH i-g-t 5/6] lib/core: report subtests that hit an igt_warning as WARNING
  2018-02-21 15:19 [igt-dev] [RFC PATCH i-g-t 1/6] tests/sw_sync: use igt_fork_helper Petri Latvala
                   ` (2 preceding siblings ...)
  2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t v5 4/6] igt/core: Initial simple interleaved kmsg filtering Petri Latvala
@ 2018-02-21 15:19 ` Petri Latvala
  2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t 6/6] lib/core: Use whitelist with kmsg filter Petri Latvala
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: Petri Latvala @ 2018-02-21 15:19 UTC (permalink / raw)
  To: igt-dev

From: Daniel Vetter <daniel.vetter@ffwll.ch>

This is another piece of prep work to push the detection of dmesg
warnings into igt itself, so that we can correctly report dmesg
issue on a per-subtest basis even when running the entire binary.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 lib/igt_core.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 86f18a21..5c93432d 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1067,6 +1067,7 @@ void __igt_subtest_group_restore(int save)
 static bool skipped_one = false;
 static bool succeeded_one = false;
 static bool failed_one = false;
+static bool warned = false;
 
 static void exit_subtest(const char *) __attribute__((noreturn));
 static void exit_subtest(const char *result)
@@ -1083,6 +1084,7 @@ static void exit_subtest(const char *result)
 	igt_terminate_spin_batches();
 
 	in_subtest = NULL;
+	warned = false;
 	siglongjmp(igt_subtest_jmpbuf, 1);
 }
 
@@ -1172,7 +1174,7 @@ void igt_success(void)
 {
 	succeeded_one = true;
 	if (in_subtest)
-		exit_subtest("SUCCESS");
+		exit_subtest(warned ? "WARNING" : "SUCCESS");
 }
 
 /**
@@ -2166,6 +2168,9 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format,
 	if (list_subtests && level <= IGT_LOG_WARN)
 		return;
 
+	if (level >= IGT_LOG_WARN)
+		warned = true;
+
 	if (vasprintf(&line, format, args) == -1)
 		return;
 
-- 
2.14.1

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

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [igt-dev] [RFC PATCH i-g-t 6/6] lib/core: Use whitelist with kmsg filter
  2018-02-21 15:19 [igt-dev] [RFC PATCH i-g-t 1/6] tests/sw_sync: use igt_fork_helper Petri Latvala
                   ` (3 preceding siblings ...)
  2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t 5/6] lib/core: report subtests that hit an igt_warning as WARNING Petri Latvala
@ 2018-02-21 15:19 ` Petri Latvala
  2018-02-21 15:32   ` Chris Wilson
                     ` (2 more replies)
  2018-02-21 15:22 ` [igt-dev] [RFC PATCH i-g-t 1/6] tests/sw_sync: use igt_fork_helper Chris Wilson
                   ` (3 subsequent siblings)
  8 siblings, 3 replies; 16+ messages in thread
From: Petri Latvala @ 2018-02-21 15:19 UTC (permalink / raw)
  To: igt-dev

dmesg messages of level >=warn don't result in an IGT_LOG_WARN if they
match a whitelist regexp now.

The whitelist is not configureable without rebuilding, and it's not
even possible to use a different whitelist for different drivers;
launching the kmsg monitor happens way before opening the driver (if
any).

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 lib/igt_core.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 5c93432d..d4495c3f 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -55,6 +55,7 @@
 #include <limits.h>
 #include <locale.h>
 #include <uwildmat/uwildmat.h>
+#include <regex.h>
 #ifdef HAVE_GLIB
 #include <glib.h>
 #endif
@@ -581,6 +582,16 @@ static void oom_adjust_for_doom(void)
 
 }
 
+const char IGT_DMESG_WHITELIST[] =
+	"IRQ [0-9]+: no longer affine to CPU[0-9]+"
+	"|IRQ fixup: irq [0-9]+ move in progress, old vector [0-9]+"
+	"|Setting dangerous option [a-z_]+ - tainting kernel"
+	"|Suspending console\\(s\\) \\(use no_console_suspend to debug\\)"
+	"|cache: parent cpu[0-9]+ should not be sleeping"
+	"|hpet[0-9]+: lost [0-9]+ rtc interrupts"
+	"|usb usb[0-9]+: root hub lost power or was reset"
+	;
+
 static void *kmsg_capture(void *arg)
 {
 	/*
@@ -593,6 +604,13 @@ static void *kmsg_capture(void *arg)
 	char *line = NULL;
 	size_t line_len = 0;
 	ssize_t read;
+	regex_t re;
+
+	if (regcomp(&re, IGT_DMESG_WHITELIST, REG_EXTENDED | REG_NOSUB) != 0) {
+		igt_warn("Cannot compile dmesg whitelist regexp\n");
+		fclose(kmsg_file);
+		return NULL;
+	}
 
 	while ((read = getline(&line, &line_len, kmsg_file))) {
 		int s;
@@ -613,7 +631,8 @@ static void *kmsg_capture(void *arg)
 			   &seq, &ts_usec, &continuation);
 
 		if (s == 4) {
-			if ((flags & 0x7) <= 4)
+			if ((flags & 0x7) <= 4 &&
+			    regexec(&re, line, (size_t)0, NULL, 0))
 				level = IGT_LOG_WARN;
 			else
 				level = IGT_LOG_DEBUG;
-- 
2.14.1

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

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [igt-dev] [RFC PATCH i-g-t 1/6] tests/sw_sync: use igt_fork_helper
  2018-02-21 15:19 [igt-dev] [RFC PATCH i-g-t 1/6] tests/sw_sync: use igt_fork_helper Petri Latvala
                   ` (4 preceding siblings ...)
  2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t 6/6] lib/core: Use whitelist with kmsg filter Petri Latvala
@ 2018-02-21 15:22 ` Chris Wilson
  2018-02-21 20:48 ` [igt-dev] ✗ Fi.CI.BAT: warning for series starting with [RFC,i-g-t,1/6] " Patchwork
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: Chris Wilson @ 2018-02-21 15:22 UTC (permalink / raw)
  To: Petri Latvala, igt-dev; +Cc: Robert Foss, Daniel Vetter

Quoting Petri Latvala (2018-02-21 15:19:30)
> From: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> I'll need to wrap a bit of magic around all the fork() calls in our
> tests. Simplest way to get there is to roll out the existing helpers,
> which even saves a bit of boilerplate code.
> 
> Cc: Robert Foss <robert.foss@collabora.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

While this patch is a simple mechanical translation, we don't need to
be using a fork helper here as a timer will do the do. Future
improvement.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [igt-dev] [RFC PATCH i-g-t 6/6] lib/core: Use whitelist with kmsg filter
  2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t 6/6] lib/core: Use whitelist with kmsg filter Petri Latvala
@ 2018-02-21 15:32   ` Chris Wilson
  2018-02-26 15:45   ` Chris Wilson
  2018-03-01 11:15   ` [igt-dev] [PATCH i-g-t v3 1/1] " Petri Latvala
  2 siblings, 0 replies; 16+ messages in thread
From: Chris Wilson @ 2018-02-21 15:32 UTC (permalink / raw)
  To: Petri Latvala, igt-dev

Quoting Petri Latvala (2018-02-21 15:19:35)
> dmesg messages of level >=warn don't result in an IGT_LOG_WARN if they
> match a whitelist regexp now.
> 
> The whitelist is not configureable without rebuilding, and it's not
> even possible to use a different whitelist for different drivers;
> launching the kmsg monitor happens way before opening the driver (if
> any).
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> ---
>  lib/igt_core.c | 21 ++++++++++++++++++++-
>  1 file changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 5c93432d..d4495c3f 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -55,6 +55,7 @@
>  #include <limits.h>
>  #include <locale.h>
>  #include <uwildmat/uwildmat.h>
> +#include <regex.h>
>  #ifdef HAVE_GLIB
>  #include <glib.h>
>  #endif
> @@ -581,6 +582,16 @@ static void oom_adjust_for_doom(void)
>  
>  }
>  
> +const char IGT_DMESG_WHITELIST[] =
static. No need to shout.

> +       "IRQ [0-9]+: no longer affine to CPU[0-9]+"

#define _ "|"

	"IRQ [0-9]+: no longer affine to CPU[0-9]+" _
	"IRQ fixup: irq [0-9]+ move in progress, old vector [0-9]+" _
	"Setting dangerous option [a-z_]+ - tainting kernel" _
	...

#undef _

?

> +       "|IRQ fixup: irq [0-9]+ move in progress, old vector [0-9]+"
> +       "|Setting dangerous option [a-z_]+ - tainting kernel"
> +       "|Suspending console\\(s\\) \\(use no_console_suspend to debug\\)"
> +       "|cache: parent cpu[0-9]+ should not be sleeping"
> +       "|hpet[0-9]+: lost [0-9]+ rtc interrupts"
> +       "|usb usb[0-9]+: root hub lost power or was reset"
> +       ;
> +
>  static void *kmsg_capture(void *arg)
>  {
>         /*
> @@ -593,6 +604,13 @@ static void *kmsg_capture(void *arg)
>         char *line = NULL;
>         size_t line_len = 0;
>         ssize_t read;
> +       regex_t re;
> +
> +       if (regcomp(&re, IGT_DMESG_WHITELIST, REG_EXTENDED | REG_NOSUB) != 0) {
> +               igt_warn("Cannot compile dmesg whitelist regexp\n");
> +               fclose(kmsg_file);
> +               return NULL;
> +       }
>  
>         while ((read = getline(&line, &line_len, kmsg_file))) {
>                 int s;
> @@ -613,7 +631,8 @@ static void *kmsg_capture(void *arg)
>                            &seq, &ts_usec, &continuation);
>  
>                 if (s == 4) {
> -                       if ((flags & 0x7) <= 4)
> +                       if ((flags & 0x7) <= 4 &&
> +                           regexec(&re, line, (size_t)0, NULL, 0))

regexec() == REG_NOMATCH to be clearer?
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [igt-dev] ✗ Fi.CI.BAT: warning for series starting with [RFC,i-g-t,1/6] tests/sw_sync: use igt_fork_helper
  2018-02-21 15:19 [igt-dev] [RFC PATCH i-g-t 1/6] tests/sw_sync: use igt_fork_helper Petri Latvala
                   ` (5 preceding siblings ...)
  2018-02-21 15:22 ` [igt-dev] [RFC PATCH i-g-t 1/6] tests/sw_sync: use igt_fork_helper Chris Wilson
@ 2018-02-21 20:48 ` Patchwork
  2018-02-23 11:36 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  2018-03-01 23:10 ` [igt-dev] ✗ Fi.CI.BAT: warning " Patchwork
  8 siblings, 0 replies; 16+ messages in thread
From: Patchwork @ 2018-02-21 20:48 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: series starting with [RFC,i-g-t,1/6] tests/sw_sync: use igt_fork_helper
URL   : https://patchwork.freedesktop.org/series/38708/
State : warning

== Summary ==

IGT patchset tested on top of latest successful build
960e55a87d7b7d7385063e37cc9f281df2be8037 igt/gem_ctx_isolation: Check isolation of registers between contexts

with latest DRM-Tip kernel build CI_DRM_3817
562a3886d1cd drm-tip: 2018y-02m-21d-18h-35m-44s UTC integration manifest

No testlist changes.

Test debugfs_test:
        Subgroup read_all_entries:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
Test gem_exec_fence:
        Subgroup basic-busy-default:
                pass       -> WARN       (fi-blb-e6850)
                pass       -> WARN       (fi-pnv-d510)
                pass       -> WARN       (fi-ilk-650)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-bxt-dsi)
        Subgroup basic-wait-default:
                pass       -> WARN       (fi-pnv-d510)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-skl-6770hq)
        Subgroup basic-await-default:
                pass       -> WARN       (fi-pnv-d510)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-glk-1)
        Subgroup await-hang-default:
                pass       -> WARN       (fi-pnv-d510)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-bdw-gvtdvm)
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-bxt-j4205)
        Subgroup nb-await-default:
                pass       -> WARN       (fi-pnv-d510)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-bxt-j4205)
                pass       -> WARN       (fi-glk-1)
Test gem_exec_suspend:
        Subgroup basic-s3:
                pass       -> WARN       (fi-snb-2520m)
                pass       -> WARN       (fi-snb-2600) fdo#103880
                pass       -> WARN       (fi-ivb-3520m)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-bdw-gvtdvm)
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-skl-6260u) fdo#104108 +14
                pass       -> WARN       (fi-skl-6700hq)
                pass       -> WARN       (fi-skl-guc)
                pass       -> WARN       (fi-bxt-dsi)
                pass       -> WARN       (fi-bxt-j4205) fdo#105009
                pass       -> WARN       (fi-kbl-7560u)
                pass       -> WARN       (fi-kbl-r)
                pass       -> WARN       (fi-glk-1)
                pass       -> WARN       (fi-cfl-s2)
        Subgroup basic-s4-devices:
                pass       -> WARN       (fi-snb-2600)
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-6770hq)
                pass       -> WARN       (fi-skl-guc)
                pass       -> WARN       (fi-bxt-dsi)
                pass       -> WARN       (fi-kbl-7500u)
                pass       -> WARN       (fi-kbl-r)
                pass       -> WARN       (fi-glk-1)
                pass       -> WARN       (fi-cfl-s2) fdo#105071
Test gem_ringfill:
        Subgroup basic-default:
                pass       -> WARN       (fi-pnv-d510)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-bsw-n3050)
        Subgroup basic-default-interruptible:
                pass       -> WARN       (fi-pnv-d510)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-cfl-s2)
        Subgroup basic-default-forked:
                pass       -> WARN       (fi-pnv-d510)
                pass       -> WARN       (fi-elk-e7500)
                pass       -> WARN       (fi-snb-2520m)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-bsw-n3050)
        Subgroup basic-default-fd:
                pass       -> WARN       (fi-pnv-d510)
                pass       -> WARN       (fi-snb-2520m)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-bsw-n3050)
        Subgroup basic-default-hang:
                dmesg-warn -> DMESG-FAIL (fi-blb-e6850) fdo#101600 +1
                pass       -> WARN       (fi-ilk-650)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-bxt-j4205)
Test kms_busy:
        Subgroup basic-flip-a:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-b:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-c:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
Test kms_chamelium:
        Subgroup hdmi-hpd-fast:
                pass       -> WARN       (fi-skl-6700k2)
        Subgroup hdmi-edid-read:
                pass       -> WARN       (fi-skl-6700k2)
        Subgroup hdmi-crc-fast:
                pass       -> WARN       (fi-skl-6700k2)
        Subgroup common-hpd-after-suspend:
                pass       -> WARN       (fi-skl-6700k2)
                dmesg-warn -> DMESG-FAIL (fi-kbl-7500u) fdo#102505
Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-atomic:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-busy-flip-before-cursor-legacy:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-after-cursor-atomic:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-after-cursor-legacy:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-after-cursor-varying-size:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-before-cursor-atomic:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-before-cursor-legacy:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-before-cursor-varying-size:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
Test kms_flip:
        Subgroup basic-flip-vs-dpms:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
                pass       -> WARN       (fi-kbl-7567u)
        Subgroup basic-flip-vs-modeset:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-vs-wf_vblank:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-plain-flip:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
Test kms_pipe_crc_basic:
        Subgroup bad-nb-words-1:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup bad-nb-words-3:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup bad-pipe:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup bad-source:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup hang-read-crc-pipe-a:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup hang-read-crc-pipe-b:
                pass       -> WARN       (fi-skl-6700k2) fdo#103191 +17
        Subgroup nonblocking-crc-pipe-a:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup nonblocking-crc-pipe-a-frame-sequence:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup nonblocking-crc-pipe-b:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup nonblocking-crc-pipe-c:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup nonblocking-crc-pipe-c-frame-sequence:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup read-crc-pipe-a:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup read-crc-pipe-c-frame-sequence:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup suspend-read-crc-pipe-a:
                pass       -> WARN       (fi-bwr-2160)
                pass       -> WARN       (fi-ivb-3520m)
                pass       -> WARN       (fi-bdw-gvtdvm)
                pass       -> WARN       (fi-skl-6260u)
                pass       -> WARN       (fi-skl-6600u)
                pass       -> WARN       (fi-skl-6700hq) fdo#101144
                pass       -> WARN       (fi-skl-6770hq)
                pass       -> WARN       (fi-skl-gvtdvm)
                pass       -> WARN       (fi-bxt-dsi)
                pass       -> WARN       (fi-bxt-j4205)
                pass       -> WARN       (fi-kbl-7560u)
                pass       -> WARN       (fi-kbl-r)
                pass       -> WARN       (fi-glk-1)
                pass       -> WARN       (fi-cfl-s2)
        Subgroup suspend-read-crc-pipe-b:
                pass       -> WARN       (fi-bwr-2160)
                pass       -> WARN       (fi-ilk-650)
                pass       -> WARN       (fi-ivb-3520m)
                pass       -> WARN       (fi-bdw-gvtdvm)
                pass       -> WARN       (fi-bxt-dsi)
                pass       -> WARN       (fi-bxt-j4205)
                pass       -> WARN       (fi-kbl-7560u)
                pass       -> WARN       (fi-kbl-r)
                pass       -> WARN       (fi-glk-1)
                pass       -> WARN       (fi-cfl-s2)
        Subgroup suspend-read-crc-pipe-c:
                pass       -> WARN       (fi-ivb-3520m)
                pass       -> WARN       (fi-bdw-gvtdvm)
                pass       -> WARN       (fi-bxt-dsi) fdo#103927
                pass       -> WARN       (fi-bxt-j4205)
                pass       -> WARN       (fi-kbl-7560u)
                pass       -> WARN       (fi-kbl-r)
                pass       -> WARN       (fi-glk-1)
                pass       -> WARN       (fi-cfl-s2)
Test pm_rpm:
        Subgroup basic-pci-d3-state:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-rte:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
Test drv_module_reload:
        Subgroup basic-reload:
                pass       -> WARN       (fi-ilk-650)
                pass       -> WARN       (fi-skl-6700hq)
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
                pass       -> WARN       (fi-glk-1)
        Subgroup basic-no-display:
                pass       -> WARN       (fi-ilk-650)
                pass       -> WARN       (fi-hsw-4770)
                pass       -> WARN       (fi-bdw-5557u)
                pass       -> WARN       (fi-skl-6700hq)
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
                pass       -> WARN       (fi-glk-1)
        Subgroup basic-reload-inject:
                pass       -> WARN       (fi-ilk-650)
                pass       -> WARN       (fi-hsw-4770)
                pass       -> WARN       (fi-bdw-5557u)
                pass       -> WARN       (fi-skl-6700hq)
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
                pass       -> WARN       (fi-glk-1)

fdo#103880 https://bugs.freedesktop.org/show_bug.cgi?id=103880
fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
fdo#105009 https://bugs.freedesktop.org/show_bug.cgi?id=105009
fdo#105071 https://bugs.freedesktop.org/show_bug.cgi?id=105071
fdo#101600 https://bugs.freedesktop.org/show_bug.cgi?id=101600
fdo#102505 https://bugs.freedesktop.org/show_bug.cgi?id=102505
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#101144 https://bugs.freedesktop.org/show_bug.cgi?id=101144
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927

fi-bdw-5557u     total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:21  time:421s
fi-bdw-gvtdvm    total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:24  time:430s
fi-blb-e6850     total:288  pass:222  dwarn:0   dfail:1   fail:0   skip:64  time:374s
fi-bsw-n3050     total:288  pass:231  dwarn:0   dfail:0   fail:0   skip:46  time:498s
fi-bwr-2160      total:288  pass:181  dwarn:0   dfail:0   fail:0   skip:105 time:286s
fi-bxt-dsi       total:288  pass:252  dwarn:0   dfail:0   fail:0   skip:30  time:481s
fi-bxt-j4205     total:288  pass:252  dwarn:0   dfail:0   fail:0   skip:29  time:481s
fi-byt-j1900     total:288  pass:243  dwarn:0   dfail:0   fail:0   skip:35  time:471s
fi-byt-n2820     total:288  pass:238  dwarn:0   dfail:0   fail:0   skip:39  time:459s
fi-cfl-s2        total:288  pass:256  dwarn:0   dfail:0   fail:0   skip:26  time:568s
fi-elk-e7500     total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:59  time:415s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:288s
fi-glk-1         total:288  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:510s
fi-hsw-4770      total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:27  time:390s
fi-ilk-650       total:288  pass:222  dwarn:0   dfail:0   fail:0   skip:60  time:414s
fi-ivb-3520m     total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:29  time:464s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:410s
fi-kbl-7500u     total:288  pass:262  dwarn:0   dfail:1   fail:0   skip:24  time:453s
fi-kbl-7560u     total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:19  time:493s
fi-kbl-7567u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:20  time:450s
fi-kbl-r         total:288  pass:256  dwarn:0   dfail:0   fail:0   skip:27  time:493s
fi-pnv-d510      total:288  pass:213  dwarn:0   dfail:1   fail:0   skip:65  time:588s
fi-skl-6260u     total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:20  time:426s
fi-skl-6600u     total:288  pass:257  dwarn:0   dfail:0   fail:0   skip:27  time:504s
fi-skl-6700hq    total:288  pass:257  dwarn:0   dfail:0   fail:0   skip:26  time:522s
fi-skl-6700k2    total:288  pass:214  dwarn:0   dfail:0   fail:0   skip:24  time:487s
fi-skl-6770hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:20  time:467s
fi-skl-guc       total:288  pass:215  dwarn:0   dfail:0   fail:0   skip:28  time:407s
fi-skl-gvtdvm    total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:23  time:430s
fi-snb-2520m     total:288  pass:245  dwarn:0   dfail:0   fail:0   skip:40  time:524s
fi-snb-2600      total:288  pass:246  dwarn:0   dfail:0   fail:0   skip:40  time:403s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_977/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [RFC,i-g-t,1/6] tests/sw_sync: use igt_fork_helper
  2018-02-21 15:19 [igt-dev] [RFC PATCH i-g-t 1/6] tests/sw_sync: use igt_fork_helper Petri Latvala
                   ` (6 preceding siblings ...)
  2018-02-21 20:48 ` [igt-dev] ✗ Fi.CI.BAT: warning for series starting with [RFC,i-g-t,1/6] " Patchwork
@ 2018-02-23 11:36 ` Patchwork
  2018-03-01 23:10 ` [igt-dev] ✗ Fi.CI.BAT: warning " Patchwork
  8 siblings, 0 replies; 16+ messages in thread
From: Patchwork @ 2018-02-23 11:36 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: series starting with [RFC,i-g-t,1/6] tests/sw_sync: use igt_fork_helper
URL   : https://patchwork.freedesktop.org/series/38708/
State : failure

== Summary ==

Test kms_plane:
        Subgroup plane-panning-bottom-right-suspend-pipe-a-planes:
                pass       -> WARN       (shard-snb) fdo#102365
                pass       -> WARN       (shard-apl) fdo#103166
        Subgroup plane-panning-bottom-right-suspend-pipe-c-planes:
                pass       -> WARN       (shard-apl) fdo#104164 +2
        Subgroup plane-panning-bottom-right-suspend-pipe-b-planes:
                pass       -> WARN       (shard-hsw) fdo#103540
Test drv_suspend:
        Subgroup debugfs-reader:
                pass       -> WARN       (shard-apl)
        Subgroup sysfs-reader:
                pass       -> WARN       (shard-apl)
        Subgroup forcewake:
                pass       -> WARN       (shard-apl)
        Subgroup fence-restore-tiled2untiled:
                pass       -> WARN       (shard-apl)
        Subgroup fence-restore-untiled:
                skip       -> PASS       (shard-snb)
                pass       -> WARN       (shard-apl)
Test kms_busy:
        Subgroup extended-pageflip-hang-newfb-render-c:
                pass       -> WARN       (shard-apl)
        Subgroup extended-modeset-hang-newfb-render-a:
                pass       -> WARN       (shard-apl)
Test kms_flip:
        Subgroup plain-flip-ts-check:
                pass       -> FAIL       (shard-hsw) fdo#100368 +1
        Subgroup 2x-nonexisting-fb:
                pass       -> WARN       (shard-hsw)
        Subgroup basic-flip-vs-wf_vblank:
                fail       -> PASS       (shard-hsw) fdo#103928
        Subgroup nonexisting-fb:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl)
        Subgroup nonexisting-fb-interruptible:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl)
        Subgroup bo-too-big:
                pass       -> WARN       (shard-apl)
        Subgroup 2x-nonexisting-fb-interruptible:
                pass       -> WARN       (shard-hsw)
Test kms_cursor_legacy:
        Subgroup pipe-a-torture-move:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl)
        Subgroup all-pipes-torture-move:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-apl)
        Subgroup pipe-c-torture-bo:
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl)
        Subgroup all-pipes-torture-bo:
                pass       -> WARN       (shard-snb)
        Subgroup pipe-c-torture-move:
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl)
        Subgroup pipe-a-torture-bo:
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl)
        Subgroup pipe-b-torture-move:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-apl)
        Subgroup pipe-b-torture-bo:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-apl)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                pass       -> WARN       (shard-apl) fdo#103375 +10
Test gem_exec_schedule:
        Subgroup preempt-hang-vebox:
                pass       -> WARN       (shard-apl)
        Subgroup reorder-wide-vebox:
                pass       -> WARN       (shard-apl)
Test gem_workarounds:
        Subgroup suspend-resume-fd:
                pass       -> WARN       (shard-apl)
Test prime_vgem:
        Subgroup sync-bsd:
                pass       -> WARN       (shard-apl)
Test perf_pmu:
        Subgroup cpu-hotplug:
                incomplete -> PASS       (shard-apl)
Test pm_rpm:
        Subgroup system-suspend-modeset:
                pass       -> WARN       (shard-apl)
Test prime_mmap_coherency:
        Subgroup ioctl-errors:
                pass       -> WARN       (shard-apl)
Test perf:
        Subgroup oa-exponents:
                incomplete -> PASS       (shard-apl) fdo#102254
Test kms_cursor_crc:
        Subgroup cursor-64x64-suspend:
                pass       -> WARN       (shard-apl)
Test gem_tiled_blits:
        Subgroup normal:
                pass       -> SKIP       (shard-apl)
Test kms_frontbuffer_tracking:
        Subgroup fbc-suspend:
                pass       -> WARN       (shard-apl) fdo#101623
Test drv_selftest:
        Subgroup mock_fence:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl)
        Subgroup mock_vma:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-apl)
        Subgroup live_sanitycheck:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl)
        Subgroup live_uncore:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl)
        Subgroup live_requests:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl)
        Subgroup live_objects:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl)
        Subgroup live_dmabuf:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl)
        Subgroup live_coherency:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl)
        Subgroup live_gtt:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl) fdo#103927 +2
        Subgroup live_evict:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl)
        Subgroup live_hugepages:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-hsw)
        Subgroup live_contexts:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl)
        Subgroup live_hangcheck:
                pass       -> WARN       (shard-snb) fdo#103880
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl)
        Subgroup live_guc:
                pass       -> WARN       (shard-snb)
                pass       -> WARN       (shard-hsw)
                pass       -> WARN       (shard-apl)
Test kms_rotation_crc:
        Subgroup sprite-rotation-180:
                fail       -> PASS       (shard-snb) fdo#103925
Test drv_module_reload:
        Subgroup basic-reload-inject:
                pass       -> WARN       (shard-hsw)
        Subgroup basic-no-display:
                pass       -> WARN       (shard-hsw)
Test kms_vblank:
        Subgroup pipe-a-ts-continuation-dpms-suspend:
                pass       -> WARN       (shard-apl)
        Subgroup pipe-a-ts-continuation-suspend:
                pass       -> WARN       (shard-apl)
        Subgroup pipe-c-ts-continuation-dpms-suspend:
                pass       -> WARN       (shard-apl)
        Subgroup pipe-b-query-forked:
                pass       -> WARN       (shard-apl)
        Subgroup pipe-a-wait-busy:
                pass       -> WARN       (shard-apl)
        Subgroup pipe-b-ts-continuation-dpms-suspend:
                pass       -> WARN       (shard-apl)
        Subgroup pipe-b-ts-continuation-suspend:
                pass       -> WARN       (shard-apl)
Test gem_mmap_gtt:
        Subgroup forked-big-copy:
                pass       -> WARN       (shard-apl)
        Subgroup basic-small-bo-tiledx:
                pass       -> WARN       (shard-apl)
Test gem_set_tiling_vs_blt:
        Subgroup untiled-to-tiled:
                pass       -> WARN       (shard-apl)
Test kms_setmode:
        Subgroup basic:
                pass       -> FAIL       (shard-hsw) fdo#99912
Test gem_fence_thrash:
        Subgroup bo-write-verify-threaded-none:
                pass       -> WARN       (shard-apl)
Test gem_sync:
        Subgroup basic-all:
                pass       -> WARN       (shard-apl)
Test kms_sysfs_edid_timing:
                pass       -> WARN       (shard-apl) fdo#100047
Test sw_sync:
        Subgroup sync_busy_fork_unixsocket:
                pass       -> FAIL       (shard-snb)
                pass       -> FAIL       (shard-hsw)
                pass       -> FAIL       (shard-apl)
Test gem_exec_fence:
        Subgroup basic-busy-default:
                pass       -> WARN       (shard-apl)
Test gem_exec_gttfill:
        Subgroup basic:
                pass       -> WARN       (shard-apl)
Test kms_fbcon_fbt:
        Subgroup fbc-suspend:
                pass       -> WARN       (shard-apl)
Test kms_plane_multiple:
        Subgroup atomic-pipe-a-tiling-none:
                pass       -> WARN       (shard-apl)

fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#104164 https://bugs.freedesktop.org/show_bug.cgi?id=104164
fdo#103540 https://bugs.freedesktop.org/show_bug.cgi?id=103540
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#103880 https://bugs.freedesktop.org/show_bug.cgi?id=103880
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047

shard-apl        total:3465 pass:1739 dwarn:1   dfail:0   fail:13  skip:1631 time:12229s
shard-hsw        total:3465 pass:1741 dwarn:1   dfail:0   fail:4   skip:1693 time:11824s
shard-snb        total:3465 pass:1335 dwarn:1   dfail:0   fail:3   skip:2104 time:6746s
Blacklisted hosts:
shard-kbl        total:3465 pass:1898 dwarn:1   dfail:0   fail:15  skip:1489 time:9665s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_977/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [igt-dev] [RFC PATCH i-g-t 6/6] lib/core: Use whitelist with kmsg filter
  2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t 6/6] lib/core: Use whitelist with kmsg filter Petri Latvala
  2018-02-21 15:32   ` Chris Wilson
@ 2018-02-26 15:45   ` Chris Wilson
  2018-03-01 11:15   ` [igt-dev] [PATCH i-g-t v3 1/1] " Petri Latvala
  2 siblings, 0 replies; 16+ messages in thread
From: Chris Wilson @ 2018-02-26 15:45 UTC (permalink / raw)
  To: Petri Latvala, igt-dev

Quoting Petri Latvala (2018-02-21 15:19:35)
> dmesg messages of level >=warn don't result in an IGT_LOG_WARN if they
> match a whitelist regexp now.
> 
> The whitelist is not configureable without rebuilding, and it's not
> even possible to use a different whitelist for different drivers;
> launching the kmsg monitor happens way before opening the driver (if
> any).
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> ---
>  lib/igt_core.c | 21 ++++++++++++++++++++-
>  1 file changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 5c93432d..d4495c3f 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -55,6 +55,7 @@
>  #include <limits.h>
>  #include <locale.h>
>  #include <uwildmat/uwildmat.h>
> +#include <regex.h>
>  #ifdef HAVE_GLIB
>  #include <glib.h>
>  #endif
> @@ -581,6 +582,16 @@ static void oom_adjust_for_doom(void)
>  
>  }
>  
> +const char IGT_DMESG_WHITELIST[] =
> +       "IRQ [0-9]+: no longer affine to CPU[0-9]+"
> +       "|IRQ fixup: irq [0-9]+ move in progress, old vector [0-9]+"
> +       "|Setting dangerous option [a-z_]+ - tainting kernel"
> +       "|Suspending console\\(s\\) \\(use no_console_suspend to debug\\)"
> +       "|cache: parent cpu[0-9]+ should not be sleeping"
> +       "|hpet[0-9]+: lost [0-9]+ rtc interrupts"
> +       "|usb usb[0-9]+: root hub lost power or was reset"
> +       ;

Can we load this from a suppressions.txt? That will make it easier to
maintain. One line per suppression, with the "|" implied? Or just load
the entire regexp and compile it exactly as written by the user. Ok,
that makes it more powerful and useful.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [igt-dev] [PATCH i-g-t v3 1/1] lib/core: Use whitelist with kmsg filter
  2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t 6/6] lib/core: Use whitelist with kmsg filter Petri Latvala
  2018-02-21 15:32   ` Chris Wilson
  2018-02-26 15:45   ` Chris Wilson
@ 2018-03-01 11:15   ` Petri Latvala
  2018-03-01 11:31     ` Chris Wilson
  2018-03-06 14:54     ` Daniel Vetter
  2 siblings, 2 replies; 16+ messages in thread
From: Petri Latvala @ 2018-03-01 11:15 UTC (permalink / raw)
  To: igt-dev

dmesg messages of level >=warn don't result in an IGT_LOG_WARN if they
match a whitelist regexp now.

The whitelist is not configureable without rebuilding, and it's not
even possible to use a different whitelist for different drivers;
launching the kmsg monitor happens way before opening the driver (if
any).

v2: Use static and a less yelling variable name for the whitelist,
    compare to REG_NOMATCH directly, construct the regexp in a nicer
    looking way (Chris). Be more verbose when monitoring stops.
v3: More patterns, document them.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 lib/igt_core.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 46 insertions(+), 2 deletions(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 0b3bf49e..6bcf004a 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -55,6 +55,7 @@
 #include <limits.h>
 #include <locale.h>
 #include <uwildmat/uwildmat.h>
+#include <regex.h>
 #ifdef HAVE_GLIB
 #include <glib.h>
 #endif
@@ -572,6 +573,37 @@ static void oom_adjust_for_doom(void)
 
 }
 
+/*
+ * This regexp controls the kmsg monitor handling. All kernel log
+ * records that have log level of warning or higher get inserted into
+ * IGT log buffer with an IGT_LOG_WARN unless they match this
+ * regexp. Otherwise they get inserted at IGT_LOG_DEBUG.
+ */
+
+#define _ "|"
+static const char igt_dmesg_whitelist[] =
+	"ACPI: button: The lid device is not compliant to SW_LID" _
+	"ACPI: .*: Unable to dock!" _
+	"IRQ [0-9]+: no longer affine to CPU[0-9]+" _
+	"IRQ fixup: irq [0-9]+ move in progress, old vector [0-9]+" _
+	/* i915 tests set module options, expected message */
+	"Setting dangerous option [a-z_]+ - tainting kernel" _
+	/* Raw printk() call, uses default log level (warn) */
+	"Suspending console\\(s\\) \\(use no_console_suspend to debug\\)" _
+	"atkbd serio[0-9]+: Failed to (deactivate|enable) keyboard on isa[0-9]+/serio[0-9]+" _
+	"cache: parent cpu[0-9]+ should not be sleeping" _
+	"hpet[0-9]+: lost [0-9]+ rtc interrupts" _
+	/* i915 selftests terminate normally with ENODEV from the
+	 * module load after the testing finishes, which produces this
+	 * message.
+	 */
+	"i915: probe of [0-9:.]+ failed with error -25" _
+	/* swiotbl warns even when asked not to */
+	"mock: DMA: Out of SW-IOMMU space for [0-9]+ bytes" _
+	"usb usb[0-9]+: root hub lost power or was reset"
+	;
+#undef _
+
 static void *kmsg_capture(void *arg)
 {
 	/*
@@ -584,6 +616,13 @@ static void *kmsg_capture(void *arg)
 	char *line = NULL;
 	size_t line_len = 0;
 	ssize_t read;
+	regex_t re;
+
+	if (regcomp(&re, igt_dmesg_whitelist, REG_EXTENDED | REG_NOSUB) != 0) {
+		igt_warn("Cannot compile dmesg whitelist regexp\n");
+		fclose(kmsg_file);
+		return NULL;
+	}
 
 	while ((read = getline(&line, &line_len, kmsg_file))) {
 		int s;
@@ -604,7 +643,8 @@ static void *kmsg_capture(void *arg)
 			   &seq, &ts_usec, &continuation);
 
 		if (s == 4) {
-			if ((flags & 0x7) <= 4)
+			if ((flags & 0x7) <= 4 &&
+			    regexec(&re, line, (size_t)0, NULL, 0) == REG_NOMATCH)
 				level = IGT_LOG_WARN;
 			else
 				level = IGT_LOG_DEBUG;
@@ -629,7 +669,11 @@ static void *kmsg_capture(void *arg)
 		}
 	}
 
-	igt_warn("ran out of dmesg, this shouldn't happen\n");
+	igt_warn("Ran out of dmesg, this shouldn't happen. Reason: ");
+	if (errno)
+		igt_warn("%s\n", strerror(errno));
+	else
+		igt_warn("EOF\n");
 
 	free(line);
 	fclose(kmsg_file);
-- 
2.14.1

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

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3 1/1] lib/core: Use whitelist with kmsg filter
  2018-03-01 11:15   ` [igt-dev] [PATCH i-g-t v3 1/1] " Petri Latvala
@ 2018-03-01 11:31     ` Chris Wilson
  2018-03-01 11:42       ` Petri Latvala
  2018-03-06 14:54     ` Daniel Vetter
  1 sibling, 1 reply; 16+ messages in thread
From: Chris Wilson @ 2018-03-01 11:31 UTC (permalink / raw)
  To: Petri Latvala, igt-dev

Quoting Petri Latvala (2018-03-01 11:15:21)
> dmesg messages of level >=warn don't result in an IGT_LOG_WARN if they
> match a whitelist regexp now.
> 
> The whitelist is not configureable without rebuilding, and it's not
> even possible to use a different whitelist for different drivers;
> launching the kmsg monitor happens way before opening the driver (if
> any).
> 
> v2: Use static and a less yelling variable name for the whitelist,
>     compare to REG_NOMATCH directly, construct the regexp in a nicer
>     looking way (Chris). Be more verbose when monitoring stops.
> v3: More patterns, document them.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> ---
>  lib/igt_core.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 46 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 0b3bf49e..6bcf004a 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -55,6 +55,7 @@
>  #include <limits.h>
>  #include <locale.h>
>  #include <uwildmat/uwildmat.h>
> +#include <regex.h>
>  #ifdef HAVE_GLIB
>  #include <glib.h>
>  #endif
> @@ -572,6 +573,37 @@ static void oom_adjust_for_doom(void)
>  
>  }
>  
> +/*
> + * This regexp controls the kmsg monitor handling. All kernel log
> + * records that have log level of warning or higher get inserted into
> + * IGT log buffer with an IGT_LOG_WARN unless they match this
> + * regexp. Otherwise they get inserted at IGT_LOG_DEBUG.
> + */
> +
> +#define _ "|"
> +static const char igt_dmesg_whitelist[] =
> +       "ACPI: button: The lid device is not compliant to SW_LID" _
> +       "ACPI: .*: Unable to dock!" _
> +       "IRQ [0-9]+: no longer affine to CPU[0-9]+" _
> +       "IRQ fixup: irq [0-9]+ move in progress, old vector [0-9]+" _

And throw in newlines to visually break up the comment groups.

> +       /* i915 tests set module options, expected message */
> +       "Setting dangerous option [a-z_]+ - tainting kernel" _

> +       /* Raw printk() call, uses default log level (warn) */
> +       "Suspending console\\(s\\) \\(use no_console_suspend to debug\\)" _
> +       "atkbd serio[0-9]+: Failed to (deactivate|enable) keyboard on isa[0-9]+/serio[0-9]+" _
> +       "cache: parent cpu[0-9]+ should not be sleeping" _
> +       "hpet[0-9]+: lost [0-9]+ rtc interrupts" _

> +       /* i915 selftests terminate normally with ENODEV from the
> +        * module load after the testing finishes, which produces this
> +        * message.
> +        */
> +       "i915: probe of [0-9:.]+ failed with error -25" _

> +       /* swiotbl warns even when asked not to */
> +       "mock: DMA: Out of SW-IOMMU space for [0-9]+ bytes" _

> +       "usb usb[0-9]+: root hub lost power or was reset"
> +       ;
> +#undef _
> +
>  static void *kmsg_capture(void *arg)
>  {
>         /*
> @@ -584,6 +616,13 @@ static void *kmsg_capture(void *arg)
>         char *line = NULL;
>         size_t line_len = 0;
>         ssize_t read;
> +       regex_t re;
> +
> +       if (regcomp(&re, igt_dmesg_whitelist, REG_EXTENDED | REG_NOSUB) != 0) {
> +               igt_warn("Cannot compile dmesg whitelist regexp\n");
> +               fclose(kmsg_file);
> +               return NULL;
> +       }
>  
>         while ((read = getline(&line, &line_len, kmsg_file))) {
>                 int s;
> @@ -604,7 +643,8 @@ static void *kmsg_capture(void *arg)
>                            &seq, &ts_usec, &continuation);
>  
>                 if (s == 4) {
> -                       if ((flags & 0x7) <= 4)
> +                       if ((flags & 0x7) <= 4 &&
> +                           regexec(&re, line, (size_t)0, NULL, 0) == REG_NOMATCH)
>                                 level = IGT_LOG_WARN;
>                         else
>                                 level = IGT_LOG_DEBUG;
> @@ -629,7 +669,11 @@ static void *kmsg_capture(void *arg)
>                 }
>         }
>  
> -       igt_warn("ran out of dmesg, this shouldn't happen\n");
> +       igt_warn("Ran out of dmesg, this shouldn't happen. Reason: ");
> +       if (errno)

errno is only valid immediately after an error (after a success, the
value is undefined, often garbage). You just called a few library
functions and overwrote errno.

igt_warn("...Reason: %s\n", errno ? strerror(errno) : "EOF");

(Although I didn't double check nothing untoward happened to upset errno
before hand, but it looks like we should only get here after getline()
fails.)
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3 1/1] lib/core: Use whitelist with kmsg filter
  2018-03-01 11:31     ` Chris Wilson
@ 2018-03-01 11:42       ` Petri Latvala
  0 siblings, 0 replies; 16+ messages in thread
From: Petri Latvala @ 2018-03-01 11:42 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

On Thu, Mar 01, 2018 at 11:31:49AM +0000, Chris Wilson wrote:
> Quoting Petri Latvala (2018-03-01 11:15:21)
> > dmesg messages of level >=warn don't result in an IGT_LOG_WARN if they
> > match a whitelist regexp now.
> > 
> > The whitelist is not configureable without rebuilding, and it's not
> > even possible to use a different whitelist for different drivers;
> > launching the kmsg monitor happens way before opening the driver (if
> > any).
> > 
> > v2: Use static and a less yelling variable name for the whitelist,
> >     compare to REG_NOMATCH directly, construct the regexp in a nicer
> >     looking way (Chris). Be more verbose when monitoring stops.
> > v3: More patterns, document them.
> > 
> > Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> > ---
> >  lib/igt_core.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++--
> >  1 file changed, 46 insertions(+), 2 deletions(-)
> > 
> > diff --git a/lib/igt_core.c b/lib/igt_core.c
> > index 0b3bf49e..6bcf004a 100644
> > --- a/lib/igt_core.c
> > +++ b/lib/igt_core.c
> > @@ -55,6 +55,7 @@
> >  #include <limits.h>
> >  #include <locale.h>
> >  #include <uwildmat/uwildmat.h>
> > +#include <regex.h>
> >  #ifdef HAVE_GLIB
> >  #include <glib.h>
> >  #endif
> > @@ -572,6 +573,37 @@ static void oom_adjust_for_doom(void)
> >  
> >  }
> >  
> > +/*
> > + * This regexp controls the kmsg monitor handling. All kernel log
> > + * records that have log level of warning or higher get inserted into
> > + * IGT log buffer with an IGT_LOG_WARN unless they match this
> > + * regexp. Otherwise they get inserted at IGT_LOG_DEBUG.
> > + */
> > +
> > +#define _ "|"
> > +static const char igt_dmesg_whitelist[] =
> > +       "ACPI: button: The lid device is not compliant to SW_LID" _
> > +       "ACPI: .*: Unable to dock!" _
> > +       "IRQ [0-9]+: no longer affine to CPU[0-9]+" _
> > +       "IRQ fixup: irq [0-9]+ move in progress, old vector [0-9]+" _
> 
> And throw in newlines to visually break up the comment groups.


Yeah. Also, TODO: Comment all lines.



> > +       /* i915 tests set module options, expected message */
> > +       "Setting dangerous option [a-z_]+ - tainting kernel" _
> 
> > +       /* Raw printk() call, uses default log level (warn) */
> > +       "Suspending console\\(s\\) \\(use no_console_suspend to debug\\)" _
> > +       "atkbd serio[0-9]+: Failed to (deactivate|enable) keyboard on isa[0-9]+/serio[0-9]+" _
> > +       "cache: parent cpu[0-9]+ should not be sleeping" _
> > +       "hpet[0-9]+: lost [0-9]+ rtc interrupts" _
> 
> > +       /* i915 selftests terminate normally with ENODEV from the
> > +        * module load after the testing finishes, which produces this
> > +        * message.
> > +        */
> > +       "i915: probe of [0-9:.]+ failed with error -25" _
> 
> > +       /* swiotbl warns even when asked not to */
> > +       "mock: DMA: Out of SW-IOMMU space for [0-9]+ bytes" _
> 
> > +       "usb usb[0-9]+: root hub lost power or was reset"
> > +       ;
> > +#undef _
> > +
> >  static void *kmsg_capture(void *arg)
> >  {
> >         /*
> > @@ -584,6 +616,13 @@ static void *kmsg_capture(void *arg)
> >         char *line = NULL;
> >         size_t line_len = 0;
> >         ssize_t read;
> > +       regex_t re;
> > +
> > +       if (regcomp(&re, igt_dmesg_whitelist, REG_EXTENDED | REG_NOSUB) != 0) {
> > +               igt_warn("Cannot compile dmesg whitelist regexp\n");
> > +               fclose(kmsg_file);
> > +               return NULL;
> > +       }
> >  
> >         while ((read = getline(&line, &line_len, kmsg_file))) {
> >                 int s;
> > @@ -604,7 +643,8 @@ static void *kmsg_capture(void *arg)
> >                            &seq, &ts_usec, &continuation);
> >  
> >                 if (s == 4) {
> > -                       if ((flags & 0x7) <= 4)
> > +                       if ((flags & 0x7) <= 4 &&
> > +                           regexec(&re, line, (size_t)0, NULL, 0) == REG_NOMATCH)
> >                                 level = IGT_LOG_WARN;
> >                         else
> >                                 level = IGT_LOG_DEBUG;
> > @@ -629,7 +669,11 @@ static void *kmsg_capture(void *arg)
> >                 }
> >         }
> >  
> > -       igt_warn("ran out of dmesg, this shouldn't happen\n");
> > +       igt_warn("Ran out of dmesg, this shouldn't happen. Reason: ");
> > +       if (errno)
> 
> errno is only valid immediately after an error (after a success, the
> value is undefined, often garbage). You just called a few library
> functions and overwrote errno.
> 
> igt_warn("...Reason: %s\n", errno ? strerror(errno) : "EOF");
> 
> (Although I didn't double check nothing untoward happened to upset errno
> before hand, but it looks like we should only get here after getline()
> fails.)

Yeah this part still needs some cleanup. I just wanted some data for
now to see why we ran out of dmesg. "this shouldn't happen" happens
way too often when you test...

I also did notice your suggestion for suppressions.txt and agree with
it. This series needs some serious polishing first, so I'll make that
happen later when everything else works.



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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [igt-dev] ✗ Fi.CI.BAT: warning for series starting with [RFC,i-g-t,1/6] tests/sw_sync: use igt_fork_helper
  2018-02-21 15:19 [igt-dev] [RFC PATCH i-g-t 1/6] tests/sw_sync: use igt_fork_helper Petri Latvala
                   ` (7 preceding siblings ...)
  2018-02-23 11:36 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
@ 2018-03-01 23:10 ` Patchwork
  8 siblings, 0 replies; 16+ messages in thread
From: Patchwork @ 2018-03-01 23:10 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

== Series Details ==

Series: series starting with [RFC,i-g-t,1/6] tests/sw_sync: use igt_fork_helper
URL   : https://patchwork.freedesktop.org/series/38708/
State : warning

== Summary ==

IGT patchset tested on top of latest successful build
a5d7e165fe5558487799ad75b9627f49947337af tools/intel_dp_compliance: Add missing GLIB_CFLAGS

with latest DRM-Tip kernel build CI_DRM_3860
7fe823aaeff7 drm-tip: 2018y-03m-01d-15h-58m-23s UTC integration manifest

No testlist changes.

---- Possible new issues:

Test debugfs_test:
        Subgroup read_all_entries:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
Test drv_module_reload:
        Subgroup basic-no-display:
                pass       -> WARN       (fi-bdw-5557u)
                pass       -> WARN       (fi-glk-1)
                pass       -> WARN       (fi-hsw-4770)
                pass       -> WARN       (fi-ilk-650)
                pass       -> WARN       (fi-skl-6700hq)
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-reload:
                pass       -> WARN       (fi-glk-1)
                pass       -> WARN       (fi-ilk-650)
                pass       -> WARN       (fi-skl-6700hq)
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-reload-inject:
                pass       -> WARN       (fi-bdw-5557u)
                pass       -> WARN       (fi-glk-1)
                pass       -> WARN       (fi-hsw-4770)
                pass       -> WARN       (fi-ilk-650)
                pass       -> WARN       (fi-skl-6700hq)
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
Test gem_exec_fence:
        Subgroup await-hang-default:
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-pnv-d510)
        Subgroup basic-await-default:
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-bxt-dsi)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-pnv-d510)
                pass       -> WARN       (fi-skl-gvtdvm)
        Subgroup basic-busy-default:
                pass       -> WARN       (fi-blb-e6850)
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-bxt-dsi)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-ilk-650)
                pass       -> WARN       (fi-pnv-d510)
                pass       -> WARN       (fi-snb-2520m)
        Subgroup basic-wait-default:
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-bxt-dsi)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-pnv-d510)
                pass       -> WARN       (fi-skl-gvtdvm)
        Subgroup nb-await-default:
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-bxt-dsi)
                pass       -> WARN       (fi-bxt-j4205)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-pnv-d510)
Test gem_exec_suspend:
        Subgroup basic-s3:
                pass       -> WARN       (fi-bdw-gvtdvm)
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-bxt-dsi)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-cfl-s2)
                pass       -> WARN       (fi-glk-1)
                pass       -> WARN       (fi-ivb-3520m)
                pass       -> WARN       (fi-kbl-7560u)
                pass       -> WARN       (fi-kbl-r)
                pass       -> WARN       (fi-skl-6700hq)
                pass       -> WARN       (fi-skl-guc)
                pass       -> WARN       (fi-snb-2520m)
        Subgroup basic-s4-devices:
                pass       -> WARN       (fi-bxt-dsi)
                pass       -> WARN       (fi-glk-1)
                pass       -> WARN       (fi-kbl-r)
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-6770hq)
                pass       -> WARN       (fi-skl-guc)
                pass       -> WARN       (fi-snb-2600)
Test gem_ringfill:
        Subgroup basic-default:
                pass       -> WARN       (fi-bdw-gvtdvm)
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-bxt-j4205)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-pnv-d510)
                pass       -> WARN       (fi-skl-gvtdvm)
        Subgroup basic-default-fd:
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-bxt-j4205)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-pnv-d510)
                pass       -> WARN       (fi-snb-2520m)
        Subgroup basic-default-forked:
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-cfl-8700k)
                pass       -> WARN       (fi-elk-e7500)
                pass       -> WARN       (fi-ilk-650)
                pass       -> WARN       (fi-ivb-3520m)
                pass       -> WARN       (fi-pnv-d510)
                pass       -> WARN       (fi-skl-6700k2)
        Subgroup basic-default-hang:
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
        Subgroup basic-default-interruptible:
                pass       -> WARN       (fi-bsw-n3050)
                pass       -> WARN       (fi-bxt-j4205)
                pass       -> WARN       (fi-byt-j1900)
                pass       -> WARN       (fi-byt-n2820)
                pass       -> WARN       (fi-ilk-650)
                pass       -> WARN       (fi-pnv-d510)
                pass       -> WARN       (fi-snb-2520m)
Test kms_busy:
        Subgroup basic-flip-a:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-b:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-c:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
Test kms_chamelium:
        Subgroup common-hpd-after-suspend:
                pass       -> WARN       (fi-skl-6700k2)
        Subgroup hdmi-crc-fast:
                pass       -> WARN       (fi-skl-6700k2)
        Subgroup hdmi-edid-read:
                pass       -> WARN       (fi-skl-6700k2)
        Subgroup hdmi-hpd-fast:
                pass       -> WARN       (fi-skl-6700k2)
Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-atomic:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-busy-flip-before-cursor-legacy:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-after-cursor-atomic:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-after-cursor-legacy:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-after-cursor-varying-size:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-before-cursor-atomic:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-before-cursor-legacy:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-before-cursor-varying-size:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
Test kms_flip:
        Subgroup basic-flip-vs-dpms:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-vs-modeset:
                pass       -> WARN       (fi-kbl-7567u)
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-flip-vs-wf_vblank:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-plain-flip:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
Test kms_pipe_crc_basic:
        Subgroup bad-nb-words-1:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup bad-nb-words-3:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup bad-pipe:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup bad-source:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup hang-read-crc-pipe-a:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup nonblocking-crc-pipe-a:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup nonblocking-crc-pipe-a-frame-sequence:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup nonblocking-crc-pipe-b:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup nonblocking-crc-pipe-c-frame-sequence:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup read-crc-pipe-c-frame-sequence:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup suspend-read-crc-pipe-a:
                pass       -> WARN       (fi-bdw-gvtdvm)
                pass       -> WARN       (fi-bwr-2160)
                pass       -> WARN       (fi-bxt-dsi)
                pass       -> WARN       (fi-bxt-j4205)
                pass       -> WARN       (fi-cfl-s2)
                pass       -> WARN       (fi-glk-1)
                pass       -> WARN       (fi-kbl-7560u)
                pass       -> WARN       (fi-kbl-r)
                pass       -> WARN       (fi-skl-6260u)
                pass       -> WARN       (fi-skl-6600u)
                pass       -> WARN       (fi-skl-6770hq)
                pass       -> WARN       (fi-skl-gvtdvm)
        Subgroup suspend-read-crc-pipe-b:
                pass       -> WARN       (fi-bdw-gvtdvm)
                pass       -> WARN       (fi-bwr-2160)
                pass       -> WARN       (fi-bxt-dsi)
                pass       -> WARN       (fi-bxt-j4205)
                pass       -> WARN       (fi-cfl-s2)
                pass       -> WARN       (fi-glk-1)
                pass       -> WARN       (fi-kbl-7560u)
                pass       -> WARN       (fi-kbl-r)
        Subgroup suspend-read-crc-pipe-c:
                pass       -> WARN       (fi-bdw-gvtdvm)
                pass       -> WARN       (fi-bxt-j4205)
                pass       -> WARN       (fi-cfl-s2)
                pass       -> WARN       (fi-glk-1)
                pass       -> WARN       (fi-kbl-7560u)
                pass       -> WARN       (fi-kbl-r)
Test pm_rpm:
        Subgroup basic-pci-d3-state:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)
        Subgroup basic-rte:
                pass       -> WARN       (fi-skl-6700k2)
                pass       -> WARN       (fi-skl-guc)

---- Known issues:

Test gem_exec_suspend:
        Subgroup basic-s3:
                pass       -> WARN       (fi-bxt-j4205) fdo#105009
                pass       -> WARN       (fi-skl-6260u) fdo#104108 +14
                pass       -> WARN       (fi-snb-2600) fdo#103880
        Subgroup basic-s4-devices:
                pass       -> WARN       (fi-cfl-s2) fdo#105071
Test gem_mmap_gtt:
        Subgroup basic-small-bo-tiledx:
                pass       -> FAIL       (fi-gdg-551) fdo#102575
Test gem_ringfill:
        Subgroup basic-default-hang:
                dmesg-warn -> DMESG-FAIL (fi-blb-e6850) fdo#101600 +1
Test kms_chamelium:
        Subgroup common-hpd-after-suspend:
                dmesg-warn -> DMESG-FAIL (fi-kbl-7500u) fdo#105310
Test kms_flip:
        Subgroup basic-flip-vs-wf_vblank:
                pass       -> WARN       (fi-cfl-s2) fdo#100368
Test kms_pipe_crc_basic:
        Subgroup hang-read-crc-pipe-b:
                pass       -> WARN       (fi-skl-6700k2) fdo#103191 +21
        Subgroup suspend-read-crc-pipe-a:
                pass       -> WARN       (fi-ivb-3520m) k.org#198519 +2
                pass       -> WARN       (fi-skl-6700hq) fdo#101144
        Subgroup suspend-read-crc-pipe-b:
                pass       -> WARN       (fi-bdw-5557u) fdo#104162
        Subgroup suspend-read-crc-pipe-c:
                pass       -> WARN       (fi-bxt-dsi) fdo#103927
Test prime_vgem:
        Subgroup basic-fence-flip:
                pass       -> FAIL       (fi-ilk-650) fdo#104008 +1

fdo#105009 https://bugs.freedesktop.org/show_bug.cgi?id=105009
fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
fdo#103880 https://bugs.freedesktop.org/show_bug.cgi?id=103880
fdo#105071 https://bugs.freedesktop.org/show_bug.cgi?id=105071
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#101600 https://bugs.freedesktop.org/show_bug.cgi?id=101600
fdo#105310 https://bugs.freedesktop.org/show_bug.cgi?id=105310
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
k.org#198519 https://bugzilla.kernel.org/show_bug.cgi?id=198519
fdo#101144 https://bugs.freedesktop.org/show_bug.cgi?id=101144
fdo#104162 https://bugs.freedesktop.org/show_bug.cgi?id=104162
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008

fi-bdw-5557u     total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:21  time:416s
fi-bdw-gvtdvm    total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:24  time:424s
fi-blb-e6850     total:288  pass:222  dwarn:0   dfail:1   fail:0   skip:64  time:374s
fi-bsw-n3050     total:288  pass:231  dwarn:0   dfail:0   fail:0   skip:46  time:497s
fi-bwr-2160      total:288  pass:181  dwarn:0   dfail:0   fail:0   skip:105 time:283s
fi-bxt-dsi       total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:30  time:479s
fi-bxt-j4205     total:288  pass:251  dwarn:0   dfail:0   fail:0   skip:29  time:486s
fi-byt-j1900     total:288  pass:243  dwarn:0   dfail:0   fail:0   skip:35  time:471s
fi-byt-n2820     total:288  pass:238  dwarn:0   dfail:0   fail:0   skip:39  time:461s
fi-cfl-8700k     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:28  time:392s
fi-cfl-s2        total:288  pass:256  dwarn:0   dfail:0   fail:0   skip:26  time:564s
fi-elk-e7500     total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:59  time:415s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:292s
fi-glk-1         total:288  pass:252  dwarn:0   dfail:0   fail:0   skip:28  time:512s
fi-hsw-4770      total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:27  time:389s
fi-ilk-650       total:288  pass:221  dwarn:0   dfail:0   fail:1   skip:60  time:411s
fi-ivb-3520m     total:288  pass:254  dwarn:0   dfail:0   fail:0   skip:29  time:444s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:410s
fi-kbl-7500u     total:288  pass:263  dwarn:0   dfail:1   fail:0   skip:24  time:452s
fi-kbl-7560u     total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:19  time:494s
fi-kbl-7567u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:20  time:451s
fi-kbl-r         total:288  pass:256  dwarn:0   dfail:0   fail:0   skip:27  time:495s
fi-pnv-d510      total:288  pass:213  dwarn:0   dfail:1   fail:0   skip:65  time:586s
fi-skl-6260u     total:288  pass:263  dwarn:0   dfail:0   fail:1   skip:20  time:431s
fi-skl-6600u     total:288  pass:257  dwarn:0   dfail:0   fail:0   skip:27  time:498s
fi-skl-6700hq    total:288  pass:257  dwarn:0   dfail:0   fail:0   skip:26  time:521s
fi-skl-6700k2    total:288  pass:214  dwarn:0   dfail:0   fail:0   skip:24  time:488s
fi-skl-6770hq    total:288  pass:263  dwarn:0   dfail:0   fail:0   skip:20  time:474s
fi-skl-guc       total:288  pass:215  dwarn:0   dfail:0   fail:0   skip:28  time:409s
fi-skl-gvtdvm    total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:23  time:433s
fi-snb-2520m     total:288  pass:244  dwarn:0   dfail:0   fail:0   skip:40  time:526s
fi-snb-2600      total:288  pass:246  dwarn:0   dfail:0   fail:0   skip:40  time:402s
Blacklisted hosts:
fi-cfl-u         total:288  pass:257  dwarn:0   dfail:0   fail:0   skip:26  time:505s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1039/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3 1/1] lib/core: Use whitelist with kmsg filter
  2018-03-01 11:15   ` [igt-dev] [PATCH i-g-t v3 1/1] " Petri Latvala
  2018-03-01 11:31     ` Chris Wilson
@ 2018-03-06 14:54     ` Daniel Vetter
  1 sibling, 0 replies; 16+ messages in thread
From: Daniel Vetter @ 2018-03-06 14:54 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

On Thu, Mar 01, 2018 at 01:15:21PM +0200, Petri Latvala wrote:
> dmesg messages of level >=warn don't result in an IGT_LOG_WARN if they
> match a whitelist regexp now.
> 
> The whitelist is not configureable without rebuilding, and it's not
> even possible to use a different whitelist for different drivers;
> launching the kmsg monitor happens way before opening the driver (if
> any).
> 
> v2: Use static and a less yelling variable name for the whitelist,
>     compare to REG_NOMATCH directly, construct the regexp in a nicer
>     looking way (Chris). Be more verbose when monitoring stops.
> v3: More patterns, document them.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> ---
>  lib/igt_core.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 46 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 0b3bf49e..6bcf004a 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -55,6 +55,7 @@
>  #include <limits.h>
>  #include <locale.h>
>  #include <uwildmat/uwildmat.h>
> +#include <regex.h>
>  #ifdef HAVE_GLIB
>  #include <glib.h>
>  #endif
> @@ -572,6 +573,37 @@ static void oom_adjust_for_doom(void)
>  
>  }
>  
> +/*
> + * This regexp controls the kmsg monitor handling. All kernel log
> + * records that have log level of warning or higher get inserted into
> + * IGT log buffer with an IGT_LOG_WARN unless they match this
> + * regexp. Otherwise they get inserted at IGT_LOG_DEBUG.
> + */
> +
> +#define _ "|"
> +static const char igt_dmesg_whitelist[] =
> +	"ACPI: button: The lid device is not compliant to SW_LID" _
> +	"ACPI: .*: Unable to dock!" _
> +	"IRQ [0-9]+: no longer affine to CPU[0-9]+" _
> +	"IRQ fixup: irq [0-9]+ move in progress, old vector [0-9]+" _
> +	/* i915 tests set module options, expected message */
> +	"Setting dangerous option [a-z_]+ - tainting kernel" _
> +	/* Raw printk() call, uses default log level (warn) */
> +	"Suspending console\\(s\\) \\(use no_console_suspend to debug\\)" _
> +	"atkbd serio[0-9]+: Failed to (deactivate|enable) keyboard on isa[0-9]+/serio[0-9]+" _
> +	"cache: parent cpu[0-9]+ should not be sleeping" _
> +	"hpet[0-9]+: lost [0-9]+ rtc interrupts" _
> +	/* i915 selftests terminate normally with ENODEV from the
> +	 * module load after the testing finishes, which produces this
> +	 * message.
> +	 */
> +	"i915: probe of [0-9:.]+ failed with error -25" _
> +	/* swiotbl warns even when asked not to */
> +	"mock: DMA: Out of SW-IOMMU space for [0-9]+ bytes" _
> +	"usb usb[0-9]+: root hub lost power or was reset"
> +	;
> +#undef _

I wonder whether we should maintain this long-term in igt, or as fixup
patches in drm-intel/topic/core-for-CI (with the eventual goal to push
them out to maintainers, in the next century or so ...).

My initial dmesg filter hack in piglit was just that, a quick hack, and I
get the feeling it's starting to outlive it's usefulness.
-Daniel

> +
>  static void *kmsg_capture(void *arg)
>  {
>  	/*
> @@ -584,6 +616,13 @@ static void *kmsg_capture(void *arg)
>  	char *line = NULL;
>  	size_t line_len = 0;
>  	ssize_t read;
> +	regex_t re;
> +
> +	if (regcomp(&re, igt_dmesg_whitelist, REG_EXTENDED | REG_NOSUB) != 0) {
> +		igt_warn("Cannot compile dmesg whitelist regexp\n");
> +		fclose(kmsg_file);
> +		return NULL;
> +	}
>  
>  	while ((read = getline(&line, &line_len, kmsg_file))) {
>  		int s;
> @@ -604,7 +643,8 @@ static void *kmsg_capture(void *arg)
>  			   &seq, &ts_usec, &continuation);
>  
>  		if (s == 4) {
> -			if ((flags & 0x7) <= 4)
> +			if ((flags & 0x7) <= 4 &&
> +			    regexec(&re, line, (size_t)0, NULL, 0) == REG_NOMATCH)
>  				level = IGT_LOG_WARN;
>  			else
>  				level = IGT_LOG_DEBUG;
> @@ -629,7 +669,11 @@ static void *kmsg_capture(void *arg)
>  		}
>  	}
>  
> -	igt_warn("ran out of dmesg, this shouldn't happen\n");
> +	igt_warn("Ran out of dmesg, this shouldn't happen. Reason: ");
> +	if (errno)
> +		igt_warn("%s\n", strerror(errno));
> +	else
> +		igt_warn("EOF\n");
>  
>  	free(line);
>  	fclose(kmsg_file);
> -- 
> 2.14.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-03-06 14:55 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-21 15:19 [igt-dev] [RFC PATCH i-g-t 1/6] tests/sw_sync: use igt_fork_helper Petri Latvala
2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t 2/6] lib/core: make logging pthread vs. fork safe Petri Latvala
2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t 3/6] lib/core: Don't hide non-debug message when filtering for a debug log domain Petri Latvala
2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t v5 4/6] igt/core: Initial simple interleaved kmsg filtering Petri Latvala
2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t 5/6] lib/core: report subtests that hit an igt_warning as WARNING Petri Latvala
2018-02-21 15:19 ` [igt-dev] [RFC PATCH i-g-t 6/6] lib/core: Use whitelist with kmsg filter Petri Latvala
2018-02-21 15:32   ` Chris Wilson
2018-02-26 15:45   ` Chris Wilson
2018-03-01 11:15   ` [igt-dev] [PATCH i-g-t v3 1/1] " Petri Latvala
2018-03-01 11:31     ` Chris Wilson
2018-03-01 11:42       ` Petri Latvala
2018-03-06 14:54     ` Daniel Vetter
2018-02-21 15:22 ` [igt-dev] [RFC PATCH i-g-t 1/6] tests/sw_sync: use igt_fork_helper Chris Wilson
2018-02-21 20:48 ` [igt-dev] ✗ Fi.CI.BAT: warning for series starting with [RFC,i-g-t,1/6] " Patchwork
2018-02-23 11:36 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-03-01 23:10 ` [igt-dev] ✗ Fi.CI.BAT: warning " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.