Changeset: b47f27d65058 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b47f27d65058
Modified Files:
        monetdb5/mal/Tests/performanceTests/performanceLog
        monetdb5/mal/mal_interpreter.c
        monetdb5/mal/mal_runtime.c
        monetdb5/mal/mal_runtime.h
Branch: default
Log Message:

Removal of old performance tracing properties.


diffs (261 lines):

diff --git a/monetdb5/mal/Tests/performanceTests/performanceLog 
b/monetdb5/mal/Tests/performanceTests/performanceLog
--- a/monetdb5/mal/Tests/performanceTests/performanceLog
+++ b/monetdb5/mal/Tests/performanceTests/performanceLog
@@ -1216,3 +1216,18 @@ tst400e          0.613/0.524/0.013
 
 tst901a                1.315/0.651/0.595
 tst901b                1.313/1.222/0.016
+======================== 20 mar 2013 ===================
+Vienna Fedora 18
+Default release
+The compilation mode for is --enable-optimize --disable-debug
+compilation took ?
+command: time mserver5 TST </dev/null >/dev/null
+base           0.212/0.046/0.016.
+tst400a                0.211/0.079/0.014
+tst400bHuge    0.263/0.109/0.020
+tst400cHuge    0.264/0.120/0.023
+tst400d                0.511/0.319/0.020
+tst400e                0.613/0.470/0.012
+
+tst901a                0.655/0.409/0.038
+tst901b                1.417/1.100/0.038
diff --git a/monetdb5/mal/mal_interpreter.c b/monetdb5/mal/mal_interpreter.c
--- a/monetdb5/mal/mal_interpreter.c
+++ b/monetdb5/mal/mal_interpreter.c
@@ -496,13 +496,10 @@ str runMALsequence(Client cntxt, MalBlkP
        ValPtr backup;
        int garbages[16], *garbage;
        int stkpc = 0;
-       //MT_Lock *lock = NULL;
-       //int tid = 0;
        RuntimeProfileRecord runtimeProfile, runtimeProfileFunction;
 
        if (stk == NULL)
                throw(MAL, "mal.interpreter", MAL_STACK_FAIL);
-       runtimeProfileInit(cntxt, mb, stk, &runtimeProfile);
 
        /* prepare extended backup and garbage structures */
        if ( mb->maxarg > 16 ){
@@ -516,9 +513,9 @@ str runMALsequence(Client cntxt, MalBlkP
 
        /* also produce event record for start of function */
        if ( startpc == 1 ){
-               runtimeProfileInit(cntxt, mb, stk, &runtimeProfileFunction);
+               runtimeProfileInit(cntxt, mb, stk);
                runtimeProfileBegin(cntxt, mb, stk, 0, &runtimeProfileFunction, 
1);
-       }
+       } 
        stkpc = startpc;
        exceptionVar = -1;
 
@@ -700,12 +697,10 @@ str runMALsequence(Client cntxt, MalBlkP
                                if (getInstrPtr(mb, 0)->token == FACTORYsymbol)
                                        ret = shutdownFactory(cntxt, mb);
                                runtimeProfileExit(cntxt, mb, stk, pci, 
&runtimeProfile);
-                               runtimeProfileFinish(cntxt, mb, 
&runtimeProfile);
                                runtimeProfileExit(cntxt, mb, stk, 
getInstrPtr(mb,0), &runtimeProfileFunction);
-                               runtimeProfileFinish(cntxt, mb, 
&runtimeProfileFunction);
+                               runtimeProfileFinish(cntxt, mb);
                                if (pcicaller && garbageControl(getInstrPtr(mb, 
0)))
                                        garbageCollector(cntxt, mb, stk, TRUE);
-                               runtimeProfile.ppc = 0; /* also finalize 
function call event */
                                if (cntxt->qtimeout && time(NULL) - 
stk->clock.tv_usec > cntxt->qtimeout){
                                        ret= createException(MAL, 
"mal.interpreter", RUNTIME_QRY_TIMEOUT);
                                        break;
@@ -732,7 +727,6 @@ str runMALsequence(Client cntxt, MalBlkP
                        /* monitoring information should reflect the input 
arguments,
                           which may be removed by garbage collection  */
                        runtimeProfileExit(cntxt, mb, stk, pci, 
&runtimeProfile);
-                       //runtimeTiming(cntxt, mb, stk, pci, tid, lock, 
&runtimeProfile);
                        /* check for strong debugging after each MAL statement 
*/
                        if ( pci->token != FACcall && ret== MAL_SUCCEED) {
                                if (GDKdebug & (CHECKMASK|PROPMASK) && 
exceptionVar < 0) {
@@ -856,7 +850,7 @@ str runMALsequence(Client cntxt, MalBlkP
                                /* unknown exceptions lead to propagation */
                                if (exceptionVar == -1) {
                                        runtimeProfileExit(cntxt, mb, stk, pci, 
&runtimeProfile);
-                                       runtimeProfileFinish(cntxt, mb, 
&runtimeProfile);
+                                       runtimeProfileFinish(cntxt, mb);
                                        if (cntxt->qtimeout && time(NULL) - 
stk->clock.tv_usec > cntxt->qtimeout)
                                                ret= createException(MAL, 
"mal.interpreter", RUNTIME_QRY_TIMEOUT);
                                        stkpc = mb->stop;
@@ -1083,9 +1077,9 @@ str runMALsequence(Client cntxt, MalBlkP
                                }
                        }
                        if (stkpc == mb->stop) {
-                               runtimeProfile.ppc = 0; /* also finalize 
function call event */
                                runtimeProfileExit(cntxt, mb, stk, pci, 
&runtimeProfile);
-                               runtimeProfileFinish(cntxt, mb, 
&runtimeProfile);
+                               runtimeProfileExit(cntxt, mb, stk, 
getInstrPtr(mb,0), &runtimeProfileFunction);
+                               runtimeProfileFinish(cntxt, mb);
                                break;
                        }
                        if (stkpc == mb->stop)
@@ -1118,9 +1112,8 @@ str runMALsequence(Client cntxt, MalBlkP
                                                garbageCollector(cntxt, mb, 
stk, TRUE);
                                        /* reset the clock */
                                        runtimeProfileExit(cntxt, mb, stk, pp, 
&runtimeProfile);
-                                       runtimeProfileFinish(cntxt, mb, 
&runtimeProfile);
                                        runtimeProfileExit(cntxt, mb, stk, 
getInstrPtr(mb,0), &runtimeProfileFunction);
-                                       runtimeProfileFinish(cntxt, mb, 
&runtimeProfileFunction);
+                                       runtimeProfileFinish(cntxt, mb);
                                } 
                        }
                        stkpc = mb->stop;
diff --git a/monetdb5/mal/mal_runtime.c b/monetdb5/mal/mal_runtime.c
--- a/monetdb5/mal/mal_runtime.c
+++ b/monetdb5/mal/mal_runtime.c
@@ -58,11 +58,14 @@ static str isaSQLquery(MalBlkPtr mb){
  * Manage the runtime profiling information
  */
 void
-runtimeProfileInit(Client cntxt, MalBlkPtr mb, MalStkPtr stk, RuntimeProfile 
prof)
+runtimeProfileInit(Client cntxt, MalBlkPtr mb, MalStkPtr stk)
 {
        int i;
        str q;
 
+       if (malProfileMode)
+               setFilterOnBlock(mb, 0, 0);
+
        MT_lock_set(&mal_delayLock, "sysmon");
        if ( QRYqueue == 0)
                QRYqueue = (QueryQueue) GDKzalloc( sizeof (struct QRYQUEUE) * 
(qsize= 256));
@@ -75,12 +78,6 @@ runtimeProfileInit(Client cntxt, MalBlkP
 
        if ( mb->tag == 0)
                mb->tag = OIDnew(1);
-       prof->newclk = 0;
-       prof->ppc = -2;
-       prof->tcs = 0;
-       prof->inblock = 0;
-       prof->oublock = 0;
-
        if ( i == qtop ) {
                QRYqueue[i].mb = mb;    // for detecting duplicates
                QRYqueue[i].stk = stk;  // for status pause 'p'/running '0'/ 
quiting 'q'
@@ -92,25 +89,17 @@ runtimeProfileInit(Client cntxt, MalBlkP
                QRYqueue[i].status = "running";
                QRYqueue[i].cntxt = cntxt;
        }
-       prof->memory = MT_mallinfo();
-       if (malProfileMode) {
-               setFilterOnBlock(mb, 0, 0);
-               prof->ppc = -1;
-       }
 
        qtop += i == qtop;
        MT_lock_unset(&mal_delayLock, "sysmon");
-       
 }
 
 void
-runtimeProfileFinish(Client cntxt, MalBlkPtr mb, RuntimeProfile prof)
+runtimeProfileFinish(Client cntxt, MalBlkPtr mb)
 {
        int i,j;
 
        (void) cntxt;
-       (void) prof;
-
 
        MT_lock_set(&mal_delayLock, "sysmon");
        for( i=j=0; i< qtop; i++)
@@ -141,25 +130,23 @@ runtimeProfileBegin(Client cntxt, MalBlk
        if (malProfileMode == 0)
                return; /* mostly true */
        
-       if (stk && mb->profiler != NULL) {
+       if (stk && mb->profiler != NULL && mb->profiler[stkpc].trace) {
                prof->newclk = stk->clk = GDKusec();
-               if (mb->profiler[stkpc].trace) {
-                       MT_lock_set(&mal_delayLock, "sysmon");
-                       gettimeofday(&stk->clock, NULL);
-                       prof->ppc = stkpc;
-                       mb->profiler[stkpc].clk = 0;
-                       mb->profiler[stkpc].ticks = 0;
-                       mb->profiler[stkpc].clock = stk->clock;
-                       /* emit the instruction upon start as well */
-                       if (malProfileMode)
-                               profilerEvent(cntxt->idx, mb, stk, stkpc, 
start);
+               prof->stkpc = stkpc;
+               MT_lock_set(&mal_delayLock, "sysmon");
+               gettimeofday(&stk->clock, NULL);
+               mb->profiler[stkpc].clk = 0;
+               mb->profiler[stkpc].ticks = 0;
+               mb->profiler[stkpc].clock = stk->clock;
+               /* emit the instruction upon start as well */
+               if (malProfileMode)
+                       profilerEvent(cntxt->idx, mb, stk, stkpc, start);
 #ifdef HAVE_TIMES
-                       times(&stk->timer);
-                       mb->profiler[stkpc].timer = stk->timer;
+               times(&stk->timer);
+               mb->profiler[stkpc].timer = stk->timer;
 #endif
-                       mb->profiler[stkpc].clk = stk->clk;
-                       MT_lock_unset(&mal_delayLock, "sysmon");
-               }
+               mb->profiler[stkpc].clk = stk->clk;
+               MT_lock_unset(&mal_delayLock, "sysmon");
        }
 }
 
@@ -167,7 +154,7 @@ runtimeProfileBegin(Client cntxt, MalBlk
 void
 runtimeProfileExit(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci, 
RuntimeProfile prof)
 {
-       int i,j,fnd, stkpc = prof->ppc;
+       int i,j,fnd, stkpc = prof->stkpc;
 
        if (cntxt->flags & footprintFlag && pci){
                for (i = 0; i < pci->retc; i++)
@@ -184,7 +171,8 @@ runtimeProfileExit(Client cntxt, MalBlkP
 
        if (malProfileMode == 0)
                return; /* mostly true */
-       if (stk != NULL && prof->ppc >= 0 && mb->profiler != NULL && 
mb->profiler[stkpc].trace && mb->profiler[stkpc].clk)
+
+       if (stk != NULL && prof->stkpc >= 0 && mb->profiler != NULL && 
mb->profiler[stkpc].trace && mb->profiler[stkpc].clk)
        {
                MT_lock_set(&mal_contextLock, "sysmon");
                gettimeofday(&mb->profiler[stkpc].clock, NULL);
@@ -197,7 +185,6 @@ runtimeProfileExit(Client cntxt, MalBlkP
                        mb->profiler[stkpc].wbytes = getVolume(stk, pci, 1);
                }
                profilerEvent(cntxt->idx, mb, stk, stkpc, 0);
-               prof->ppc = -1;
                MT_lock_unset(&mal_contextLock, "sysmon");
        }
 }
diff --git a/monetdb5/mal/mal_runtime.h b/monetdb5/mal/mal_runtime.h
--- a/monetdb5/mal/mal_runtime.h
+++ b/monetdb5/mal/mal_runtime.h
@@ -26,13 +26,11 @@
 
 /* During MAL interpretation we collect performance event data.
  * Their management is orchestrated from here.
+ * We need to maintain some state from ProfileBegin
 */
 typedef struct{
        lng newclk;
-       int ppc;
-       lng tcs;
-       lng oublock, inblock;
-       struct Mallinfo memory;
+       int stkpc;      
 } *RuntimeProfile, RuntimeProfileRecord;
 
 /* The actual running queries are assembled in a queue
@@ -49,8 +47,8 @@ typedef struct QRYQUEUE{
        lng runtime;
 } *QueryQueue;
 
-mal_export void runtimeProfileInit(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
RuntimeProfile prof);
-mal_export void runtimeProfileFinish(Client cntxt, MalBlkPtr mb, 
RuntimeProfile prof);
+mal_export void runtimeProfileInit(Client cntxt, MalBlkPtr mb, MalStkPtr stk);
+mal_export void runtimeProfileFinish(Client cntxt, MalBlkPtr mb);
 mal_export void runtimeProfileBegin(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
int stkpc, RuntimeProfile prof, int start);
 mal_export void runtimeProfileExit(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci, RuntimeProfile prof);
 mal_export lng getVolume(MalStkPtr stk, InstrPtr pci, int rd);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to