Changeset: 46c49376dce7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/46c49376dce7
Modified Files:
        monetdb5/mal/mal_profiler.c
        monetdb5/mal/mal_profiler.h
        monetdb5/mal/mal_runtime.c
Branch: sql_profiler
Log Message:

Remove logging of start of a MAL event.


diffs (130 lines):

diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -258,7 +258,7 @@ generic_event(str msg, struct GenericEve
  "stmt":"X_41=0@0:void := querylog.define(\"select count(*) from 
tables;\":str,\"default_pipe\":str,30:int);",
 */
 static str
-prepareProfilerEvent(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci, 
int start)
+prepareProfilerEvent(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
 {
        struct logbuf logbuf;
        str c;
@@ -272,7 +272,7 @@ prepareProfilerEvent(Client cntxt, MalBl
         * they may appear when BARRIER blocks are executed
         * The default parameter should be sufficient for most practical cases.
         */
-       if( !start && pci->calls > HIGHWATERMARK){
+       if( pci->calls > HIGHWATERMARK){
                if( pci->calls == 10000 || pci->calls == 100000 || pci->calls 
== 1000000 || pci->calls == 10000000)
                        TRC_WARNING(MAL_SERVER, "Too many calls: %d\n", 
pci->calls);
                return NULL;
@@ -285,7 +285,7 @@ prepareProfilerEvent(Client cntxt, MalBl
                return NULL;
 
        /* align the variable namings with EXPLAIN and TRACE */
-       if( pci->pc == 1 && start)
+       if(pci->pc == 1)
                renameVariables(mb);
 
        logbuf = (struct logbuf) {0};
@@ -336,8 +336,7 @@ prepareProfilerEvent(Client cntxt, MalBl
                } else
                        free(c);
        }
-       if (!logadd(&logbuf, ",\"state\":\"%s\",\"usec\":"LLFMT,
-                               start?"start":"done", pci->ticks))
+       if (!logadd(&logbuf, ",\"state\":\"done\",\"usec\":"LLFMT, pci->ticks))
                goto cleanup_and_exit;
        if (algo && !logadd(&logbuf, ",\"algorithm\":\"%s\"", algo))
                goto cleanup_and_exit;
@@ -551,11 +550,11 @@ prepareProfilerEvent(Client cntxt, MalBl
 }
 
 static void
-renderProfilerEvent(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci, 
int start)
+renderProfilerEvent(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
 {
        str ev;
        MT_lock_set(&mal_profileLock);
-       ev = prepareProfilerEvent(cntxt, mb, stk, pci, start);
+       ev = prepareProfilerEvent(cntxt, mb, stk, pci);
        if( ev ){
                logjsonInternal(ev, true);
                free(ev);
@@ -701,7 +700,7 @@ profilerHeartbeatEvent(char *alter)
 }
 
 void
-profilerEvent(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci, int 
start)
+profilerEvent(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
 {
        (void) cntxt;
        if (stk == NULL) return;
@@ -710,10 +709,10 @@ profilerEvent(Client cntxt, MalBlkPtr mb
                return;
 
        if(maleventstream) {
-               renderProfilerEvent(cntxt, mb, stk, pci, start);
-               if (!start && pci->pc ==0)
+               renderProfilerEvent(cntxt, mb, stk, pci);
+               if (pci->pc ==0)
                        profilerHeartbeatEvent("ping");
-               if (start && pci->token == ENDsymbol)
+               if (pci->token == ENDsymbol)
                        profilerHeartbeatEvent("ping");
        }
 }
@@ -764,7 +763,7 @@ openProfilerStream(Client cntxt)
                if( c && m && s && p ) {
                        /* show the event  assuming the quadruple is aligned*/
                        MT_lock_unset(&mal_profileLock);
-                       profilerEvent(c, m, s, p, 1);
+                       profilerEvent(c, m, s, p);
                        MT_lock_set(&mal_profileLock);
                }
        }
@@ -967,7 +966,7 @@ sqlProfilerEvent(Client cntxt, MalBlkPtr
                c++;
 */
 
-       ev = prepareProfilerEvent(cntxt, mb, stk, pci, 0);
+       ev = prepareProfilerEvent(cntxt, mb, stk, pci);
        // keep it a short transaction
        MT_lock_set(&mal_profileLock);
        if (cntxt->profticks == NULL) {
diff --git a/monetdb5/mal/mal_profiler.h b/monetdb5/mal/mal_profiler.h
--- a/monetdb5/mal/mal_profiler.h
+++ b/monetdb5/mal/mal_profiler.h
@@ -34,7 +34,7 @@ mal_export void initProfiler(void);
 mal_export str openProfilerStream(Client cntxt);
 mal_export str closeProfilerStream(Client cntxt);
 
-mal_export void profilerEvent(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci, int start);
+mal_export void profilerEvent(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 mal_export void generic_event(str phase, struct GenericEvent e, int state);
 mal_export void sqlProfilerEvent(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 
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
@@ -389,10 +389,6 @@ runtimeProfileBegin(Client cntxt, MalBlk
        }
        /* always collect the MAL instruction execution time */
        pci->clock = prof->ticks = GDKusec();
-
-       /* emit the instruction upon start as well */
-       if(malProfileMode > 0 )
-               profilerEvent(cntxt, mb, stk, pci, TRUE);
 }
 
 /* At the end of each MAL stmt */
@@ -421,7 +417,7 @@ runtimeProfileExit(Client cntxt, MalBlkP
        pci->calls++;
 
        if(malProfileMode > 0 )
-               profilerEvent(cntxt, mb, stk, pci, FALSE);
+               profilerEvent(cntxt, mb, stk, pci);
        if( cntxt->sqlprofiler )
                sqlProfilerEvent(cntxt, mb, stk, pci);
        if( malProfileMode < 0){
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to