From: Brian Norris Date: Fri, 9 Mar 2012 23:31:45 +0000 (-0800) Subject: reformat DEBUG messages X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=fac3ff38c2f0a4eecbb7ec2ca86cdd0d30c0a1a0;p=c11tester.git reformat DEBUG messages --- diff --git a/libthreads.c b/libthreads.c index bd7f501d..959fb772 100644 --- a/libthreads.c +++ b/libthreads.c @@ -1,8 +1,6 @@ #include #include -//#define CONFIG_DEBUG - #include "libthreads.h" #define STACK_SIZE (1024 * 1024) diff --git a/libthreads.h b/libthreads.h index 3324fccf..a25b2779 100644 --- a/libthreads.h +++ b/libthreads.h @@ -4,12 +4,14 @@ #include #include +//#define CONFIG_DEBUG + #ifdef CONFIG_DEBUG -#define DBG() do { printf("Here: %s, L%d\n", __func__, __LINE__); } while (0) -#define DEBUG(fmt, ...) printf(fmt, ##__VA_ARGS__) +#define DEBUG(fmt, ...) do { printf("*** %25s(): line %-4d *** " fmt, __func__, __LINE__, ##__VA_ARGS__); } while (0) +#define DBG() DEBUG("\n"); #else -#define DBG() #define DEBUG(fmt, ...) +#define DBG() #endif struct thread { diff --git a/schedule.c b/schedule.c index e940f5aa..f5ce6448 100644 --- a/schedule.c +++ b/schedule.c @@ -1,5 +1,3 @@ -//#define CONFIG_DEBUG - #include "schedule.h" struct thread_list_node { @@ -46,7 +44,7 @@ static int dequeue_thread(struct thread **t) void schedule_add_thread(struct thread *t) { - DEBUG("%s: thread %d\n", __func__, t->index); + DEBUG("thread %d\n", t->index); enqueue_thread(t); }