summaryrefslogtreecommitdiff
path: root/lib/igt_core.h
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.h
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.h')
-rw-r--r--lib/igt_core.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/igt_core.h b/lib/igt_core.h
index f8543d65..7af2b4c1 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -932,4 +932,21 @@ int igt_system_quiet(const char *command);
free(buf); \
} while (0)
+/**
+ * igt_kmsg:
+ * @format: printf-style format string with optional args
+ *
+ * Writes a message into the kernel log file (/dev/kmsg).
+ */
+__attribute__((format(printf, 1, 2)))
+void igt_kmsg(const char *format, ...);
+#define KMSG_EMER "<0>[IGT] "
+#define KMSG_ALERT "<1>[IGT] "
+#define KMSG_CRIT "<2>[IGT] "
+#define KMSG_ERR "<3>[IGT] "
+#define KMSG_WARNING "<4>[IGT] "
+#define KMSG_NOTICE "<5>[IGT] "
+#define KMSG_INFO "<6>[IGT] "
+#define KMSG_DEBUG "<7>[IGT] "
+
#endif /* IGT_CORE_H */