From 63fe14e5d4e408cff3d8746c5b0dc3eb08448d8e Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Mon, 15 Jun 2009 12:45:06 -0400 Subject: [PATCH] clean error msg functions --- libust/Makefile.am | 2 +- libust/tracectl.c | 12 ++++++------ share/usterr.c | 18 ------------------ share/usterr.h | 3 --- 4 files changed, 7 insertions(+), 28 deletions(-) delete mode 100644 share/usterr.c diff --git a/libust/Makefile.am b/libust/Makefile.am index 67810642..e3d45419 100644 --- a/libust/Makefile.am +++ b/libust/Makefile.am @@ -2,6 +2,6 @@ INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libustcomm \ $(KCOMPAT_CFLAGS) $(URCU_CFLAGS) lib_LTLIBRARIES = libust.la -libust_la_SOURCES = marker.c marker.h tracepoint.c tracepoint.h immediate.h channels.c channels.h marker-control.c marker-control.h relay.c relay.h tracer.c tracer.h tracercore.c tracercore.h serialize.c tracectl.c $(top_builddir)/libustcomm/ustcomm.c $(top_builddir)/share/usterr.c $(top_builddir)/share/usterr.h localerr.h +libust_la_SOURCES = marker.c marker.h tracepoint.c tracepoint.h immediate.h channels.c channels.h marker-control.c marker-control.h relay.c relay.h tracer.c tracer.h tracercore.c tracercore.h serialize.c tracectl.c $(top_builddir)/libustcomm/ustcomm.c $(top_builddir)/share/usterr.h localerr.h libust_la_LDFLAGS = -no-undefined -version-info 0:0:0 libust_la_LIBADD = $(URCU_LIBS) -lpthread diff --git a/libust/tracectl.c b/libust/tracectl.c index b32b501e..abd79620 100644 --- a/libust/tracectl.c +++ b/libust/tracectl.c @@ -347,7 +347,7 @@ void *listener_main(void *p) ltt_unlock_traces(); if(trace == NULL) { - CPRINTF("cannot find trace!"); + ERR("cannot find trace!"); return (void *)1; } @@ -395,7 +395,7 @@ void *listener_main(void *p) ltt_unlock_traces(); if(trace == NULL) { - CPRINTF("cannot find trace!"); + ERR("cannot find trace!"); return (void *)1; } @@ -439,7 +439,7 @@ void *listener_main(void *p) ltt_unlock_traces(); if(trace == NULL) { - CPRINTF("cannot find trace!"); + ERR("cannot find trace!"); return (void *)1; } @@ -490,7 +490,7 @@ void *listener_main(void *p) ltt_unlock_traces(); if(trace == NULL) { - CPRINTF("cannot find trace!"); + ERR("cannot find trace!"); return (void *)1; } @@ -556,7 +556,7 @@ void *listener_main(void *p) ltt_unlock_traces(); if(trace == NULL) { - CPRINTF("cannot find trace!"); + ERR("cannot find trace!"); return (void *)1; } @@ -649,7 +649,7 @@ void *listener_main(void *p) // ltt_unlock_traces(); // // if(trace == NULL) { -// CPRINTF("cannot find trace!"); +// ERR("cannot find trace!"); // return (void *)1; // } // diff --git a/share/usterr.c b/share/usterr.c deleted file mode 100644 index ee7aeb00..00000000 --- a/share/usterr.c +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include - -int safe_printf(const char *fmt, ...) -{ - static char buf[500]; - va_list ap; - int n; - - va_start(ap, fmt); - - n = vsnprintf(buf, sizeof(buf), fmt, ap); - - write(STDOUT_FILENO, buf, n); - - va_end(ap); -} - diff --git a/share/usterr.h b/share/usterr.h index f1eef743..a2d04313 100644 --- a/share/usterr.h +++ b/share/usterr.h @@ -10,7 +10,4 @@ #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 on line %s:%d", __FILE__, __LINE__); } while(0) -#define CPRINTF(fmt, args...) safe_printf(fmt "\n", ## args) - - #endif /* USTERR_H */ -- 2.34.1