[igt-dev] [PATCH i-g-t v2] HAX: add 'i915:' to dmesg patterns and disregard KERN_NOTICE
Arkadiusz Hiler
arkadiusz.hiler at intel.com
Fri Mar 8 11:48:19 UTC 2019
Stop-gap before dropping --piglit-style-dmesg completely.
This is just for testing, to asses the amount of work this will cause
for bug-reporting. When implemented properly it will end up as a
separate switch(es).
---
runner/resultgen.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/runner/resultgen.c b/runner/resultgen.c
index 32b59d59..308f6419 100644
--- a/runner/resultgen.c
+++ b/runner/resultgen.c
@@ -496,21 +496,23 @@ static const char igt_dmesg_whitelist[] =
;
#undef _
-static const char igt_piglit_style_dmesg_blacklist[] =
- "(\\[drm:|drm_|intel_|i915_)";
+static const char igt_piglit_style_dmesg_filter[] =
+ "(\\[drm:|drm_|intel_|i915_|i915:)";
-static regex_t re;
+static regex_t whitelist_re, piglit_filter_re;
static int init_regex_whitelist(struct settings *settings)
{
static int status = -1;
if (status == -1) {
- const char *regex = settings->piglit_style_dmesg ?
- igt_piglit_style_dmesg_blacklist :
- igt_dmesg_whitelist;
+ if (regcomp(&piglit_filter_re, igt_piglit_style_dmesg_filter, REG_EXTENDED | REG_NOSUB) != 0) {
+ fprintf(stderr, "Cannot compile dmesg regexp\n");
+ status = 1;
+ return false;
+ }
- if (regcomp(&re, regex, REG_EXTENDED | REG_NOSUB) != 0) {
+ if (regcomp(&whitelist_re, igt_dmesg_whitelist, REG_EXTENDED | REG_NOSUB) != 0) {
fprintf(stderr, "Cannot compile dmesg regexp\n");
status = 1;
return false;
@@ -678,13 +680,14 @@ static bool fill_from_dmesg(int fd,
}
if (settings->piglit_style_dmesg) {
- if ((flags & 0x07) <= 5 && continuation != 'c' &&
- regexec(&re, message, (size_t)0, NULL, 0) != REG_NOMATCH) {
+ if ((flags & 0x07) <= 4 && continuation != 'c' &&
+ regexec(&piglit_filter_re, message, (size_t)0, NULL, 0) != REG_NOMATCH &&
+ regexec(&whitelist_re, message, (size_t)0, NULL, 0) == REG_NOMATCH) {
append_line(&warnings, &warningslen, formatted);
}
} else {
if ((flags & 0x07) <= 4 && continuation != 'c' &&
- regexec(&re, message, (size_t)0, NULL, 0) == REG_NOMATCH) {
+ regexec(&whitelist_re, message, (size_t)0, NULL, 0) == REG_NOMATCH) {
append_line(&warnings, &warningslen, formatted);
}
}
--
2.20.1
More information about the igt-dev
mailing list