ust: add usterr.h
[lttng-ust.git] / share / usterr.h
diff --git a/share/usterr.h b/share/usterr.h
new file mode 100644 (file)
index 0000000..6b871ff
--- /dev/null
@@ -0,0 +1,8 @@
+#define DBG(fmt, args...) fprintf(stderr, fmt "\n", ## args)
+#define WARN(fmt, args...) fprintf(stderr, "usertrace: WARNING: " fmt "\n", ## args)
+#define ERR(fmt, args...) fprintf(stderr, "usertrace: ERROR: " fmt "\n", ## args)
+#define PERROR(call) perror("usertrace: ERROR: " call)
+
+#define BUG_ON(condition) do { if (unlikely(condition)) ERR("condition not respected (BUG)"); } while(0)
+#define WARN_ON(condition) do { if (unlikely(condition)) WARN("condition not respected"); } while(0)
+
This page took 0.023933 seconds and 4 git commands to generate.