Changeset: 55e73d26399b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/55e73d26399b
Modified Files:
        monetdb5/mal/mal.h
        monetdb5/mal/mal_listing.c
        monetdb5/optimizer/opt_dataflow.c
Branch: parappend
Log Message:

Remove tracing infrastructure


diffs (160 lines):

diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h
--- a/monetdb5/mal/mal.h
+++ b/monetdb5/mal/mal.h
@@ -92,8 +92,7 @@ mal_export void mal_reset(void);
 #define LIST_MAL_MAPI  32       /* output Mapi compatible output */
 #define LIST_MAL_REMOTE  64       /* output MAL for remote execution */
 #define LIST_MAL_FLOW   128       /* output MAL dataflow dependencies */
-#define LIST_MAL_NOCOMMENTS 256   /* suppress lines starting with '#' */
-#define LIST_MAL_CALL  (LIST_MAL_NAME | LIST_MAL_VALUE)
+#define LIST_MAL_CALL  (LIST_MAL_NAME | LIST_MAL_VALUE )
 #define LIST_MAL_DEBUG (LIST_MAL_NAME | LIST_MAL_VALUE | LIST_MAL_TYPE | 
LIST_MAL_PROPS | LIST_MAL_FLOW)
 #define LIST_MAL_ALL   (LIST_MAL_NAME | LIST_MAL_VALUE | LIST_MAL_TYPE | 
LIST_MAL_MAPI)
 
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
@@ -351,7 +351,7 @@ instruction2str(MalBlkPtr mb, MalStkPtr 
        case CMDcall:
        case ASSIGNsymbol :
                // is any variable explicit or used
-               /* this code was meant to make it easy to detect functions whose
+               /* this code was meant to make it easy to detect functions 
whose 
                 * result variable was not used anywhere.
                 * It is not essential
                for (i = 0; i < p->retc; i++)
@@ -567,19 +567,14 @@ printInstruction(stream *fd, MalBlkPtr m
        if (fd == 0)
                return;
        ps = instruction2str(mb, stk, p, flg);
-       if (ps && (flg & LIST_MAL_NOCOMMENTS) != 0) {
-               char *hashmark = strchr(ps, '#');
-               if (hashmark) {
-                       *hashmark = 0;
-               }
-       }
-       if (ps){
-               if (*ps != '\0')
-                       mnstr_printf(fd, "%s%s\n", (flg & LIST_MAL_MAPI ? "=" : 
""), ps);
+       /* ps[strlen(ps)-1] = 0; remove '\n' */
+       if ( ps ){
+               mnstr_printf(fd, "%s%s", (flg & LIST_MAL_MAPI ? "=" : ""), ps);
                GDKfree(ps);
        } else {
-               mnstr_printf(fd,"#failed instruction2str()\n");
+               mnstr_printf(fd,"#failed instruction2str()");
        }
+       mnstr_printf(fd, "\n");
 }
 
 void
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
@@ -349,10 +349,9 @@ decideRegionType(Client cntxt, MalBlkPtr
 /* dataflow blocks are transparent, because they are always
    executed, either sequentially or in parallel */
 
-static str
-OPTdataflowImplementation_wrapped(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr p)
+str
+OPTdataflowImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
p)
 {
-       volatile int interesting_banana = 0;
        int i,j,k, start, slimit, breakpoint, actions=0, simple = TRUE;
        int flowblock= 0;
        InstrPtr *sink = NULL, *old = NULL, q;
@@ -363,32 +362,6 @@ OPTdataflowImplementation_wrapped(Client
        lng usec = GDKusec();
        str msg = MAL_SUCCEED;
 
-
-       do {
-               if (mb->stop < 2)
-                       break;
-               InstrPtr p = mb->stmt[1];
-
-               if (strcmp("joeri", mb->stmt[0]->fcnname) == 0) {
-                       interesting_banana = 1;
-               }
-
-               if (p->argc < 2)
-                       break;
-
-               if (p->modname != querylogRef || p->fcnname != defineRef)
-                       break;
-
-               const char *txt = getVarConstant(mb, getArg(p,1)).val.sval;
-               if (strstr(txt, "value / 2") != 0)
-                       interesting_banana = 1;
-       } while (0);
-
-       // if (!interesting_banana)
-       //      return MAL_SUCCEED;
-
-
-
        /* don't use dataflow on single processor systems */
        if (GDKnr_threads <= 1)
                return MAL_SUCCEED;
@@ -509,60 +482,5 @@ wrapup:
        if(states) GDKfree(states);
        if(sink)   GDKfree(sink);
        if(old)    GDKfree(old);
-       (void) interesting_banana;
        return msg;
 }
-
-
-
-static stream *
-open_trace_stream(void)
-{
-       char path[4096] = {0};
-       stream *s = NULL;
-
-       char *tst_trace_dir = getenv("JOERITRACE");
-       if (tst_trace_dir) {
-               long t = time(NULL);
-               int p = getpid();
-               sprintf(path, "%s/trace.%ld.%d.log", tst_trace_dir, t, p);
-       } else {
-               strcpy(path, "a");
-       }
-
-       s = open_wastream(path);
-       return s;
-}
-
-str
-OPTdataflowImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
p)
-{
-       int list_flags = LIST_MAL_ALL | LIST_MAL_NOCOMMENTS;
-       static stream *s = NULL;
-       static MT_Lock lock = MT_LOCK_INITIALIZER(lock);
-
-       MT_lock_set(&lock);
-
-       if (s == NULL)
-               s = open_trace_stream();
-
-       if (s) {
-               printFunction(s, mb, stk, list_flags);
-               mnstr_printf(s, "\n\n--\n\n");
-               mnstr_flush(s, MNSTR_FLUSH_ALL);
-       }
-       str msg = OPTdataflowImplementation_wrapped(cntxt, mb, stk, p);
-
-       if (s) {
-               if (msg != MAL_SUCCEED) {
-                       mnstr_printf(s, "ERROR: %s\n", msg);
-               }
-               printFunction(s, mb, stk, list_flags);
-               mnstr_printf(s, "\n\n------\n\n");
-               mnstr_flush(s, MNSTR_FLUSH_ALL);
-       }
-
-       MT_lock_unset(&lock);
-
-       return msg;
-}
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to