summaryrefslogtreecommitdiff
path: root/lib/igt_core.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-02-21 11:28:45 +0000
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2018-02-27 13:04:03 +0200
commitee7c191868a6a681665d62eca5fd180ed8a2896f (patch)
treec1d5de7d39615ca29c6367031a212adf3c0b9309 /lib/igt_core.c
parentc68b8ee935c75fa4c946f2d97f64ffe9decef010 (diff)
lib: Export kmsg()
Export the kmsg() function for use by tests to write into the kernel message log, useful for tests to inline their progress with kernel error messages. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'lib/igt_core.c')
-rw-r--r--lib/igt_core.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/lib/igt_core.c b/lib/igt_core.c
index 558a538d..c292343d 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -386,16 +386,7 @@ void igt_log_buffer_inspect(igt_buffer_log_handler_t check, void *data)
pthread_mutex_unlock(&log_buffer_mutex);
}
-__attribute__((format(printf, 1, 2)))
-static void kmsg(const char *format, ...)
-#define KERN_EMER "<0>"
-#define KERN_ALERT "<1>"
-#define KERN_CRIT "<2>"
-#define KERN_ERR "<3>"
-#define KERN_WARNING "<4>"
-#define KERN_NOTICE "<5>"
-#define KERN_INFO "<6>"
-#define KERN_DEBUG "<7>"
+void igt_kmsg(const char *format, ...)
{
va_list ap;
FILE *file;
@@ -811,7 +802,7 @@ out:
if (!list_subtests) {
kick_fbcon(false);
- kmsg(KERN_INFO "[IGT] %s: executing\n", command_str);
+ igt_kmsg(KMSG_INFO "%s: executing\n", command_str);
print_version();
sync();
@@ -938,7 +929,8 @@ bool __igt_run_subtest(const char *subtest_name)
return false;
}
- kmsg(KERN_INFO "[IGT] %s: starting subtest %s\n", command_str, subtest_name);
+ igt_kmsg(KMSG_INFO "%s: starting subtest %s\n",
+ command_str, subtest_name);
igt_debug("Starting subtest: %s\n", subtest_name);
_igt_log_buffer_reset();
@@ -1447,8 +1439,8 @@ void igt_exit(void)
}
if (command_str)
- kmsg(KERN_INFO "[IGT] %s: exiting, ret=%d\n",
- command_str, igt_exitcode);
+ igt_kmsg(KMSG_INFO "%s: exiting, ret=%d\n",
+ command_str, igt_exitcode);
igt_debug("Exiting with status code %d\n", igt_exitcode);
for (int c = 0; c < num_test_children; c++)