/* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.150 2002/07/19 18:45:21 sof Exp $
+ * $Id: Schedule.c,v 1.151 2002/07/25 18:36:59 sof Exp $
*
* (c) The GHC Team, 1998-2000
*
#include "StgRun.h"
#include "StgStartup.h"
#include "Hooks.h"
+#define COMPILING_SCHEDULER
#include "Schedule.h"
#include "StgMiscClosures.h"
#include "Storage.h"
//@subsection Debugging Routines
/* -----------------------------------------------------------------------------
- Debugging: why is a thread blocked
+ * Debugging: why is a thread blocked
+ * [Also provides useful information when debugging threaded programs
+ * at the Haskell source code level, so enable outside of DEBUG. --sof 7/02]
-------------------------------------------------------------------------- */
-#ifdef DEBUG
-
+static
void
printThreadBlockage(StgTSO *tso)
{
}
}
+static
void
printThreadStatus(StgTSO *tso)
{
ullong_format_string(TIME_ON_PROC(CurrentProc),
time_string, rtsFalse/*no commas!*/);
- sched_belch("all threads at [%s]:", time_string);
+ fprintf(stderr, "all threads at [%s]:\n", time_string);
# elif defined(PAR)
char time_string[TIME_STR_LEN], node_str[NODE_STR_LEN];
ullong_format_string(CURRENT_TIME,
time_string, rtsFalse/*no commas!*/);
- sched_belch("all threads at [%s]:", time_string);
+ fprintf(stderr,"all threads at [%s]:\n", time_string);
# else
- sched_belch("all threads:");
+ fprintf(stderr,"all threads:\n");
# endif
for (t = all_threads; t != END_TSO_QUEUE; t = t->global_link) {
}
}
+#ifdef DEBUG
+
/*
Print a whole blocking queue attached to node (debugging only).
*/
/* -----------------------------------------------------------------------------
- * $Id: Schedule.h,v 1.34 2002/06/19 20:45:15 sof Exp $
+ * $Id: Schedule.h,v 1.35 2002/07/25 18:37:00 sof Exp $
*
* (c) The GHC Team 1998-1999
*
*/
extern StgMainThread *main_threads;
+void printAllThreads(void);
+#ifdef COMPILING_SCHEDULER
+static void printThreadBlockage(StgTSO *tso);
+static void printThreadStatus(StgTSO *tso);
+#endif
/* debugging only
*/
#ifdef DEBUG
-void printThreadBlockage(StgTSO *tso);
-void printThreadStatus(StgTSO *tso);
-void printAllThreads(void);
-#endif
void print_bq (StgClosure *node);
+#endif
#if defined(PAR)
void print_bqe (StgBlockingQueueElement *bqe);
#endif