Changeset: b54560b5c2d8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b54560b5c2d8
Modified Files:
        monetdb5/mal/mal_listing.c
        monetdb5/mal/mal_profiler.c
Branch: profiler
Log Message:

Move MAL details to server side


diffs (72 lines):

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
@@ -470,11 +470,9 @@ shortStmtRendering(MalBlkPtr mb, MalStkP
 
                for (i = 0; i < p->retc; i++) {
                        nme = shortRenderingTerm(mb, stk, p,i);
-                       snprintf(t,(len-(t-base)), "%s%s", (i?",":" "), nme);
+                       snprintf(t,(len-(t-base)), "%s%s", (i?",":""), nme);
                        GDKfree(nme);
                        advance(t,base,len);
-                       if (i < p->retc - 1)
-                               *t++ = ',';
                }
                if (p->retc > 1)
                        *t++ = ')';
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
@@ -309,8 +309,9 @@ offlineProfilerEventJSON(MalBlkPtr mb, M
                GDKfree(stmt);
 
                // collect the input statements
-               prereq[0]=0;
-               len = 0;
+               prereq[0]='[';
+               prereq[1]=0;
+               len = 1;
                comma=0;
                for(i= pci->retc; i < pci->argc; i++){
                        for( j = pci->pc-1; j > 0; j--){
@@ -319,15 +320,38 @@ offlineProfilerEventJSON(MalBlkPtr mb, M
                                        if( getArg(q,k) == getArg(pci,i))
                                                break;
                                if( k < q->retc){
-                                       snprintf(prereq + len, BUFSIZ-len,"%c 
%d", (comma?',':'['), j);
+                                       snprintf(prereq + len, 
BUFSIZ-len,"%s%d", (comma?",":""), j);
                                        len = strlen(prereq);
                                        comma++;
                                        break;
                                }
                        }
                }
+               logadd("\"input\":%s]\n", prereq);
+               
+#ifdef MALARGUMENTDETAILS
+               // Also show details of the arguments for modelling
+               // Include the sizes later as well
+               prereq[0]=',';
+               prereq[1]=0;
+               len = 1;
+               comma=0;
+               for( j=0; j< pci->argc; j++){
+                       int tpe = getVarType(mb, getArg(pci,j));
+                       str tname = getTypeName(tpe);
+                       if( isaBatType(tpe) ){
+                               GDKfree(tname);
+                               tname = getTypeName(getColumnType(tpe));
+                               snprintf(prereq + len, 
BUFSIZ-len,"%s\":col[:%s]\"", (comma?",":"["), tname);
+                       } else
+                               snprintf(prereq + len, BUFSIZ-len,"%s:\"%s\"", 
(comma?",":"["), tname);
+                       comma++;
+                       len = strlen(prereq);
+                       GDKfree(tname);
+               }
                if( prereq[0])
-                       logadd("\"input\":%s]\n", prereq);
+                       logadd("\"types\":%s]\n", prereq);
+#endif
        }
        // collect all input producing PCs
        logadd("}\n"); // end marker
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to