Changeset: bd1e5c8c12bb for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bd1e5c8c12bb
Modified Files:
        gdk/gdk_tracer.h
        monetdb5/mal/mal_dataflow.c
        monetdb5/mal/mal_function.c
        monetdb5/mal/mal_interpreter.c
        monetdb5/mal/mal_resolve.c
        monetdb5/optimizer/opt_aliases.c
        monetdb5/optimizer/opt_candidates.c
        monetdb5/optimizer/opt_coercion.c
        monetdb5/optimizer/opt_commonTerms.c
        monetdb5/optimizer/opt_constants.c
        monetdb5/optimizer/opt_costModel.c
        monetdb5/optimizer/opt_dataflow.c
        monetdb5/optimizer/opt_deadcode.c
        monetdb5/optimizer/opt_emptybind.c
        monetdb5/optimizer/opt_evaluate.c
        monetdb5/optimizer/opt_garbageCollector.c
        monetdb5/optimizer/opt_generator.c
        monetdb5/optimizer/opt_inline.c
        monetdb5/optimizer/opt_jit.c
        monetdb5/optimizer/opt_json.c
        monetdb5/optimizer/opt_macro.c
        monetdb5/optimizer/opt_matpack.c
        monetdb5/optimizer/opt_mergetable.c
        monetdb5/optimizer/opt_mitosis.c
        monetdb5/optimizer/opt_multiplex.c
        monetdb5/optimizer/opt_oltp.c
        monetdb5/optimizer/opt_pipes.c
        monetdb5/optimizer/opt_postfix.c
        monetdb5/optimizer/opt_profiler.c
        monetdb5/optimizer/opt_projectionpath.c
        monetdb5/optimizer/opt_pushselect.c
        monetdb5/optimizer/opt_querylog.c
        monetdb5/optimizer/opt_reduce.c
        monetdb5/optimizer/opt_remap.c
        monetdb5/optimizer/opt_remoteQueries.c
        monetdb5/optimizer/opt_reorder.c
        monetdb5/optimizer/opt_volcano.c
        monetdb5/optimizer/opt_wlc.c
        monetdb5/scheduler/run_memo.c
        monetdb5/scheduler/run_pipeline.c
Branch: tracer
Log Message:

Prepared fprintFunction and fprintInstruction for modifications


diffs (truncated from 1023 to 300 lines):

