[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
petri.latvala at intel.com
Wed Feb 21 15:19:32 UTC 2018
From: Daniel Vetter <daniel.vetter at 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 at 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
More information about the igt-dev
mailing list