Changeset: 2fd92ee233b0 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2fd92ee233b0 Modified Files: monetdb5/mal/mal_dataflow.c monetdb5/mal/mal_interpreter.h monetdb5/mal/mal_listing.c monetdb5/mal/mal_module.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_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 Branch: default Log Message:
Cleanup of (very) old debugging code. Debugging the optimizers can be doen with the DEBUG sqlstmt, whereafter the results are available in the mal block history. diffs (truncated from 1405 to 300 lines): 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 @@ -798,11 +798,6 @@ runMALdataflow(Client cntxt, MalBlkPtr m bit *ret; int i; -#ifdef DEBUG_FLOW - fprintf(stderr, "#runMALdataflow for block %d - %d\n", startpc, stoppc); - fprintFunction(stderr, mb, 0, LIST_ALL); -#endif - /* in debugging mode we should not start multiple threads */ if (stk == NULL) throw(MAL, "dataflow", "runMALdataflow(): Called with stk == NULL"); diff --git a/monetdb5/mal/mal_interpreter.h b/monetdb5/mal/mal_interpreter.h --- a/monetdb5/mal/mal_interpreter.h +++ b/monetdb5/mal/mal_interpreter.h @@ -23,8 +23,6 @@ * to be passed by a handle. */ -/* #define DEBUG_FLOW */ - mal_export MalStkPtr prepareMALstack(MalBlkPtr mb, int size); mal_export str runMAL(Client c, MalBlkPtr mb, MalBlkPtr mbcaller, MalStkPtr env); mal_export str runMALsequence(Client cntxt, MalBlkPtr mb, int startpc, int stoppc, MalStkPtr stk, MalStkPtr env, InstrPtr pcicaller); diff --git a/monetdb5/mal/mal_listing.c b/monetdb5/mal/mal_listing.c --- a/monetdb5/mal/mal_listing.c +++ b/monetdb5/mal/mal_listing.c @@ -582,9 +582,6 @@ mal2str(MalBlkPtr mb, int first, int las txt[i] = instruction2str(mb, 0, getInstrPtr(mb, i), LIST_MAL_NAME | LIST_MAL_TYPE | LIST_MAL_PROPS); else txt[i] = instruction2str(mb, 0, getInstrPtr(mb, i), LIST_MAL_CALL | LIST_MAL_PROPS | LIST_MAL_REMOTE); -#ifdef _DEBUG_LISTING_ - fprintf(stderr,"%s\n",txt[i]); -#endif if ( txt[i]) totlen += len[i] = strlen(txt[i]); diff --git a/monetdb5/mal/mal_module.c b/monetdb5/mal/mal_module.c --- a/monetdb5/mal/mal_module.c +++ b/monetdb5/mal/mal_module.c @@ -29,7 +29,6 @@ * * All modules are persistent during a server session */ -/* #define _DEBUG_MODULE_*/ #define MODULE_HASH_SIZE 1024 Module moduleIndex[MODULE_HASH_SIZE] = { NULL }; @@ -71,9 +70,6 @@ mal_module_reset(void) int i; Module m; -#ifdef _DEBUG_MODULE_ - fprintf(stderr,"#et the globale module structure \n"); -#endif for(i = 0; i < MODULE_HASH_SIZE; i++) { m= moduleIndex[i]; moduleIndex[i] = 0; @@ -163,9 +159,6 @@ Module globalModule(str nme) // Global modules are not named 'user' assert (strcmp(nme, "user")); -#ifdef _DEBUG_MODULE_ - fprintf(stderr,"#create new global module %s\n",nme); -#endif nme = putName(nme); cur = (Module) GDKzalloc(sizeof(ModuleRecord)); if (cur == NULL) @@ -223,9 +216,6 @@ static void freeSubScope(Module scope) if (scope->space == NULL) return; -#ifdef _DEBUG_MODULE_ - fprintf(stderr,"#freeSubScope %s \n", scope->name); -#endif for(i = 0; i < MAXSCOPE; i++) { if( scope->space[i]){ s= scope->space[i]; @@ -253,9 +243,6 @@ void freeModule(Module m) (void)ret; } } -#ifdef _DEBUG_MODULE_ - fprintf(stderr,"#freeModue %s \n", m->name); -#endif freeSubScope(m); if (strcmp(m->name, "user")) { clrModuleIndex(m); @@ -278,18 +265,12 @@ void insertSymbol(Module scope, Symbol p assert(scope); sig = getSignature(prg); -#ifdef _DEBUG_MODULE_ - fprintf(stderr,"#insertSymbol: %s.%s in %s ", getModuleId(sig), getFunctionId(sig), scope->name); -#endif if(getModuleId(sig) && getModuleId(sig)!= scope->name){ /* move the definition to the proper place */ /* default scope is the last resort */ c= findModule(scope,getModuleId(sig)); if ( c ) scope = c; -#ifdef _DEBUG_MODULE_ - fprintf(stderr," found alternative module %s ", scope->name); -#endif } t = getSymbolIndex(getFunctionId(sig)); if( scope->space == NULL) { @@ -300,9 +281,6 @@ void insertSymbol(Module scope, Symbol p assert(scope->space); if (scope->space[t] == prg){ /* already known, last inserted */ -#ifdef _DEBUG_MODULE_ - fprintf(stderr," unexpected double insert "); -#endif } else { prg->peer= scope->space[t]; scope->space[t] = prg; @@ -313,9 +291,6 @@ void insertSymbol(Module scope, Symbol p prg->skip = prg->peer; } assert(prg != prg->peer); -#ifdef _DEBUG_MODULE_ - fprintf(stderr,"\n"); -#endif } /* * Removal of elements from the symbol table should be @@ -329,9 +304,6 @@ void deleteSymbol(Module scope, Symbol p int t; sig = getSignature(prg); -#ifdef _DEBUG_MODULE_ - fprintf(stderr,"#delete symbol %s.%s from %s\n", getModuleId(sig), getFunctionId(sig), prg->name); -#endif if (getModuleId(sig) && getModuleId(sig)!= scope->name ){ /* move the definition to the proper place */ /* default scope is the last resort */ @@ -370,9 +342,6 @@ Module findModule(Module scope, str name Module m; if (name == NULL) return scope; -#ifdef _DEBUG_MODULE_ - fprintf(stderr,"Locate module %s in scope %s\n", name,scope->name); -#endif m = getModule(name); if (m) return m; @@ -395,9 +364,6 @@ Module findModule(Module scope, str name Symbol findSymbolInModule(Module v, str fcn) { Symbol s; if (v == NULL || fcn == NULL) return NULL; -#ifdef _DEBUG_MODULE_ - fprintf(stderr,"#find symbol %s in %s\n", fcn, v->name); -#endif s = v->space[(int)(*fcn)]; while (s != NULL) { if (idcmp(s->name,fcn)==0) return s; 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 @@ -81,12 +81,7 @@ OPTaliasesImplementation(Client cntxt, M usec= GDKusec() - usec; snprintf(buf,256,"%-20s actions=%2d time=" LLFMT " usec","aliases",actions,usec); newComment(mb,buf); - if( actions >= 0) + if( actions > 0) addtoMalBlkHistory(mb); - - if( OPTdebug & OPTaliases){ - fprintf(stderr, "#ALIASES optimizer result\n"); - fprintFunction(stderr, 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 @@ -89,9 +89,5 @@ OPTcandidatesImplementation(Client cntxt snprintf(buf,256,"%-20s actions= 1 time=" LLFMT " usec","candidates",usec); newComment(mb,buf); addtoMalBlkHistory(mb); - if( OPTdebug & OPTaliases){ - fprintf(stderr, "#CANDIDATES optimizer exit\n"); - fprintFunction(stderr, 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 @@ -181,13 +181,7 @@ OPTcoercionImplementation(Client cntxt,M usec = GDKusec()- usec; snprintf(buf,256,"%-20s actions=%2d time=" LLFMT " usec","coercion",actions, usec); newComment(mb,buf); - if( actions >= 0) + if( actions > 0) addtoMalBlkHistory(mb); - /* else we can also remove the request to apply the next alias optimizer */ - - if( OPTdebug & OPTcoercion){ - fprintf(stderr, "#COERCION optimizer entry\n"); - fprintFunction(stderr, 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 @@ -229,7 +229,7 @@ OPTcommonTermsImplementation(Client cntx usec = GDKusec()- usec; snprintf(buf,256,"%-20s actions=%2d time=" LLFMT " usec","commonTerms",actions,usec); newComment(mb,buf); - if( actions >= 0) + if( actions > 0) addtoMalBlkHistory(mb); wrapup: @@ -237,9 +237,5 @@ OPTcommonTermsImplementation(Client cntx if(list) GDKfree(list); if(hash) GDKfree(hash); if(old) GDKfree(old); - if( OPTdebug & OPTcommonterms){ - fprintf(stderr, "#COMMONTERMS optimizer exit\n"); - fprintFunction(stderr, mb, 0, LIST_MAL_ALL); - } return msg; } diff --git a/monetdb5/optimizer/opt_constants.c b/monetdb5/optimizer/opt_constants.c --- a/monetdb5/optimizer/opt_constants.c +++ b/monetdb5/optimizer/opt_constants.c @@ -36,10 +36,6 @@ OPTconstantsImplementation(Client cntxt, lng usec = GDKusec(); str msg = MAL_SUCCEED; - if( OPTdebug & OPTconstants){ - fprintf(stderr, "#CONSTANTS optimizer exit\n"); - fprintFunction(stderr, mb, 0, LIST_MAL_ALL); - } alias= (int*) GDKzalloc(sizeof(int) * mb->vtop); cst= (VarPtr*) GDKzalloc(sizeof(VarPtr) * mb->vtop); index= (int*) GDKzalloc(sizeof(int) * mb->vtop); @@ -103,16 +99,12 @@ OPTconstantsImplementation(Client cntxt, usec = GDKusec()- usec; snprintf(buf,256,"%-20s actions=%2d time=" LLFMT " usec","constants",actions,usec); newComment(mb,buf); - if (actions >= 0) + if (actions > 0) addtoMalBlkHistory(mb); wrapup: if( alias) GDKfree(alias); if( cst) GDKfree(cst); if( index) GDKfree(index); - if( OPTdebug & OPTconstants){ - fprintf(stderr, "#CONSTANTS optimizer exit\n"); - fprintFunction(stderr, mb, 0, LIST_MAL_ALL); - } return msg; } diff --git a/monetdb5/optimizer/opt_costModel.c b/monetdb5/optimizer/opt_costModel.c --- a/monetdb5/optimizer/opt_costModel.c +++ b/monetdb5/optimizer/opt_costModel.c @@ -45,10 +45,6 @@ OPTcostModelImplementation(Client cntxt, (void) stk; (void) pci; - if( OPTdebug & OPTcostmodel){ - fprintf(stderr, "#COSTMODEL optimizer exit\n"); - fprintFunction(stderr, mb, 0, LIST_MAL_ALL); - } if ( mb->inlineProp ) return MAL_SUCCEED; @@ -156,10 +152,5 @@ OPTcostModelImplementation(Client cntxt, snprintf(buf,256,"%-20s actions= 1 time=" LLFMT " usec","costmodel",usec); newComment(mb,buf); addtoMalBlkHistory(mb); - - if( OPTdebug & OPTcostmodel){ - fprintf(stderr, "#COSTMODEL optimizer exit\n"); - fprintFunction(stderr, mb, 0, LIST_MAL_ALL); - } return MAL_SUCCEED; } diff --git a/monetdb5/optimizer/opt_dataflow.c b/monetdb5/optimizer/opt_dataflow.c --- a/monetdb5/optimizer/opt_dataflow.c +++ b/monetdb5/optimizer/opt_dataflow.c @@ -97,10 +97,6 @@ dataflowBreakpoint(Client cntxt, MalBlkP if (p->token == ENDsymbol || p->barrier || isUnsafeFunction(p) || (isMultiplex(p) && MANIFOLDtypecheck(cntxt,mb,p,0) == NULL) ){ - - if( OPTdebug & OPTdataflow){ - fprintf(stderr,"#breakpoint on instruction\n"); - } return TRUE; } _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list