Changeset: 6cd6b1591c27 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6cd6b1591c27
Modified Files:
gdk/gdk_tracer.h
monetdb5/mal/mal_runtime.c
Branch: Dec2025
Log Message:
Implemented MAL_INSTRUCTION tracer output to print MAL instruxtion info.
diffs (67 lines):
diff --git a/gdk/gdk_tracer.h b/gdk/gdk_tracer.h
--- a/gdk/gdk_tracer.h
+++ b/gdk/gdk_tracer.h
@@ -120,6 +120,7 @@ typedef enum {
COMP( MAL_MAPI ) \
COMP( MAL_SERVER ) \
COMP( MAL_LOADER ) \
+ COMP( MAL_INSTRUCTION ) \
\
COMP( MAL_OPTIMIZER ) \
\
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
@@ -355,6 +355,18 @@ runtimeProfileBegin(Client cntxt, MalBlk
assert(pci);
/* always collect the MAL instruction execution time */
+ TRC_DEBUG_IF(MAL_INSTRUCTION) {
+ switch (pci->token) {
+ case PATcall:
+ case CMDcall:
+ case FCNcall:
+ TRC_DEBUG_ENDIF(MAL_INSTRUCTION, "calling
%s.%s",
+ pci->modname ?
pci->modname : "???",
+ pci->fcnname ?
pci->fcnname : "???");
+ default:
+ break;
+ }
+ }
prof->ticks = GDKusec();
}
@@ -365,6 +377,33 @@ runtimeProfileExit(Client cntxt, MalBlkP
{
lng ticks = GDKusec();
+ TRC_DEBUG_IF(MAL_INSTRUCTION) {
+ TRC_DEBUG_ENDIF(MAL_INSTRUCTION, "%s ("LLFMT" usec)",
+ instruction2str(mb, stk, pci,
LIST_MAL_ALL | LIST_MAL_ALGO),
+ ticks - prof->ticks);
+ } else {
+ TRC_INFO_IF(MAL_INSTRUCTION) {
+ switch (pci->token) {
+ case ASSIGNsymbol:
+ TRC_INFO_ENDIF(MAL_INSTRUCTION, "%sassignment
("LLFMT" usec)",
+ pci->retc > 1 ?
"multi-" : "",
+ ticks - prof->ticks);
+ break;
+ case PATcall:
+ case CMDcall:
+ case FCNcall:
+ TRC_INFO_ENDIF(MAL_INSTRUCTION, "call %s.%s
("LLFMT" usec)",
+ pci->modname ?
pci->modname : "???",
+ pci->fcnname ?
pci->fcnname : "???",
+ ticks - prof->ticks);
+ break;
+ case REMsymbol:
+ case ENDsymbol:
+ default:
+ break;
+ }
+ }
+ }
if (cntxt->sqlprofiler)
sqlProfilerEvent(cntxt, mb, stk, pci, ticks, ticks -
prof->ticks);
}
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]