Changeset: 83b9dbdb9356 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=83b9dbdb9356
Modified Files:
        clients/Tests/exports.stable.out
        monetdb5/mal/mal_client.h
        monetdb5/mal/mal_dataflow.c
        monetdb5/mal/mal_debugger.c
        monetdb5/mal/mal_debugger.h
        monetdb5/mal/mal_interpreter.c
        monetdb5/mal/mal_interpreter.h
        monetdb5/mal/mal_profiler.c
        monetdb5/mal/mal_runtime.c
        monetdb5/mal/mal_runtime.h
        monetdb5/modules/mal/language.c
        monetdb5/modules/mal/language.h
        monetdb5/modules/mal/language.mal
        monetdb5/modules/mal/mdb.c
        monetdb5/modules/mal/mdb.h
        monetdb5/modules/mal/mdb.mal
        monetdb5/modules/mal/profiler.c
        monetdb5/modules/mal/profiler.h
Branch: default
Log Message:

removal of old performance tracing flags
The stethoscope and tomograph are the preferred way to analyse
the progress at the MAL level. Furthermore, we can collect the
performance data using TRACE SQL.
This makes the original performance tracing in the MAL debugger
superflous.


diffs (truncated from 749 to 300 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -938,7 +938,6 @@ str BATXMLxmltext(int *ret, int *bid);
 str BATXMLxquery(int *x, int *s, str *expr);
 ptr BATmax(BAT *b, ptr aggr);
 ptr BATmin(BAT *b, ptr aggr);
-char BBPTraceCall(Client cntxt, MalBlkPtr mb, MalStkPtr stk, int pc);
 str BKCaccbuild(int *ret, int *bid, str *acc, ptr *param);
 str BKCaccbuild_std(int *ret, int *bid, int *acc);
 str BKCappend_force_wrap(int *r, int *bid, int *uid, bit *force);
@@ -3179,7 +3178,6 @@ str unlockRef;
 str unpackRef;
 str unpinRef;
 int unsafeProp;
-void updateBigFoot(Client cntxt, int bid, int add);
 void updateFootPrint(MalBlkPtr mb, MalStkPtr stk, int varid);
 str updateRef;
 void updateScenario(str scen, str nme, MALfcn fcn);
diff --git a/monetdb5/mal/mal_client.h b/monetdb5/mal/mal_client.h
--- a/monetdb5/mal/mal_client.h
+++ b/monetdb5/mal/mal_client.h
@@ -94,14 +94,7 @@ typedef struct CLIENT {
        lng memory;     /* memory claimed for keeping BATs */
        BUN     cnt;    /* bat count */
 
-#define timerFlag      1
-#define memoryFlag     2
-#define ioFlag         4
-#define flowFlag       8
 #define footprintFlag  16
-#define cntFlag                32
-#define threadFlag     64
-#define bbpFlag                128
        time_t      login;  
        time_t      lastcmd;    /* set when input is received */
        int         qtimeout;   /* query abort after x seconds */
diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c
--- a/monetdb5/mal/mal_dataflow.c
+++ b/monetdb5/mal/mal_dataflow.c
@@ -522,9 +522,6 @@ DFLOWscheduler(DataFlow flow)
        /* initialize the eligible statements */
        fe = flow->status;
 
-       if (fe[0].flow->cntxt->flags & timerFlag)
-               fe[0].flow->cntxt->timer = GDKusec();
-
        MT_lock_set(&flow->flowlock, "MALworker");
        for (i = 0; i < actions; i++)
                if (fe[i].blocks == 0) {
diff --git a/monetdb5/mal/mal_debugger.c b/monetdb5/mal/mal_debugger.c
--- a/monetdb5/mal/mal_debugger.c
+++ b/monetdb5/mal/mal_debugger.c
@@ -280,54 +280,6 @@ mdbBacktrace(Client cntxt, MalStkPtr stk
                        pci = stk->up->pcup;
        }
 }
-/*
- * Sometimes we may want to trace the changes applied to the
- * BAT buffer pool and report them together with the MAL
- * instruction where it happened.
- */
-static int BBPtraceEnabled = 0;
-static str BBPtracePattern = NULL;
-char
-BBPTraceCall(Client cntxt, MalBlkPtr mb, MalStkPtr stk, int pc)
-{
-       static int *BBPmirror = NULL;
-       static int bbpsize;
-       char lbuf[1024], pbuf[1024];
-       int i, action;
-       (void) mb;
-
-       if (BBPmirror == NULL) {
-               bbpsize = BBPsize;
-               BBPmirror = (int *) GDKzalloc(sizeof(int) * BBPsize);
-       }
-       if (BBPsize > bbpsize) {
-               int *old = BBPmirror;
-               BBPmirror = (int *) GDKzalloc(sizeof(int) * BBPsize);
-               memcpy((char *) BBPmirror, (char *) old, sizeof(int) * bbpsize);
-               bbpsize = BBPsize;
-               GDKfree(old);
-       }
-       /* no growing BBP yet */
-       action = 0;
-       for (i = 0; i < bbpsize; i++) {
-               /* what happened to this BAT */
-               if (BBPmirror[i] != BBP_lrefs(i)) {
-                       BAT *b = BBPquickdesc(ABS(i), TRUE);
-                       BBPlogical(i, lbuf);
-                       if (BBPtracePattern && strstr(lbuf, BBPtracePattern) != 
NULL)
-                               continue;
-                       BBPphysical(i, pbuf);
-                       if (BBPmirror[i])
-                               mnstr_printf(cntxt->fdout, "#BBP [%d] state 
change of %s %s refs %d rows " BUNFMT "\n",
-                                               i, lbuf, pbuf, BBP_lrefs(i), 
BATcount(b));
-                       action = 1;
-               }
-               BBPmirror[i] = BBP_lrefs(i);
-       }
-       if (action)
-               mdbBacktrace(cntxt, stk, pc);
-       return 's';
-}
 
 static void
 printBATproperties(stream *f, BAT *b)
@@ -524,61 +476,7 @@ retryRead:
                                /* used to inspect the identifier distribution 
*/
                                showModuleStatistics(out, cntxt->nspace);
                                continue;
-                       } else if (strncmp("set", b, 3) == 0) {
-                               skipWord(cntxt, b);
-                               skipBlanc(cntxt, b);
-                               if (strncmp("flow", b, 1) == 0)
-                                       cntxt->flags |= flowFlag;
-                               if (strncmp("memory", b, 1) == 0) {
-                                       struct Mallinfo memory;
-                                       cntxt->flags |= memoryFlag;
-                                       memory = MT_mallinfo();
-                                       mnstr_printf(out, "arena " SZFMT " 
ordblks " SZFMT " smblks " SZFMT " "
-                                                                               
                                                                                
                " hblkhd " SZFMT " hblks " SZFMT " fsmblks " SZFMT " uordblks " 
SZFMT "\n",
-                                                       (size_t) memory.arena,
-                                                       (size_t) memory.ordblks,
-                                                       (size_t) memory.smblks,
-                                                       (size_t) memory.hblkhd,
-                                                       (size_t) memory.hblks,
-                                                       (size_t) memory.fsmblks,
-                                                       (size_t) memory.uordblks
-                                                       );
-                               }
-                               if (strncmp("bbp", b, 1) == 0) {
-                                       cntxt->flags |= bbpFlag;
-                                       stk->cmd = 0;
-                               }
-                               if (strncmp("thread", b, 1) == 0) {
-                                       cntxt->flags |= threadFlag;
-                                       stk->cmd = 0;
-                               }
-                               if (strncmp("timer", b, 1) == 0) {
-                                       cntxt->flags |= timerFlag;
-                                       cntxt->timer = GDKusec();
-                                       stk->cmd = 0;
-                               }
-                               if (strncmp("io", b, 1) == 0) {
-#ifdef HAVE_SYS_RESOURCE_H
-                                       struct  rusage resource;
-#endif
-                                       cntxt->flags |= ioFlag;
-#ifdef HAVE_SYS_RESOURCE_H
-                                       getrusage(RUSAGE_SELF, &resource);
-                                       mnstr_printf(out, "#maxrss %ld 
ixrss=%ld idrss=%ld isrss=%ld"
-                                                                         " 
minflt=%ld majflt=%ld nswap=%ld inblock=%ld oublock=%ld\n",
-                                                       resource.ru_maxrss, 
resource.ru_ixrss,
-                                                       resource.ru_idrss, 
resource.ru_isrss,
-                                                       resource.ru_minflt, 
resource.ru_majflt,
-                                                       resource.ru_nswap, 
resource.ru_inblock,
-                                                       resource.ru_oublock);
-#endif
-                               }
-                               if (strncmp("footprint", b, 7) == 0) {
-                                       /* calculate the virtual memory 
footprint */
-                                       cntxt->flags |= footprintFlag;
-                               }
-                               continue;
-                       }
+                       } 
                        stk->cmd = *b;
                        m = 0;
                        break;
