Changeset: f1f8388b1cff for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f1f8388b1cff
Modified Files:
        monetdb5/mal/mal.c
        monetdb5/mal/mal.h
        monetdb5/mal/mal_profiler.c
Branch: profiler
Log Message:

Fix compilation


diffs (118 lines):

diff --git a/monetdb5/mal/mal.c b/monetdb5/mal/mal.c
--- a/monetdb5/mal/mal.c
+++ b/monetdb5/mal/mal.c
@@ -38,6 +38,7 @@ MT_Lock     mal_remoteLock MT_LOCK_INITI
 MT_Lock        mal_profileLock MT_LOCK_INITIALIZER("mal_profileLock");
 MT_Lock     mal_copyLock MT_LOCK_INITIALIZER("mal_copyLock");
 MT_Lock     mal_delayLock MT_LOCK_INITIALIZER("mal_delayLock");
+MT_Lock     mal_beatLock MT_LOCK_INITIALIZER("mal_beatLock");
 /*
  * Initialization of the MAL context
  * The compiler directive STRUCT_ALIGNED tells that the
@@ -79,6 +80,7 @@ int mal_init(void){
        MT_lock_init( &mal_profileLock, "mal_profileLock");
        MT_lock_init( &mal_copyLock, "mal_copyLock");
        MT_lock_init( &mal_delayLock, "mal_delayLock");
+       MT_lock_init( &mal_beatLock, "mal_beatLock");
 #endif
 
        tstAligned();
@@ -94,12 +96,10 @@ int mal_init(void){
        RECYCLEinit();
        if( malBootstrap() == 0)
                return -1;
-       initTrace();
        /* set up the profiler if needed, output sent to console */
        /* Use the same shortcuts as stethoscope */
-       if ( mal_trace ) {
+       if ( mal_trace ) 
                openProfilerStream(mal_clients[0].fdout,0);
-       } 
        return 0;
 }
 /*
diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h
--- a/monetdb5/mal/mal.h
+++ b/monetdb5/mal/mal.h
@@ -79,6 +79,7 @@ mal_export MT_Lock  mal_remoteLock;
 mal_export MT_Lock  mal_profileLock ;
 mal_export MT_Lock  mal_copyLock ;
 mal_export MT_Lock  mal_delayLock ;
+mal_export MT_Lock  mal_beatLock ;
 
 
 mal_export int mal_init(void);
diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -46,7 +46,9 @@ static struct{
 } corestat[256];
 
 /* the heartbeat process produces a ping event once every X milliseconds */
-static MT_Lock hbLock MT_LOCK_INITIALIZER("hbLock");
+//#ifdef ATOMIC_LOCK
+//static MT_Lock beatLock MT_LOCK_INITIALIZER("beatLock");
+//#endif
 
 /*
  * Profiler trace cache
@@ -483,7 +485,7 @@ profilerHeartbeatEvent(char *alter)
        struct timeval clock;
        char *tbuf;
 
-       if (ATOMIC_GET(hbdelay, hbLock, "profilerHeatbeatEvent") == 0 || 
eventstream  == NULL)
+       if (ATOMIC_GET(hbdelay, beatLock, "profilerHeatbeatEvent") == 0 || 
eventstream  == NULL)
                return;
 
        /* get CPU load on beat boundaries only */
@@ -1073,41 +1075,41 @@ static void profilerHeartbeat(void *dumm
        int t;
 
        (void) dummy;
-       while (ATOMIC_GET(hbrunning, hbLock, "profilerHeartbeat")) {
+       while (ATOMIC_GET(hbrunning, beatLock, "profilerHeartbeat")) {
                /* wait until you need this info */
-               while (ATOMIC_GET(hbdelay, hbLock, "profilerHeatbeatEvent") == 
0 || eventstream  == NULL) {
+               while (ATOMIC_GET(hbdelay, beatLock, "profilerHeatbeatEvent") 
== 0 || eventstream  == NULL) {
                        for (t = 1000; t > 0; t -= 25) {
                                MT_sleep_ms(25);
-                               if (!ATOMIC_GET(hbrunning, hbLock, 
"profilerHeartbeat"))
+                               if (!ATOMIC_GET(hbrunning, beatLock, 
"profilerHeartbeat"))
                                        return;
                        }
                }
-               for (t = (int) ATOMIC_GET(hbdelay, hbLock, 
"profilerHeatbeatEvent"); t > 0; t -= 25) {
+               for (t = (int) ATOMIC_GET(hbdelay, beatLock, 
"profilerHeatbeatEvent"); t > 0; t -= 25) {
                        MT_sleep_ms(t > 25 ? 25 : t);
-                       if (!ATOMIC_GET(hbrunning, hbLock, "profilerHeartbeat"))
+                       if (!ATOMIC_GET(hbrunning, beatLock, 
"profilerHeartbeat"))
                                return;
                }
                profilerHeartbeatEvent("ping");
        }
-       ATOMIC_SET(hbdelay, 0, hbLock, "profilerHeatbeat");
+       ATOMIC_SET(hbdelay, 0, beatLock, "profilerHeatbeat");
 }
 
 void setHeartbeat(int delay)
 {
        if (hbthread &&  delay < 0 ){
-               ATOMIC_SET(hbrunning, 0, hbLock, "stopHeartbeat");
+               ATOMIC_SET(hbrunning, 0, beatLock, "stopHeartbeat");
                MT_join_thread(hbthread);
                return;
        }
        if (delay <= 10)
                hbdelay =10;
-       ATOMIC_SET(hbdelay, (ATOMIC_TYPE) delay, hbLock, "startHeatbeat");
+       ATOMIC_SET(hbdelay, (ATOMIC_TYPE) delay, beatLock, "startHeatbeat");
 }
 
 void initHeartbeat(void)
 {
 #ifdef NEED_MT_LOCK_INIT
-       ATOMIC_INIT(hbLock, "hbLock");
+       ATOMIC_INIT(beatLock, "beatLock");
 #endif
        hbrunning = 1;
        if (MT_create_thread(&hbthread, profilerHeartbeat, NULL, 
MT_THR_JOINABLE) < 0) {
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to