diff mbox series

[v3,02/11] main: Use pdbg logging api in pdbg

Message ID 20180524055017.8801-3-amitay@ozlabs.org
State Accepted
Headers show
Series Some more cleanups | expand

Commit Message

Amitay Isaacs May 24, 2018, 5:50 a.m. UTC
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
---
 src/htm.c  | 3 +++
 src/main.c | 6 ++----
 src/mem.c  | 3 +++
 3 files changed, 8 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/src/htm.c b/src/htm.c
index 1e65a04..a1a88d1 100644
--- a/src/htm.c
+++ b/src/htm.c
@@ -41,6 +41,9 @@ 
 
 #define HTM_ENUM_TO_STRING(e) ((e == HTM_NEST) ? "nhtm" : "chtm")
 
+#define PR_ERROR(x, args...) \
+	pdbg_log(PDBG_ERROR, x, ##args)
+
 enum htm_type {
 	HTM_CORE,
 	HTM_NEST,
diff --git a/src/main.c b/src/main.c
index 20f5319..eb5d64d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -43,10 +43,8 @@ 
 #include "htm.h"
 #include "options.h"
 
-#undef PR_DEBUG
-#define PR_DEBUG(...)
-#define PR_ERROR(x, args...)					\
-	fprintf(stderr, "%s: " x, __FUNCTION__, ##args)
+#define PR_ERROR(x, args...) \
+	pdbg_log(PDBG_ERROR, x, ##args)
 
 #include "fake.dt.h"
 
diff --git a/src/mem.c b/src/mem.c
index ff22500..71e91d3 100644
--- a/src/mem.c
+++ b/src/mem.c
@@ -26,6 +26,9 @@ 
 #include "main.h"
 #include "progress.h"
 
+#define PR_ERROR(x, args...) \
+	pdbg_log(PDBG_ERROR, x, ##args)
+
 #define PUTMEM_BUF_SIZE 1024
 static int getmem(uint64_t addr, uint64_t size, int ci)
 {