reformat DEBUG messages
authorBrian Norris <banorris@uci.edu>
Fri, 9 Mar 2012 23:31:45 +0000 (15:31 -0800)
committerBrian Norris <banorris@uci.edu>
Fri, 9 Mar 2012 23:32:10 +0000 (15:32 -0800)
libthreads.c
libthreads.h
schedule.c

index bd7f501df3cc4c76a1d7bb30c982f66df802cc1e..959fb77245e9849f56d4de1a7586a737dbca6246 100644 (file)
@@ -1,8 +1,6 @@
 #include <string.h>
 #include <stdlib.h>
 
-//#define CONFIG_DEBUG
-
 #include "libthreads.h"
 
 #define STACK_SIZE (1024 * 1024)
index 3324fccfdf0b902866748ec964ca15ebc4071783..a25b27797268326ca63db433b31ffcd4897c0b22 100644 (file)
@@ -4,12 +4,14 @@
 #include <stdio.h>
 #include <ucontext.h>
 
+//#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 {
index e940f5aaff1506385f30a1b1611333683082dca3..f5ce644810856b06b3002996a1d95c1e11f17b9d 100644 (file)
@@ -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);
 }