@@ -702,16 +600,6 @@ retryRead:
                                int i, limit, inuse = 0;
 
                                skipWord(cntxt, b);
-                               /* bbp change tracing enabling */
-                               if (strncmp(b, "trace", 5) == 0) {
-                                       skipWord(cntxt, b);
-                                       BBPtraceEnabled = !BBPtraceEnabled;
-                                       if (BBPtraceEnabled && *b)
-                                               BBPtracePattern = GDKstrdup(b);
-                                       mnstr_printf(out, "#bbp trace enabled 
%d\n", BBPtraceEnabled);
-                                       stk->cmd = 'c';
-                                       break;
-                               }
                                i = BBPindex(b);
                                if (i)
                                        limit = i + 1;
@@ -914,21 +802,6 @@ retryRead:
                        continue;
                }
                case 'u':
-                       if (strncmp("unset", b, 5)) {
-                               skipWord(cntxt, b);
-                               skipBlanc(cntxt, b);
-                               if (strncmp("flow", b, 4) == 0)
-                                       cntxt->flags &= ~flowFlag;
-                               if (strncmp("memory", b, 6) == 0)
-                                       cntxt->flags &= ~memoryFlag;
-                               if (strncmp("timer", b, 5) == 0)
-                                       cntxt->flags &= ~timerFlag;
-                               if (strncmp("footprint", b, 7) == 0)
-                                       cntxt->flags &= ~footprintFlag;
-                               if (strncmp("io", b, 2) == 0)
-                                       cntxt->flags &= ~ioFlag;
-                               continue;
-                       }
                        if (stk->up == NULL)
                                break;
                        mnstr_printf(out, "%s go up the stack\n", "#mdb ");
