Changeset: fc1361fe8f78 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fc1361fe8f78
Modified Files:
        monetdb5/mal/mal_interpreter.mx
        monetdb5/mal/mal_profiler.mx
Branch: default
Log Message:

Fix display of start/done
Now +S profiler ensures that the start marker is shown.


diffs (83 lines):

diff --git a/monetdb5/mal/mal_interpreter.mx b/monetdb5/mal/mal_interpreter.mx
--- a/monetdb5/mal/mal_interpreter.mx
+++ b/monetdb5/mal/mal_interpreter.mx
@@ -2564,7 +2564,7 @@ void releaseBAT(MalBlkPtr mb, MalStkPtr 
                                mb->profiler[ppc].clock = stk->clock;
                                /* emit the instruction upon start as well */
                                if (@2 && malProfileMode)
-                                       profilerEvent(cntxt->idx, mb, stk, 
stkpc,"start");
+                                       profilerEvent(cntxt->idx, mb, stk, 
stkpc,1);
 #ifdef HAVE_TIMES
                                times(&stk->timer);
                                mb->profiler[ppc].timer = stk->timer;
@@ -2586,7 +2586,7 @@ void releaseBAT(MalBlkPtr mb, MalStkPtr 
                        mb->profiler[ppc].clk += mb->profiler[ppc].clk;
                        mb->profiler[ppc].rbytes = getVolume(stk, pci, 0);
                        mb->profiler[ppc].wbytes = getVolume(stk, pci, 1);
-                       profilerEvent(cntxt->idx, mb, stk, ppc,"done ");
+                       profilerEvent(cntxt->idx, mb, stk, ppc,0);
                        ppc = -1;
                }
                if (cntxt->qtimeout && time(NULL) - stk->clock.tv_usec > 
cntxt->qtimeout)
diff --git a/monetdb5/mal/mal_profiler.mx b/monetdb5/mal/mal_profiler.mx
--- a/monetdb5/mal/mal_profiler.mx
+++ b/monetdb5/mal/mal_profiler.mx
@@ -245,7 +245,7 @@ mal_export str openProfilerStream(stream
 mal_export str closeProfilerStream(void);
 
 mal_export void initProfiler(MalBlkPtr mb);
-mal_export void profilerEvent(int idx, MalBlkPtr mb, MalStkPtr stk, int pc, 
str status);
+mal_export void profilerEvent(int idx, MalBlkPtr mb, MalStkPtr stk, int pc, 
int start);
 mal_export str setLogFile(stream *fd, Module cntxt, str fname);
 mal_export str setLogStream(Module cntxt, str host, int port);
 mal_export str setLogStreamStream(Module cntxt, stream *s);
@@ -318,7 +318,7 @@ profilerAvailable(void)
 {
        return 1;
 }
-static void offlineProfilerEvent(int idx, MalBlkPtr mb, MalStkPtr stk, int 
pc,str status);
+static void offlineProfilerEvent(int idx, MalBlkPtr mb, MalStkPtr stk, int pc, 
int start);
 static void cachedProfilerEvent(int idx, MalBlkPtr mb, MalStkPtr stk, int pc);
 static int initTrace(void);
 
@@ -430,17 +430,17 @@ deactivateCounter(str name)
  * Note that the profiler itself should lead to event generations.
  */
 void
-profilerEvent(int idx, MalBlkPtr mb, MalStkPtr stk, int pc, str status)
+profilerEvent(int idx, MalBlkPtr mb, MalStkPtr stk, int pc, int start)
 {
        if (mb->profiler == NULL) return;
-       if (profileCounter[PROFstart].status == 0 && mb->profiler[pc].ticks == 
0)
+       if (profileCounter[PROFstart].status == 0 && start)
                return;
        if (myname == 0)
                myname = putName("profiler", 8);
        if (getModuleId(getInstrPtr(mb, pc)) == myname)
                return;
        if (offlineProfiling)
-               offlineProfilerEvent(idx, mb, stk, pc,status);
+               offlineProfilerEvent(idx, mb, stk, pc,start);
        if (cachedProfiling)
                cachedProfilerEvent(idx, mb, stk, pc);
 }
@@ -514,7 +514,7 @@ offlineProfilerHeader(void)
 }
 
 void
-offlineProfilerEvent(int idx, MalBlkPtr mb, MalStkPtr stk, int pc, str status)
+offlineProfilerEvent(int idx, MalBlkPtr mb, MalStkPtr stk, int pc, int start)
 {
        static struct Mallinfo prevMalloc;
        InstrPtr pci = getInstrPtr(mb, pc);
@@ -555,7 +555,9 @@ offlineProfilerEvent(int idx, MalBlkPtr 
        log0("[ ");
        if (profileCounter[PROFevent].status) {
                log("%d,\t", eventcounter);
-               log("\"%s\",\t", status);
+       }
+       if (profileCounter[PROFstart].status) {
+               log("\"%s\",\t", start?"start":"done");
        }
        if (profileCounter[PROFtime].status) {
                char *tbuf, *c;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to