From c9b64079ec044b3004b9db71ebf9b263f7af3e97 Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Sat, 7 Feb 2009 12:55:46 -0500 Subject: [PATCH] ust: add usterr.h --- {libmarkers => share}/kernelcompat.h | 0 share/usterr.h | 8 ++++++++ 2 files changed, 8 insertions(+) rename {libmarkers => share}/kernelcompat.h (100%) create mode 100644 share/usterr.h diff --git a/libmarkers/kernelcompat.h b/share/kernelcompat.h similarity index 100% rename from libmarkers/kernelcompat.h rename to share/kernelcompat.h diff --git a/share/usterr.h b/share/usterr.h new file mode 100644 index 00000000..6b871ff5 --- /dev/null +++ b/share/usterr.h @@ -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) + -- 2.34.1