diff --git a/gdk/gdk_tracer.h b/gdk/gdk_tracer.h
--- a/gdk/gdk_tracer.h
+++ b/gdk/gdk_tracer.h
@@ -71,6 +71,9 @@ typedef enum {
                MAL_TABLET,
                MAL_OLTP,
                MAL_MANIFOLD,
+               MAL_RESOLVE,
+               MAL_FCN,
+               MAL_DATAFLOW,
 
                // GDK
                GDK_ALL,
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
@@ -666,7 +666,7 @@ DFLOWinitBlk(DataFlow flow, MalBlkPtr mb
        PARDEBUG {
                for (n = 0; n < flow->stop - flow->start; n++) {
                        fprintf(stderr, "#[%d] %d: ", flow->start + n, n);
-                       fprintInstruction(stderr, mb, 0, getInstrPtr(mb, n + 
flow->start), LIST_MAL_ALL);
+                       // fprintInstruction(MAL_DATAFLOW, mb, 0, 
getInstrPtr(mb, n + flow->start), LIST_MAL_ALL);
                        fprintf(stderr, "#[%d]Dependents block count %d 
wakeup", flow->start + n, flow->status[n].blocks);
                        for (j = n; flow->edges[j]; j = flow->edges[j]) {
                                fprintf(stderr, "%d ", flow->start + 
flow->nodes[j]);
@@ -701,7 +701,7 @@ static void showFlowEvent(DataFlow flow,
        for (i = 0; i < flow->stop - flow->start; i++)
                if (fe[i].state != DFLOWwrapup && fe[i].pc >= 0) {
                        fprintf(stderr, "#missed pc %d status %d %d  blocks 
%d", fe[i].state, i, fe[i].pc, fe[i].blocks);
-                       fprintInstruction(stderr, fe[i].flow->mb, 0, 
getInstrPtr(fe[i].flow->mb, fe[i].pc), LIST_MAL_MAPI);
+                       fprintInstruction(MAL_DATAFLOW, fe[i].flow->mb, 0, 
getInstrPtr(fe[i].flow->mb, fe[i].pc), LIST_MAL_MAPI);
                }
 }
 */
@@ -813,7 +813,7 @@ runMALdataflow(Client cntxt, MalBlkPtr m
 
 #ifdef DEBUG_FLOW
        fprintf(stderr, "#runMALdataflow for block %d - %d\n", startpc, stoppc);
-       fprintFunction(stderr, mb, 0, LIST_ALL);
+       // fprintFunction(MAL_DATAFLOW, mb, 0, LIST_ALL);
 #endif
 
        /* in debugging mode we should not start multiple threads */
diff --git a/monetdb5/mal/mal_function.c b/monetdb5/mal/mal_function.c
--- a/monetdb5/mal/mal_function.c
+++ b/monetdb5/mal/mal_function.c
@@ -218,7 +218,7 @@ void chkFlow(MalBlkPtr mb)
                mb->errors = createMalException( mb,lastInstruction,SYNTAX,
                        "instructions after END");
 #ifdef DEBUG_MAL_FCN
-               fprintFunction(stderr, mb, 0, LIST_MAL_ALL);
+               //fprintFunction(MAL_FCN, mb, 0, LIST_MAL_ALL);
 #endif
        }
        if( endseen)
@@ -278,7 +278,7 @@ static void replaceTypeVar(MalBlkPtr mb,
        for(j=0; j<mb->stop; j++){
            p= getInstrPtr(mb,j);
 #ifdef DEBUG_MAL_FCN
-               fprintInstruction(stderr,mb,0,p,LIST_MAL_ALL);
+               // fprintInstruction(MAL_FCN, mb, 0, p, LIST_MAL_ALL);
 #endif
        if( p->polymorphic)
        for(i=0;i<p->argc; i++)
@@ -321,7 +321,7 @@ static void replaceTypeVar(MalBlkPtr mb,
 #endif
        }
 #ifdef DEBUG_MAL_FCN
-               fprintInstruction(stderr,mb,0,p,LIST_MAL_ALL);
+               // fprintInstruction(MAL_FCN, mb, 0, p, LIST_MAL_ALL);
 #endif
        }
 }
@@ -379,7 +379,7 @@ cloneFunction(Module scope, Symbol proc,
 #ifdef DEBUG_CLONE
        fprintf(stderr,"clone the function %s to scope %s\n",
                                 proc->name,scope->name);
-       fprintInstruction(stderr,mb,0,p,LIST_MAL_ALL);
+       // fprintInstruction(MAL_FCN, mb, 0, p, LIST_MAL_ALL);
 #endif
        new = newFunction(scope->name, proc->name, getSignature(proc)->token);
        if( new == NULL){
@@ -395,7 +395,7 @@ cloneFunction(Module scope, Symbol proc,
        /* now change the definition of the original proc */
 #ifdef DEBUG_CLONE
        fprintf(stderr, "CLONED VERSION\n");
-       fprintFunction(stderr, new->def, 0, LIST_MAL_ALL);
+       //fprintFunction(MAL_FCN, new->def, 0, LIST_MAL_ALL);
 #endif
        /* check for errors after fixation , TODO*/
        pp = getSignature(new);
@@ -432,7 +432,7 @@ cloneFunction(Module scope, Symbol proc,
 
 #ifdef DEBUG_MAL_FCN
        fprintf(stderr, "FUNCTION TO BE CHECKED\n");
-       fprintFunction(stderr, new->def, 0, LIST_MAL_ALL);
+       //fprintFunction(MAL_FCN, new->def, 0, LIST_MAL_ALL);
 #endif
 
        /* check for errors after fixation , TODO*/
@@ -445,14 +445,14 @@ cloneFunction(Module scope, Symbol proc,
                        mb->errors = createMalException(mb,0,TYPE,"Error in 
cloned function");
                        new->def->errors = 0;
 #ifdef DEBUG_MAL_FCN
-                       fprintFunction(stderr, new->def, 0, LIST_MAL_ALL);
+                       // fprintFunction(MAL_FCN, new->def, 0, LIST_MAL_ALL);
 #endif
                }
        }
 #ifdef DEBUG_CLONE
        fprintf(stderr, "newly cloned function added to %s %d \n",
                                 scope->name, i);
-       fprintFunction(stderr, new->def, 0, LIST_MAL_ALL);
+       // fprintFunction(MAL_FCN, new->def, 0, LIST_MAL_ALL);
 #endif
        return new;
 }
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
@@ -393,7 +393,7 @@ callMAL(Client cntxt, MalBlkPtr mb, MalS
        DEBUG(MAL_INTERPRETER, "Enter callMAL\n");
        /* CHECK */
        // Remove from comments
-       // fprintInstruction(mb, 0, pci, LIST_MAL_ALL);
+       // fprintInstruction(MAL_INTERPRETER, mb, 0, pci, LIST_MAL_ALL);
 
        switch (pci->token) {
        case FUNCTIONsymbol:
diff --git a/monetdb5/mal/mal_resolve.c b/monetdb5/mal/mal_resolve.c
--- a/monetdb5/mal/mal_resolve.c
+++ b/monetdb5/mal/mal_resolve.c
@@ -184,9 +184,9 @@ findFunctionType(Module scope, MalBlkPtr
 #ifdef DEBUG_MAL_RESOLVE
                if (sig->polymorphic || sig->retc == p->retc) {
                        fprintf(stderr, "#resolving: ");
-                       fprintInstruction(stderr, mb, 0, p, LIST_MAL_ALL);
+                       // fprintInstruction(MAL_RESOLVE, mb, 0, p, 
LIST_MAL_ALL);
                        fprintf(stderr, "#against:");
-                       fprintInstruction(stderr, s->def, 0, getSignature(s), 
LIST_MAL_ALL);
+                       // fprintInstruction(MAL_RESOLVE, s->def, 0, 
getSignature(s), LIST_MAL_ALL);
                }
 #endif
                        for (k = 0; k < limit; k++)
@@ -274,9 +274,9 @@ findFunctionType(Module scope, MalBlkPtr
 #ifdef DEBUG_MAL_RESOLVE
                if (sig->polymorphic || sig->retc == p->retc) {
                        fprintf(stderr, "#resolving: ");
-                       fprintInstruction(stderr, mb, 0, p, LIST_MAL_ALL);
+                       // fprintInstruction(MAL_RESOLVE, mb, 0, p, 
LIST_MAL_ALL);
                        fprintf(stderr, "#against:");
-                       fprintInstruction(stderr, s->def, 0, getSignature(s), 
LIST_MAL_ALL);
+                       // fprintInstruction(MAL_RESOLVE, s->def, 0, 
getSignature(s), LIST_MAL_ALL);
                }
 #endif
                        for (i = p->retc; i < p->argc; i++) {
@@ -322,9 +322,9 @@ findFunctionType(Module scope, MalBlkPtr
                                fprintf(stderr,"\n");
                        }
                        fprintf(stderr, "#resolving:");
-                       fprintInstruction(stderr, mb, 0, p, LIST_MAL_ALL);
+                       // fprintInstruction(MAL_RESOLVE, mb, 0, p, 
LIST_MAL_ALL);
                        fprintf(stderr, "#against :");
-                       fprintInstruction(stderr, s->def, 0, getSignature(s), 
LIST_MAL_ALL);
+                       // fprintInstruction(MAL_RESOLVE, s->def, 0, 
getSignature(s), LIST_MAL_ALL);
                        tpe = getTypeName(getArgType(mb, p, unmatched));
                        tpe2 = getTypeName(getArgType(s->def, sig, unmatched));
                        if( unmatched)
@@ -400,7 +400,7 @@ findFunctionType(Module scope, MalBlkPtr
                 */
 #ifdef DEBUG_MAL_RESOLVE
                fprintf(stderr,"#TYPE RESOLVED:");
-               fprintInstruction(stderr, mb, 0, p, LIST_MAL_DEBUG);
+               // fprintInstruction(MAL_RESOLVE, mb, 0, p, LIST_MAL_DEBUG);
 #endif
                p->typechk = TYPE_RESOLVED;
                for (i = 0; i < p->retc; i++) {
@@ -480,7 +480,7 @@ findFunctionType(Module scope, MalBlkPtr
 #ifdef DEBUG_MAL_RESOLVE
                {
                        fprintf(stderr, "#Wrapup matching returntype %d returns 
%d:",*returntype,*returns);
-                       fprintInstruction(stderr, mb, 0, p, LIST_MAL_ALL);
+                       // fprintInstruction(MAL_RESOLVE, mb, 0, p, 
LIST_MAL_ALL);
                }
 #endif
        if (returntype != returns)
diff --git a/monetdb5/optimizer/opt_aliases.c b/monetdb5/optimizer/opt_aliases.c
--- a/monetdb5/optimizer/opt_aliases.c
+++ b/monetdb5/optimizer/opt_aliases.c
@@ -86,7 +86,7 @@ OPTaliasesImplementation(Client cntxt, M
 
        if( OPTdebug &  OPTaliases){
                fprintf(stderr, "#ALIASES optimizer  result\n");
-               fprintFunction(stderr, mb, 0,  LIST_MAL_ALL);
+               // fprintFunction(OPT_ALIASES, mb, 0, LIST_MAL_ALL);
        }
        return MAL_SUCCEED;
 }
diff --git a/monetdb5/optimizer/opt_candidates.c 
b/monetdb5/optimizer/opt_candidates.c
--- a/monetdb5/optimizer/opt_candidates.c
+++ b/monetdb5/optimizer/opt_candidates.c
@@ -91,7 +91,7 @@ OPTcandidatesImplementation(Client cntxt
        addtoMalBlkHistory(mb);
        if( OPTdebug &  OPTaliases){
                fprintf(stderr, "#CANDIDATES optimizer exit\n");
-               fprintFunction(stderr, mb, 0,  LIST_MAL_ALL);
+               // fprintFunction(OPT_CANDIDATES, mb, 0, LIST_MAL_ALL);
        }
        return MAL_SUCCEED;
 }
diff --git a/monetdb5/optimizer/opt_coercion.c 
b/monetdb5/optimizer/opt_coercion.c
--- a/monetdb5/optimizer/opt_coercion.c
+++ b/monetdb5/optimizer/opt_coercion.c
@@ -49,7 +49,7 @@ coercionOptimizerCalcStep(Client cntxt, 
        {
                if( OPTdebug &  OPTaliases){
                        fprintf(stderr,"#remove upcast on first argument %d\n", 
varid);
-                       fprintInstruction(stderr, mb, 0, p, LIST_MAL_ALL);
+                       // fprintInstruction(OPT_COERCION, mb, 0, p, 
LIST_MAL_ALL);
                }
                getArg(p,1) = coerce[varid].src;
                if ( chkInstruction(cntxt->usermodule, mb, p) || p->typechk == 
TYPE_UNKNOWN)
@@ -60,7 +60,7 @@ coercionOptimizerCalcStep(Client cntxt, 
        {
                if( OPTdebug &  OPTaliases){
                        fprintf(stderr,"#remove upcast on second argument 
%d\n", varid);
-                       fprintInstruction(stderr, mb, 0, p, LIST_MAL_ALL);
+                       // fprintInstruction(OPT_COERCION, mb, 0, p, 
LIST_MAL_ALL);
                }
                getArg(p,2) = coerce[varid].src;
                if ( chkInstruction(cntxt->usermodule, mb, p) || p->typechk == 
TYPE_UNKNOWN)
@@ -68,7 +68,7 @@ coercionOptimizerCalcStep(Client cntxt, 
        }
                if( OPTdebug &  OPTaliases){
                        fprintf(stderr,"#final instruction\n");
-                       fprintInstruction(stderr, mb, 0, p, LIST_MAL_ALL);
+                       // fprintInstruction(OPT_COERCION, mb, 0, p, 
LIST_MAL_ALL);
                }
        return;
 }
@@ -187,7 +187,7 @@ OPTcoercionImplementation(Client cntxt,M
 
     if( OPTdebug &  OPTcoercion){
         fprintf(stderr, "#COERCION optimizer entry\n");
-        fprintFunction(stderr, mb, 0,  LIST_MAL_ALL);
+        // fprintFunction(OPT_COERCION, mb, 0, LIST_MAL_ALL);
     }
        return msg;
 }
diff --git a/monetdb5/optimizer/opt_commonTerms.c 
b/monetdb5/optimizer/opt_commonTerms.c
--- a/monetdb5/optimizer/opt_commonTerms.c
+++ b/monetdb5/optimizer/opt_commonTerms.c
@@ -114,7 +114,7 @@ OPTcommonTermsImplementation(Client cntx
                if( OPTdebug & OPTcommonterms){
                        fprintf(stderr,"#CANDIDATE[%d] look at list[%d]=>%d\n",
                                i, HASHinstruction(p), 
hash[HASHinstruction(p)]);
-                       fprintInstruction(stderr, mb, 0, p, LIST_MAL_ALL);
+                       // fprintInstruction(OPT_COMMONTERMS, mb, 0, p, 
LIST_MAL_ALL);
                }
 
                /* Look into the hash structure for matching instructions */
@@ -132,7 +132,7 @@ OPTcommonTermsImplementation(Client cntx
                                                !isUnsafeFunction(q),
                                                !isUpdateInstruction(q),
                                                isLinearFlow(q));
-                                       fprintInstruction(stderr, mb, 0, q, 
LIST_MAL_ALL);
+                                       //fprintInstruction(OPT_COMMONTERMS, 
mb, 0, q, LIST_MAL_ALL);
                                }
 
                                /*
@@ -165,7 +165,7 @@ OPTcommonTermsImplementation(Client cntx
 
                                        if( OPTdebug & OPTcommonterms){
                                                fprintf(stderr, "#MODIFIED 
EXPRESSION %d -> %d ",getArg(p,0),getArg(p,1));
-                                               fprintInstruction(stderr, mb, 
0, p, LIST_MAL_ALL);
+                                               
//fprintInstruction(OPT_COMMONTERMS, mb, 0, p, LIST_MAL_ALL);
                                        }
 
                                        actions++;
@@ -175,7 +175,7 @@ OPTcommonTermsImplementation(Client cntx
 
                        else if( OPTdebug & OPTcommonterms && 
isUpdateInstruction(p)){
                                fprintf(stderr, "#COMMON SKIPPED %d %d ", 
mayhaveSideEffects(cntxt, mb, q, TRUE) , isUpdateInstruction(p));
-                               fprintInstruction(stderr, mb, 0, q, 
LIST_MAL_ALL);
+                               //fprintInstruction(OPT_COMMONTERMS, mb, 0, q, 
LIST_MAL_ALL);
                        }
 
                if (duplicate){
@@ -187,7 +187,7 @@ OPTcommonTermsImplementation(Client cntx
                if( OPTdebug & OPTcommonterms){
                        fprintf(stderr,"#UPDATE HASH[%d] look at  arg %d hash 
%d list %d\n",
                                i, getArg(p,p->argc-1), HASHinstruction(p), 
hash[HASHinstruction(p)]);
-                       fprintInstruction(stderr, mb, 0, p, LIST_MAL_ALL);
+                       //fprintInstruction(OPT_COMMONTERMS, mb, 0, p, 
LIST_MAL_ALL);
                }
 
                if ( !mayhaveSideEffects(cntxt, mb, p, TRUE) && p->argc != 
p->retc &&  isLinearFlow(p) && !isUnsafeFunction(p) && !isUpdateInstruction(p)){
@@ -219,7 +219,7 @@ OPTcommonTermsImplementation(Client cntx
        if(old) GDKfree(old);
     if( OPTdebug &  OPTcommonterms){
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to