[Pdbg] [PATCH v2 2/9] main: Use pdbg logging api in pdbg
Amitay Isaacs
amitay at ozlabs.org
Wed May 23 14:31:03 AEST 2018
Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
src/htm.c | 3 +++
src/main.c | 6 ++----
src/mem.c | 3 +++
3 files changed, 8 insertions(+), 4 deletions(-)
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)
{
--
2.17.0
More information about the Pdbg
mailing list