Changeset: be6fe3a500da for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=be6fe3a500da
Modified Files:
gdk/gdk_system.h
gdk/gdk_tracer.h
Branch: gdk_tracer
Log Message:
Added GDKtracer to gdk_system
diffs (125 lines):
diff --git a/gdk/gdk_system.h b/gdk/gdk_system.h
--- a/gdk/gdk_system.h
+++ b/gdk/gdk_system.h
@@ -158,6 +158,7 @@ gdk_export int MT_join_thread(MT_Id t);
* @- MT Lock API
*/
#include "matomic.h"
+#include "gdk_tracer.h"
/* define this to keep lock statistics (can be expensive) */
/* #define LOCK_STATS */
@@ -177,8 +178,7 @@ gdk_export int MT_join_thread(MT_Id t);
#define _DBG_LOCK_COUNT_0(l) \
do { \
(void) ATOMIC_INC(&GDKlockcnt); \
- TEMDEBUG fprintf(stderr, "#%s: %s: locking %s...\n", \
- MT_thread_getname(), __func__, (l)->name); \
+ DEBUG(TEM, "Locking %s...\n", (l)->name); \
} while (0)
#define _DBG_LOCK_LOCKER(l) \
@@ -191,14 +191,12 @@ gdk_export int MT_join_thread(MT_Id t);
do { \
(l)->locker = __func__; \
(l)->thread = NULL; \
- TEMDEBUG fprintf(stderr, "#%s: %s: unlocking %s\n", \
- MT_thread_getname(), __func__, (l)->name); \
+ DEBUG(TEM, "Unlocking %s\n", (l)->name); \
} while (0)
#define _DBG_LOCK_CONTENTION(l)
\
do { \
- TEMDEBUG fprintf(stderr, "#%s: %s: lock %s contention\n", \
- MT_thread_getname(), __func__, (l)->name); \
+ DEBUG(TEM, "Lock %s contention\n", (l)->name); \
(void) ATOMIC_INC(&GDKlockcontentioncnt); \
(void) ATOMIC_INC(&(l)->contention); \
} while (0)
@@ -215,8 +213,7 @@ gdk_export int MT_join_thread(MT_Id t);
GDKlocklist = (l); \
ATOMIC_CLEAR(&GDKlocklistlock); \
} \
- TEMDEBUG fprintf(stderr, "#%s: %s: locking %s complete\n", \
- MT_thread_getname(), __func__, (l)->name); \
+ DEBUG(TEM, "Locking %s complete\n", (l)->name); \
} while (0)
#define _DBG_LOCK_INIT(l) \
@@ -522,16 +519,14 @@ typedef struct {
#define MT_sema_down(s)
\
do { \
- TEMDEBUG fprintf(stderr, "#%s: %s: sema %s down...\n", \
- MT_thread_getname(), __func__, (s)->name); \
+ DEBUG(TEM, "Sema %s down...\n", (s)->name); \
if (WaitForSingleObject((s)->sema, 0) != WAIT_OBJECT_0) { \
MT_thread_setsemawait(s); \
while (WaitForSingleObject((s)->sema, INFINITE) !=
WAIT_OBJECT_0) \
; \
MT_thread_setsemawait(NULL); \
} \
- TEMDEBUG fprintf(stderr, "#%s: %s: sema %s down complete\n", \
- MT_thread_getname(), __func__, (s)->name); \
+ DEBUG(TEM, "Sema %s down complete\n", (s)->name); \
} while (0)
#elif defined(HAVE_DISPATCH_SEMAPHORE_CREATE)
@@ -588,8 +583,7 @@ typedef struct {
#define MT_sema_down(s)
\
do { \
- TEMDEBUG fprintf(stderr, "#%s: %s: sema %s down...\n", \
- MT_thread_getname(), __func__, (s)->name); \
+ DEBUG(TEM, "Sema %s down...\n", (s)->name); \
pthread_mutex_lock(&(s)->mutex); \
if (--(s)->cnt < 0) { \
MT_thread_setsemawait(s); \
@@ -600,8 +594,7 @@ typedef struct {
MT_thread_setsemawait(NULL); \
pthread_mutex_unlock(&(s)->mutex); \
} \
- TEMDEBUG fprintf(stderr, "#%s: %s: sema %s down complete\n", \
- MT_thread_getname(), __func__, (s)->name); \
+ DEBUG(TEM, "Sema %s down complete\n", (s)->name); \
} while (0)
#else
@@ -621,23 +614,20 @@ typedef struct {
#define MT_sema_up(s) \
do { \
- TEMDEBUG fprintf(stderr, "#%s: %s: sema %s up\n", \
- MT_thread_getname(), __func__, (s)->name); \
+ DEBUG(TEM, "Sema %s up\n", (s)->name); \
sem_post(&(s)->sema); \
} while (0)
#define MT_sema_down(s)
\
do { \
- TEMDEBUG fprintf(stderr, "#%s: %s: sema %s down...\n", \
- MT_thread_getname(), __func__, (s)->name); \
+ DEBUG(TEM, "Sema %s down...\n", (s)->name); \
if (sem_trywait(&(s)->sema) != 0) { \
MT_thread_setsemawait(s); \
while (sem_wait(&(s)->sema) != 0) \
; \
MT_thread_setsemawait(NULL); \
} \
- TEMDEBUG fprintf(stderr, "#%s: %s: sema %s down complete\n", \
- MT_thread_getname(), __func__, (s)->name); \
+ DEBUG(TEM, "Sema %s down complete\n", (s)->name); \
} while (0)
#endif
diff --git a/gdk/gdk_tracer.h b/gdk/gdk_tracer.h
--- a/gdk/gdk_tracer.h
+++ b/gdk/gdk_tracer.h
@@ -88,6 +88,7 @@ static const char *LAYER_STR[] = {
COMP( ALGO ) \
COMP( DELTA ) \
COMP( IO ) \
+ COMP( TEM ) \
\
COMP( GEOM ) \
COMP( LIDAR ) \
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list