@@ -1219,8 +1092,6 @@ mdbStep(Client cntxt, MalBlkPtr mb, MalS
        }
        if (mdbSessionActive == 0)
                return;
-       if (cntxt->flags & timerFlag)
-               cntxt->timer = GDKusec();
        mdbSessionActive = 0; /* for name completion */
 }
 
@@ -1633,8 +1504,6 @@ mdbHelp(stream *f)
        mnstr_printf(f, "up               -- go up the stack\n");
        mnstr_printf(f, "trace <var>      -- trace assignment to variables\n");
        mnstr_printf(f, "trap <mod>.<fcn> -- catch MAL function call in 
console\n");
-       mnstr_printf(f, "set {timer,thread,flow,io,memory,bbp} -- set trace 
switches\n");
-       mnstr_printf(f, "unset            -- turn off switches\n");
        mnstr_printf(f, "help             -- this message\n");
 }
 
diff --git a/monetdb5/mal/mal_debugger.h b/monetdb5/mal/mal_debugger.h
--- a/monetdb5/mal/mal_debugger.h
+++ b/monetdb5/mal/mal_debugger.h
@@ -66,7 +66,6 @@ mal_export void printBatDetails(stream *
 mal_export void printBatInfo(stream *f, VarPtr n, ValPtr v);
 mal_export void printBatProperties(stream *f, VarPtr n, ValPtr v, str props);
 mal_export void printTraceCall(stream *out, MalBlkPtr mb, MalStkPtr stk, int 
pc, int flags);
-mal_export char BBPTraceCall(Client cntxt, MalBlkPtr mb, MalStkPtr stk, int 
pc);
 
 mal_export str runMALDebugger(Client cntxt, Symbol s);
 mal_export void printBBPinfo(stream *out);
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
@@ -369,7 +369,7 @@ str runMAL(Client cntxt, MalBlkPtr mb, M
  * observed due the small size of the function).
  */
        }
-       runtimeProfileInit(cntxt, mb, stk, &runtimeProfile, cntxt->flags & 
memoryFlag);
+       runtimeProfileInit(cntxt, mb, stk, &runtimeProfile);
 
        if (stk->cmd && env && stk->cmd != 'f')
                stk->cmd = env->cmd;
@@ -501,7 +501,7 @@ str runMALsequence(Client cntxt, MalBlkP
        ValPtr lhs, rhs, v;
        int i, k;
        InstrPtr pci = 0;
-       int exceptionVar, prevpc = 0;
+       int exceptionVar;
        str ret = 0, localGDKerrbuf= GDKerrbuf;
        int stamp = -1;
        ValRecord backups[16];
@@ -515,9 +515,7 @@ str runMALsequence(Client cntxt, MalBlkP
 
        if (stk == NULL)
                throw(MAL, "mal.interpreter", MAL_STACK_FAIL);
-       if (cntxt->flags & timerFlag)
-               oldtimer = cntxt->timer = GDKusec();
-       runtimeProfileInit(cntxt, mb, stk, &runtimeProfile, cntxt->flags & 
memoryFlag);
+       runtimeProfileInit(cntxt, mb, stk, &runtimeProfile);
 
        /* prepare extended backup and garbage structures */
        if ( mb->maxarg > 16 ){
@@ -531,7 +529,7 @@ str runMALsequence(Client cntxt, MalBlkP
 
        /* also produce event record for start of function */
        if ( startpc == 1 )
-               runtimeProfileInit(cntxt, mb, stk, &runtimeProfileFunction, 
cntxt->flags & memoryFlag);
+               runtimeProfileInit(cntxt, mb, stk, &runtimeProfileFunction);
        stkpc = startpc;
        exceptionVar = -1;
 
@@ -553,7 +551,6 @@ str runMALsequence(Client cntxt, MalBlkP
                                stk->cmd = cntxt->itrace;
                        if (oldtimer)
                                t = GDKusec();
-                       prevpc = stkpc;
                        mdbStep(cntxt, mb, stk, stkpc);
                        if (stk->cmd == 'x' || cntxt->mode == FINISHING) {
                                stk->cmd = 0;
@@ -914,9 +911,6 @@ str runMALsequence(Client cntxt, MalBlkP
                                /* skipToCatch(exceptionVar,@2,@3) */
                                if (stk->cmd == 'C' || mb->trap) {
                                        stk->cmd = 'n';
-                                       if (cntxt->flags & bbpFlag)
-                                               BBPTraceCall(cntxt, mb, stk, 
prevpc);
-                                       prevpc = stkpc;
                                        mdbStep(cntxt, mb, stk, stkpc);
                                        if (stk->cmd == 'x' || cntxt->mode == 
FINISHING) {
                                                stkpc = mb->stop;
@@ -1096,9 +1090,6 @@ str runMALsequence(Client cntxt, MalBlkP
                        /* skipToCatch(exceptionVar, @2, stk) */
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to