Changeset: 9113cf783628 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9113cf783628
Modified Files:
clients/Tests/MAL-signatures.stable.out.int128
monetdb5/mal/mal_debugger.c
monetdb5/mal/mal_exception.c
monetdb5/mal/mal_factory.c
monetdb5/mal/mal_instruction.c
monetdb5/mal/mal_interpreter.c
monetdb5/mal/mal_module.c
monetdb5/mal/mal_parser.c
monetdb5/mal/mal_resolve.c
monetdb5/mal/mal_resource.c
monetdb5/mal/mal_session.c
monetdb5/modules/mal/mdb.c
Branch: gdk_tracer
Log Message:
A sweep over the trace calls in mserver5/mal
diffs (truncated from 521 to 300 lines):
diff --git a/clients/Tests/MAL-signatures.stable.out.int128
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -15644,6 +15644,16 @@ stdout of test 'MAL-signatures` in direc
[ "lidar", "attach", "pattern lidar.attach(fname:str):void ",
"LIDARattach;", "Open a LIDAR file and return catalog of the table HDUs"
]
[ "lidar", "export", "pattern lidar.export(tablename:str, fname:str,
type:str):void ", "LIDARexportTable;", "Exporta LIDAR table to a
LAS/LAZ file" ]
[ "lidar", "load", "pattern lidar.load(tablename:str):void ",
"LIDARloadTable;", "Load a LIDAR table from an attached file" ]
+[ "logging", "flush", "command logging.flush():void ",
"TRACERflush_buffer;", "Flush the buffer" ]
+[ "logging", "log", "command logging.log():void ", "TRACERlog;", "Create
a log message" ]
+[ "logging", "resetadapter", "command logging.resetadapter():void ",
"TRACERreset_adapter;", "Reset the adapter" ]
+[ "logging", "resetcomplevel", "command
logging.resetcomplevel(comp:int):void ", "TRACERreset_component_level;",
"Reset the log level for a specific component" ]
+[ "logging", "resetflushlevel", "command logging.resetflushlevel():void
", "TRACERreset_flush_level;", "Reset the flush level" ]
+[ "logging", "resetlayerlevel", "command
logging.resetlayerlevel(layer:int):void ", "TRACERreset_layer_level;",
"Reset the log level for a specific layer" ]
+[ "logging", "setadapter", "command logging.setadapter(adapter:int):void
", "TRACERset_adapter;", "Set the adapter" ]
+[ "logging", "setcomplevel", "command logging.setcomplevel(comp:int,
lvl:int):void ", "TRACERset_component_level;", "Set the log level for
a specific component" ]
+[ "logging", "setflushlevel", "command
logging.setflushlevel(lvl:int):void ", "TRACERset_flush_level;", "Set the
flush level" ]
+[ "logging", "setlayerlevel", "command
logging.setlayerlevel(layer:int, lvl:int):void ",
"TRACERset_layer_level;", "Set the log level for a specific layer"
]
[ "mal", "manifold", "pattern mal.manifold(mod:str, fcn:str,
a:any...):bat[:any] ", "MANIFOLDevaluate;", "" ]
[ "mal", "multiplex", "pattern mal.multiplex(mod:str, fcn:str,
a:any...):any... ", "MANIFOLDremapMultiplex;", "" ]
[ "manual", "functions", "pattern manual.functions() (mod:bat[:str],
fcn:bat[:str], sig:bat[:str], adr:bat[:str], com:bat[:str]) ",
"MANUALcreateOverview;", "Produces a table with all MAL functions known"
]
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
@@ -292,11 +292,7 @@ mdbInit(void)
* space in each instruction.
*/
mdbTable = GDKzalloc(sizeof(mdbStateRecord) * MAL_MAXCLIENTS);
- if (mdbTable == NULL) {
- TRC_CRITICAL(MAL_DEBUGGER, "Initialization failed: "
MAL_MALLOC_FAIL "\n");
- return false;
- }
- return true;
+ return mdbTable != NULL;
}
void
diff --git a/monetdb5/mal/mal_exception.c b/monetdb5/mal/mal_exception.c
--- a/monetdb5/mal/mal_exception.c
+++ b/monetdb5/mal/mal_exception.c
@@ -68,7 +68,7 @@ createExceptionInternal(enum malexceptio
/* Leave a message behind in the logging system */
len = snprintf(local, GDKMAXERRLEN, "%s:%s:",
exceptionNames[type], fcn);
len = vsnprintf(local + len, GDKMAXERRLEN, format, ap);
- TRC_CRITICAL(MAL_EXCEPTION, "%s\n", local);
+ TRC_ERROR(MAL_EXCEPTION, "%s\n", local);
return M5OutOfMemory; /* last resort */
}
len = snprintf(message, GDKMAXERRLEN, "%s:%s:", exceptionNames[type],
fcn);
diff --git a/monetdb5/mal/mal_factory.c b/monetdb5/mal/mal_factory.c
--- a/monetdb5/mal/mal_factory.c
+++ b/monetdb5/mal/mal_factory.c
@@ -62,7 +62,6 @@ runFactory(Client cntxt, MalBlkPtr mb, M
char cmd;
str msg;
- TRC_DEBUG(MAL_FACTORY, "Enter runFactory\n");
/* the lookup can be largely avoided by handing out the index
upon factory definition. todo
@@ -274,7 +273,6 @@ yieldResult(MalBlkPtr mb, InstrPtr p, in
if( pl->env == NULL)
return(int) (pl-plants);
for (i = 0; i < p->retc; i++) {
- TRC_DEBUG(MAL_FACTORY, "lhs %d rhs %d\n",
getArg(pl->pci, i), getArg(p, i));
rhs = &pl->stk->stk[getArg(p, i)];
lhs = &pl->env->stk[getArg(pl->pci, i)];
if (VALcopy(lhs, rhs) == NULL)
diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c
--- a/monetdb5/mal/mal_instruction.c
+++ b/monetdb5/mal/mal_instruction.c
@@ -903,8 +903,6 @@ trimMalVariables_(MalBlkPtr mb, MalStkPt
/* build the alias table */
for (i = 0; i < mb->vtop; i++) {
- TRC_DEBUG(MAL_REDUCE, "Used: %s %d\n", getVarName(mb,i),
isVarUsed(mb,i));
-
if ( isVarUsed(mb,i) == 0) {
if (glb && isVarConstant(mb, i))
VALclear(&glb->stk[i]);
@@ -928,18 +926,11 @@ trimMalVariables_(MalBlkPtr mb, MalStkPt
cnt++;
}
- /* CHECK */
- // The 1st DEBUG message and the for loop are both in DEBUG MAL_REDUCE
- TRC_DEBUG(MAL_REDUCE, "Variable reduction %d -> %d\n", mb->vtop, cnt);
- for (i = 0; i < mb->vtop; i++)
- TRC_DEBUG(MAL_REDUCE, "map %d -> %d\n", i, alias[i]);
-
/* remap all variable references to their new position. */
if (cnt < mb->vtop) {
for (i = 0; i < mb->stop; i++) {
q = getInstrPtr(mb, i);
for (j = 0; j < q->argc; j++){
- TRC_DEBUG(MAL_REDUCE, "map %d -> %d\n",
getArg(q,j), alias[getArg(q,j)]);
getArg(q, j) = alias[getArg(q, j)];
}
}
@@ -950,9 +941,6 @@ trimMalVariables_(MalBlkPtr mb, MalStkPt
if( isTmpVar(mb,i))
(void) snprintf(mb->var[i].id, IDLENGTH,"%c%c%d", REFMARKER,
TMPMARKER,mb->vid++);
- TRC_DEBUG(MAL_REDUCE, "After reduction\n");
- debugFunction(MAL_REDUCE, mb, 0, 0);
-
GDKfree(alias);
mb->vtop = cnt;
}
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
@@ -390,8 +390,6 @@ callMAL(Client cntxt, MalBlkPtr mb, MalS
InstrPtr pci = getInstrPtr(mb, 0);
cntxt->lastcmd= time(0);
- TRC_DEBUG(MAL_INTERPRETER, "Enter callMAL\n");
- debugInstruction(MAL_INTERPRETER, mb, 0, pci, LIST_MAL_ALL);
switch (pci->token) {
case FUNCTIONsymbol:
@@ -867,7 +865,6 @@ str runMALsequence(Client cntxt, MalBlkP
bat bid = stk->stk[a].val.bval;
if (garbage[i] >= 0) {
- TRC_DEBUG(PAR, "GC
pc=%d bid=%d %s done\n", stkpc, bid, getVarName(mb, garbage[i]));
bid =
stk->stk[garbage[i]].val.bval;
stk->stk[garbage[i]].val.bval = bat_nil;
BBPrelease(bid);
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
@@ -70,7 +70,6 @@ mal_module_reset(void)
int i;
Module m;
- TRC_DEBUG(MAL_MODULE, "Reset the global module structure\n");
for(i = 0; i < MODULE_HASH_SIZE; i++) {
m= moduleIndex[i];
moduleIndex[i] = 0;
@@ -160,7 +159,6 @@ Module globalModule(str nme)
// Global modules are not named 'user'
assert (strcmp(nme, "user"));
- TRC_DEBUG(MAL_MODULE, "Create new global module: %s\n", nme);
nme = putName(nme);
cur = (Module) GDKzalloc(sizeof(ModuleRecord));
@@ -219,7 +217,6 @@ static void freeSubScope(Module scope)
if (scope->space == NULL)
return;
- TRC_DEBUG(MAL_MODULE, "Free sub scope: %s\n", scope->name);
for(i = 0; i < MAXSCOPE; i++) {
if( scope->space[i]){
@@ -248,7 +245,6 @@ void freeModule(Module m)
(void)ret;
}
}
- TRC_DEBUG(MAL_MODULE, "Free module: %s\n", m->name);
freeSubScope(m);
if (strcmp(m->name, "user")) {
@@ -272,7 +268,6 @@ void insertSymbol(Module scope, Symbol p
assert(scope);
sig = getSignature(prg);
- TRC_DEBUG(MAL_MODULE, "Insert sumbol: %s.%s in %s\n", getModuleId(sig),
getFunctionId(sig), scope->name);
if(getModuleId(sig) && getModuleId(sig)!= scope->name){
/* move the definition to the proper place */
@@ -280,7 +275,6 @@ void insertSymbol(Module scope, Symbol p
c= findModule(scope,getModuleId(sig));
if ( c )
scope = c;
- TRC_DEBUG(MAL_MODULE, "Found alternative module: %s\n",
scope->name);
}
t = getSymbolIndex(getFunctionId(sig));
if( scope->space == NULL) {
@@ -291,7 +285,6 @@ void insertSymbol(Module scope, Symbol p
assert(scope->space);
if (scope->space[t] == prg){
/* already known, last inserted */
- TRC_DEBUG(MAL_MODULE, "Unexpected double insert\n");
} else {
prg->peer= scope->space[t];
scope->space[t] = prg;
@@ -315,7 +308,6 @@ void deleteSymbol(Module scope, Symbol p
int t;
sig = getSignature(prg);
- TRC_DEBUG(MAL_MODULE, "Delete symbol '%s.%s' from '%s'\n",
getModuleId(sig), getFunctionId(sig), prg->name);
if (getModuleId(sig) && getModuleId(sig)!= scope->name ){
/* move the definition to the proper place */
@@ -354,7 +346,6 @@ Module findModule(Module scope, str name
Module def = scope;
Module m;
if (name == NULL) return scope;
- TRC_DEBUG(MAL_MODULE, "Locate module '%s' in scope '%s'\n", name,
scope->name);
m = getModule(name);
if (m) return m;
@@ -377,7 +368,6 @@ Module findModule(Module scope, str name
Symbol findSymbolInModule(Module v, str fcn) {
Symbol s;
if (v == NULL || fcn == NULL) return NULL;
- TRC_DEBUG(MAL_MODULE, "Find symbol '%s' in '%s'\n", fcn, v->name);
s = v->space[(int)(*fcn)];
while (s != NULL) {
if (idcmp(s->name,fcn)==0) return s;
diff --git a/monetdb5/mal/mal_parser.c b/monetdb5/mal/mal_parser.c
--- a/monetdb5/mal/mal_parser.c
+++ b/monetdb5/mal/mal_parser.c
@@ -991,7 +991,6 @@ parseModule(Client cntxt)
// ignore this module definition
} else
if( getModule(modnme) == NULL){
- TRC_DEBUG(MAL_PARSER, "Module create %s\n", modnme);
if( globalModule(modnme) == NULL)
parseError(cntxt,"<module> could not be created");
}
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
@@ -112,7 +112,6 @@ findFunctionType(Module scope, MalBlkPtr
* Simplify polytype using a map into the concrete argument table.
*/
- TRC_DEBUG(MAL_RESOLVE, "Find function type: %s.%s\n", getModuleId(p),
getFunctionId(p));
m = scope;
s = m->space[(int) (getSymbolIndex(getFunctionId(p)))];
if (s == 0)
@@ -179,15 +178,6 @@ findFunctionType(Module scope, MalBlkPtr
continue;
}
- /* CHECK */
- // If is in DEBUG MAL_RESOLVE
- if (sig->polymorphic || sig->retc == p->retc) {
- TRC_DEBUG(MAL_RESOLVE, "Resolving\n");
- debugInstruction(MAL_RESOLVE, mb, 0, p,
LIST_MAL_ALL);
- TRC_DEBUG(MAL_RESOLVE, "Against\n");
- debugInstruction(MAL_RESOLVE, s->def, 0,
getSignature(s), LIST_MAL_ALL);
- }
-
for (k = 0; k < limit; k++)
polytype[k] = TYPE_any;
/*
@@ -271,14 +261,6 @@ findFunctionType(Module scope, MalBlkPtr
continue;
}
- /* CHECK */
- // If is in DEBUG MAL_RESOLVE
- if (sig->polymorphic || sig->retc == p->retc) {
- TRC_DEBUG(MAL_RESOLVE, "Resolving\n");
- debugInstruction(MAL_RESOLVE, mb, 0, p,
LIST_MAL_ALL);
- TRC_DEBUG(MAL_RESOLVE, "Against\n");
- debugInstruction(MAL_RESOLVE, s->def, 0,
getSignature(s), LIST_MAL_ALL);
- }
for (i = p->retc; i < p->argc; i++) {
int actual = getArgType(mb, p, i);
@@ -298,7 +280,6 @@ findFunctionType(Module scope, MalBlkPtr
// GDKfree(ftpe);
// GDKfree(atpe);
// #endif
- TRC_DEBUG(MAL_RESOLVE, "Unmatched '%d'
(formal: %s - actual: %s)\n", i, getTypeName(formal), getTypeName(actual));
unmatched = i;
break;
}
@@ -312,33 +293,6 @@ findFunctionType(Module scope, MalBlkPtr
* An optimizer may at a later stage automatically insert such
* coercion requests.
*/
- /* CHECK */
- // From here
- TRC_DEBUG(MAL_RESOLVE,
- "Finished %s.%s unmatched=%d polymorphic=%d %d\n",
- getModuleId(sig), getFunctionId(sig), unmatched,
- sig->polymorphic, p == sig);
-
- if (sig->polymorphic) {
- int l;
- for (l = 0; l < 2 * p->argc; l++)
- if (polytype[l] != TYPE_any) {
- TRC_DEBUG(MAL_RESOLVE, "Polymorphic: %d
%s\n", l, getTypeName(polytype[l]));
- }
- }
-
- TRC_DEBUG(MAL_RESOLVE, "Resolving\n");
- debugInstruction(MAL_RESOLVE, mb, 0, p, LIST_MAL_ALL);
- TRC_DEBUG(MAL_RESOLVE, "Against\n");
- debugInstruction(MAL_RESOLVE, s->def, 0, getSignature(s),
LIST_MAL_ALL);
-
- if(unmatched)
- TRC_DEBUG(MAL_RESOLVE,
- "Unmatched '%d' (test: %s - polymorphic: %s)\n",
- unmatched,
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list