Changeset: b699d4801f9e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b699d4801f9e
Modified Files:
        clients/Tests/exports.stable.out
        monetdb5/modules/mal/Tests/inspect05.stable.out
        sql/server/rel_exp.c
        sql/server/rel_exp.h
        sql/server/sql_mvc.c
Branch: sciql
Log Message:

merged from default


diffs (truncated from 1012 to 300 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -981,6 +981,7 @@ str BLOBblob_blob(blob **d, blob **s);
 str BLOBblob_fromstr(blob **b, str *d);
 void BLOBconvert(blob *b, int direction);
 void BLOBdel(Heap *h, var_t *index);
+void BLOBdestroy(blob *b);
 str BLOBeoln(char *src, char *end);
 str BLOBfromblob(str *retval, blob **b);
 str BLOBfromidx(str *retval, blob **binp, int *index);
@@ -5808,6 +5809,7 @@ str getName(str nme, size_t len);
 int getPC(MalBlkPtr mb, InstrPtr p);
 str getPipeCatalog(int *nme, int *def);
 str getPipeDefinition(str name);
+stream *getProfilerStream(void);
 str getRef;
 str getRefName(MalBlkPtr mb, int i);
 str getScenarioLanguage(Client c);
diff --git a/clients/mapiclient/stethoscope.c b/clients/mapiclient/stethoscope.c
--- a/clients/mapiclient/stethoscope.c
+++ b/clients/mapiclient/stethoscope.c
@@ -46,8 +46,8 @@
  *     a =aggregates
  *     e =event
  *     f =function 
- *     o =operation called
- *     i =interpreter theread
+ *     i =instruction counter
+ *     I =interpreter thread
  *     T =time
  *     t =ticks
  *     c =cpu statistics
@@ -59,6 +59,7 @@
  *     y =argument types
  *     p =pgfaults,cntxtswitches
  *     S =Start profiling instruction
+ *     D =Generate dot file upon query start
  * 
  * Ideally, the stream of events should be piped into a
  * 2D graphical tool, like xosview (Linux).
@@ -100,36 +101,36 @@ static struct {
        /*  0  */ { 'a', "aggregate", "total count", 0 },
        /*  1  */ { 'a', "aggregate", "total ticks", 0 },
        /*  2  */ { 'e', "event", "event id", 0 },
-       /*  3  */ { 'f', "pc", "function", 0 },
-       /*  4  */ { 'f', "pc", "pc", 0 },
-       /*  5  */ { 'o', "operation", "operation", 0 },
-       /*  6  */ { 'T', "time", "time stamp", 0 },
-       /*  7  */ { 't', "ticks", "usec ticks", 1 },
-       /*  8  */ { 'c', "cpu", "utime", 0 },
-       /*  9  */ { 'c', "cpu", "cutime", 0 },
-       /*  0  */ { 'c', "cpu", "stime", 0 },
-       /*  1  */ { 'c', "cpu", "cstime", 0 },
-       /*  2  */ { 'm', "memory", "arena", 0 },
-       /*  3  */ { 'm', "memory", "ordblks", 0 },
-       /*  4  */ { 'm', "memory", "smblks", 0 },
-       /*  5  */ { 'm', "memory", "hblkhd", 0 },
-       /*  6  */ { 'm', "memory", "hblks", 0 },
-       /*  7  */ { 'm', "memory", "fsmblks", 0 },
-       /*  8  */ { 'm', "memory", "uordblks", 0 },
-       /*  9  */ { 'r', "reads", "blk reads", 0 },
-       /*  0  */ { 'w', "writes", "blk writes", 0 },
-       /*  1  */ { 'b', "rbytes", "rbytes", 0 },
-       /*  2  */ { 'b', "wbytes", "wbytes", 0 },
-       /*  3  */ { 's', "stmt", "stmt", 2 },
-       /*  4  */ { 'p', "process", "pg reclaim", 0 },
-       /*  5  */ { 'p', "process", "pg faults", 0 },
-       /*  6  */ { 'p', "process", "swaps", 0 },
-       /*  7  */ { 'p', "process", "ctxt switch", 0 },
-       /*  8  */ { 'p', "process", "inv switch", 0 },
-       /*  9  */ { 'i', "thread", "thread", 0 },
-       /*  0  */ { 'u', "user", "user", 0 },
-       /*  1  */ { 'S', "start", "start", 0 },
-       /*  2  */ { 'y', "type", "type", 0 },
+       /*  3  */ { 'f', "function", "function", 0 },
+       /*  4  */ { 'i', "pc", "pc", 0 },
+       /*  5  */ { 'T', "time", "time stamp", 0 },
+       /*  6  */ { 't', "ticks", "usec ticks", 1 },
+       /*  7  */ { 'c', "cpu", "utime", 0 },
+       /*  8  */ { 'c', "cpu", "cutime", 0 },
+       /*  9  */ { 'c', "cpu", "stime", 0 },
+       /*  0  */ { 'c', "cpu", "cstime", 0 },
+       /*  1  */ { 'm', "memory", "arena", 0 },
+       /*  2  */ { 'm', "memory", "ordblks", 0 },
+       /*  3  */ { 'm', "memory", "smblks", 0 },
+       /*  4  */ { 'm', "memory", "hblkhd", 0 },
+       /*  5  */ { 'm', "memory", "hblks", 0 },
+       /*  6  */ { 'm', "memory", "fsmblks", 0 },
+       /*  7  */ { 'm', "memory", "uordblks", 0 },
+       /*  8  */ { 'r', "reads", "blk reads", 0 },
+       /*  9  */ { 'w', "writes", "blk writes", 0 },
+       /*  0  */ { 'b', "rbytes", "rbytes", 0 },
+       /*  1  */ { 'b', "wbytes", "wbytes", 0 },
+       /*  2  */ { 's', "stmt", "stmt", 2 },
+       /*  3  */ { 'p', "process", "pg reclaim", 0 },
+       /*  4  */ { 'p', "process", "pg faults", 0 },
+       /*  5  */ { 'p', "process", "swaps", 0 },
+       /*  6  */ { 'p', "process", "ctxt switch", 0 },
+       /*  7  */ { 'p', "process", "inv switch", 0 },
+       /*  8  */ { 'I', "thread", "thread", 0 },
+       /*  9  */ { 'u', "user", "user", 0 },
+       /*  0  */ { 'S', "start", "start", 0 },
+       /*  1  */ { 'y', "type", "type", 0 },
+       /*  2  */ { 'D', "dot", "dot", 0 },
        /*  3  */ { 0, 0, 0, 0 }
 };
 
@@ -165,10 +166,10 @@ usage(void)
        fprintf(stderr, "  S = monitor start of instruction profiling\n");
        fprintf(stderr, "  a = aggregate clock ticks per instruction\n");
        fprintf(stderr, "  e = event counter\n");
-       fprintf(stderr, "  f = function name and pc counter \n");
-       fprintf(stderr, "  o = module.function operation called\n");
-       fprintf(stderr, "  i = interpreter thread number\n");
-       fprintf(stderr, "  T = wall colck time\n");
+       fprintf(stderr, "  f = module.function name\n");
+       fprintf(stderr, "  i = instruction counter\n");
+       fprintf(stderr, "  I = interpreter thread number\n");
+       fprintf(stderr, "  T = wall clock time\n");
        fprintf(stderr, "  t = ticks in microseconds\n");
        fprintf(stderr, "  c = cpu statistics (utime,ctime,stime,cstime)\n");
        fprintf(stderr, "  m = memory resources as provided by OS\n");
@@ -179,6 +180,7 @@ usage(void)
        fprintf(stderr, "  y = MAL argument types\n");
        fprintf(stderr, "  p = process statistics, e.g. page faults, context 
switches\n");
        fprintf(stderr, "  u = user id\n");
+       fprintf(stderr, "  D = Generate dot file upon query start\n");
 }
 
 /* Any signal should be captured and turned into a graceful
@@ -195,7 +197,7 @@ stopListening(int i)
        }
 }
 
-static void
+static int
 setCounter(char *nme)
 {
        int i, k = 1;
@@ -207,6 +209,7 @@ setCounter(char *nme)
                for (i = 0; profileCounter[i].tag; i++)
                        if (profileCounter[i].tag == *nme)
                                profileCounter[i].status = k++;
+       return k;
 }
 
 #define die(dbh, hdl) while (1) {(hdl ? mapi_explain_query(hdl, stderr) :  \
@@ -353,8 +356,8 @@ int
 main(int argc, char **argv)
 {
        int a = 1;
-       int i;
-       char *host = "localhost";
+       int i, k;
+       char *host = NULL;
        int portnr = 50000;
        char *dbname = NULL;
        char *user = NULL;
@@ -402,10 +405,16 @@ main(int argc, char **argv)
 
        a = optind;
        if (argc > 1 && a < argc && argv[a][0] == '+') {
-               setCounter(argv[a] + 1);
+               k= setCounter(argv[a] + 1);
                a++;
        } else
-               setCounter("TtiesS");
+               k= setCounter("TtesDSI");
+
+       /* DOT needs function id and PC to correlate */
+       if( profileCounter[32].status ) {
+               profileCounter[3].status= k++;
+               profileCounter[4].status= k;
+       }
 
        if (user == NULL || password == NULL) {
                fprintf(stderr, "%s: need -u and -P arguments\n", argv[0]);
@@ -430,12 +439,10 @@ main(int argc, char **argv)
        /* try and find multiple options, we assume that we always need a
         * local merovingian for that, in the future we probably need to fix
         * this in a decent manner */
-       if (dbname != NULL) {
+       if (dbname != NULL && host == NULL) {
                oalts = alts = mapi_resolve(host, portnr, dbname);
-       } else {
+       } else 
                alts = NULL;
-               dbname = "";
-       }
 
        if (alts == NULL || *alts == NULL) {
                /* nothing to redirect, so a single host to try */
@@ -483,6 +490,7 @@ main(int argc, char **argv)
                        if (*alts == NULL)
                                break;
                        walk = walk->next = malloc(sizeof(wthread));
+                       printf("Alternative route created '%s'\n",walk->uri);
                }
                walk->next = NULL;
                free(oalts);
diff --git a/gdk/gdk.mx b/gdk/gdk.mx
--- a/gdk/gdk.mx
+++ b/gdk/gdk.mx
@@ -2125,6 +2125,7 @@ typedef struct {
        void (*atomConvert) (ptr v, int direction);
        int (*atomFix) (ptr atom);
        int (*atomUnfix) (ptr atom);
+       void (*atomDestroy) (ptr atom);
 
        /* varsized atom-only ADT functions */
        var_t (*atomPut) (Heap *, var_t *off, ptr src);
diff --git a/gdk/gdk_atoms.mx b/gdk/gdk_atoms.mx
--- a/gdk/gdk_atoms.mx
+++ b/gdk/gdk_atoms.mx
@@ -2350,64 +2350,44 @@ atomDesc BATatoms[MAXATOMS] = {
         (int (*)(ptr, ptr)) lngCmp,
         (BUN (*)(ptr)) lngHash, 0,
 #endif
-        0, 0,
-        0, 0,
-        0, 0,
-        0, 0},
+        0, 0, 0, 0, 0, 0, 0, 0, 0},
        {"bit", TYPE_chr, 1, sizeof(bit), sizeof(bit), 0, 0, (ptr) &chr_nil,
         (int (*)(str, int *, ptr *)) bitFromStr, (int (*)(str *, int *, ptr)) 
bitToStr,
         (void *(*)(void *, stream *, size_t)) bitRead, (int (*)(void *, stream 
*, size_t)) bitWrite,
         (int (*)(ptr, ptr)) chrCmp,
         (BUN (*)(ptr)) chrHash, 0,
-        0, 0,
-        0, 0,
-        0, 0,
-        0, 0},
+        0, 0, 0, 0, 0, 0, 0, 0, 0},
        {"chr", TYPE_chr, 1, sizeof(chr), sizeof(chr), 0, 0, (ptr) &chr_nil,
         (int (*)(str, int *, ptr *)) chrFromStr, (int (*)(str *, int *, ptr)) 
chrToStr,
         (void *(*)(void *, stream *, size_t)) chrRead, (int (*)(void *, stream 
*, size_t)) chrWrite,
         (int (*)(ptr, ptr)) chrCmp,
         (BUN (*)(ptr)) chrHash, 0,
-        0, 0,
-        0, 0,
-        0, 0,
-        0, 0},
+        0, 0, 0, 0, 0, 0, 0, 0, 0},
        {"bte", TYPE_bte, 1, sizeof(bte), sizeof(bte), 0, 0, (ptr) &bte_nil,
         (int (*)(str, int *, ptr *)) bteFromStr, (int (*)(str *, int *, ptr)) 
bteToStr,
         (void *(*)(void *, stream *, size_t)) bteRead, (int (*)(void *, stream 
*, size_t)) bteWrite,
         (int (*)(ptr, ptr)) bteCmp,
         (BUN (*)(ptr)) bteHash, 0,
-        0, 0,
-        0, 0,
-        0, 0,
-        0, 0},
+        0, 0, 0, 0, 0, 0, 0, 0, 0},
        {"sht", TYPE_sht, 1, sizeof(sht), sizeof(sht), 0, 0, (ptr) &sht_nil,
         (int (*)(str, int *, ptr *)) shtFromStr, (int (*)(str *, int *, ptr)) 
shtToStr,
         (void *(*)(void *, stream *, size_t)) shtRead, (int (*)(void *, stream 
*, size_t)) shtWrite,
         (int (*)(ptr, ptr)) shtCmp,
         (BUN (*)(ptr)) shtHash, (void (*)(ptr, int)) shtConvert,
-        0, 0,
-        0, 0,
-        0, 0,
-        0, 0},
+        0, 0, 0, 0, 0, 0, 0, 0, 0},
        {"BAT", TYPE_int, 1, sizeof(bat), sizeof(bat), 0, 0, (ptr) &int_nil,
         (int (*)(str, int *, ptr *)) batFromStr, (int (*)(str *, int *, ptr)) 
batToStr,
         (void *(*)(void *, stream *, size_t)) batRead, (int (*)(void *, stream 
*, size_t)) batWrite,
         (int (*)(ptr, ptr)) intCmp,
         (BUN (*)(ptr)) intHash, (void (*)(ptr, int)) intConvert,
         (int (*)(ptr)) batFix, (int (*)(ptr)) batUnfix,
-        0, 0,
-        0, 0,
-        0, 0},
+        0, 0, 0, 0, 0, 0, 0},
        {"int", TYPE_int, 1, sizeof(int), sizeof(int), 0, 0, (ptr) &int_nil,
         (int (*)(str, int *, ptr *)) intFromStr, (int (*)(str *, int *, ptr)) 
intToStr,
         (void *(*)(void *, stream *, size_t)) intRead, (int (*)(void *, stream 
*, size_t)) intWrite,
         (int (*)(ptr, ptr)) intCmp,
         (BUN (*)(ptr)) intHash, (void (*)(ptr, int)) intConvert,
-        0, 0,
-        0, 0,
-        0, 0,
-        0, 0},
+        0, 0, 0, 0, 0, 0, 0, 0, 0},
        {"oid",
 #if SIZEOF_OID == SIZEOF_INT
         TYPE_int, 1, sizeof(oid), sizeof(oid), 0, 0, (ptr) &int_nil,
@@ -2422,10 +2402,7 @@ atomDesc BATatoms[MAXATOMS] = {
         (int (*)(ptr, ptr)) lngCmp,
         (BUN (*)(ptr)) lngHash, (void (*)(ptr, int)) lngConvert,
 #endif
-        0, 0,
-        0, 0,
-        0, 0,
-        0, 0},
+        0, 0, 0, 0, 0, 0, 0, 0, 0},
        {"wrd",
 #if SIZEOF_WRD == SIZEOF_INT
         TYPE_int, 1, sizeof(wrd), sizeof(wrd), 0, 0, (ptr) &int_nil,
@@ -2440,10 +2417,7 @@ atomDesc BATatoms[MAXATOMS] = {
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to