Changeset: d1007771554d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d1007771554d
Modified Files:
        clients/Tests/exports.stable.out
        clients/mapiclient/mclient.c
        clients/mapiclient/tomograph.c
        clients/mapilib/mapi.c
        monetdb5/mal/mal_dataflow.c
        monetdb5/mal/mal_parser.c
        monetdb5/mal/mal_parser.h
        monetdb5/mal/mal_profiler.c
        monetdb5/mal/mal_resource.c
        sql/backends/monet5/prog.c
Branch: default
Log Message:

Merge with Feb2013 branch.


diffs (truncated from 653 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
@@ -2962,7 +2962,7 @@ str pinRef;
 int pivotDisjunctiveProp;
 int pivotProp;
 str plusRef;
-long position(Client cntxt);
+ssize_t position(Client cntxt);
 str postludeRef;
 str pqueueRef;
 str preludeRef;
@@ -2982,6 +2982,7 @@ void printTraceCall(stream *out, MalBlkP
 str prodRef;
 int profilerAvailable(void);
 void profilerEvent(int idx, MalBlkPtr mb, MalStkPtr stk, int pc, int start);
+void profilerHeartbeatEvent(str msg);
 str profilerRef;
 str projectRef;
 str projectdeltaRef;
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -126,6 +126,7 @@ int csvheader = 0;          /* include header li
 
 /* use a 64 bit integer for the timer */
 typedef lng timertype;
+#define TTFMT LLFMT
 #if 0
 static char *mark, *mark2;
 #endif
@@ -279,7 +280,7 @@ timerEnd(void)
        assert(t1 >= t0);
 #if 0
        if (mark && specials == NOmodifier) {
-               fprintf(stderr, "%s %7ld.%03ld msec %s\n", mark, (long) ((t1 - 
t0) / 1000), (long) ((t1 - t0) % 1000), mark2 ? mark2 : "");
+               fprintf(stderr, "%s " TTFMT ".%03d msec %s\n", mark, (t1 - t0) 
/ 1000, (int) ((t1 - t0) % 1000), mark2 ? mark2 : "");
                fflush(stderr);
        }
 #endif
@@ -308,18 +309,18 @@ timerHuman(void)
        assert(th >= t0);
 
        if (itimemode == T_MILLIS || (itimemode == T_HUMAN && t / 1000 < 950)) {
-               snprintf(htimbuf, 32, "%ld.%03ldms", (long) (t / 1000), (long) 
(t % 1000));
+               snprintf(htimbuf, 32, TTFMT ".%03dms", t / 1000, (int) (t % 
1000));
                return(htimbuf);
        }
        t /= 1000;
        if (itimemode == T_SECS || (itimemode == T_HUMAN && t / 1000 < 60)) {
-               snprintf(htimbuf, 32, "%ld.%lds", (long) (t / 1000),
-                               (long) ((t % 1000) / 100));
+               snprintf(htimbuf, 32, TTFMT ".%ds", t / 1000,
+                               (int) ((t % 1000) / 100));
                return(htimbuf);
        }
        t /= 1000;
        /* itimemode == T_MINSECS || itimemode == T_HUMAN */
-       snprintf(htimbuf, 32, "%ldm %lds", (long) (t / 60), (long) (t % 60));
+       snprintf(htimbuf, 32, TTFMT "m %ds", t / 60, (int) (t % 60));
        return(htimbuf);
 }
 
@@ -2550,7 +2551,7 @@ set_timezone(Mapi mid)
        char buf[128];
        time_t t, lt, gt;
        struct tm *tmp;
-       long tzone;
+       int tzone;
        MapiHdl hdl;
 
        /* figure out our current timezone */
@@ -2559,14 +2560,15 @@ set_timezone(Mapi mid)
        gt = mktime(tmp);
        tmp = localtime(&t);
        lt = mktime(tmp);
-       tzone = (long) (gt - lt);
+       assert((lng) (gt - lt) >= (lng) INT_MIN && (lng) (gt - lt) <= (lng) 
INT_MAX);
+       tzone = (int) (gt - lt);
        if (tzone < 0)
                snprintf(buf, sizeof(buf),
-                        "SET TIME ZONE INTERVAL '+%02ld:%02ld' HOUR TO MINUTE",
+                        "SET TIME ZONE INTERVAL '+%02d:%02d' HOUR TO MINUTE",
                         -tzone / 3600, (-tzone % 3600) / 60);
        else
                snprintf(buf, sizeof(buf),
-                        "SET TIME ZONE INTERVAL '-%02ld:%02ld' HOUR TO MINUTE",
+                        "SET TIME ZONE INTERVAL '-%02d:%02d' HOUR TO MINUTE",
                         tzone / 3600, (tzone % 3600) / 60);
        if ((hdl = mapi_query(mid, buf)) == NULL) {
                if (formatter == TABLEformatter || formatter == CLEANformatter) 
{
diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -130,14 +130,14 @@ static wthread *thds = NULL;
 static char hostname[128];
 static char *filename = "tomograph";
 static char *tracefile = 0;
-static long startrange = 0, endrange = 0;
+static lng startrange = 0, endrange = 0;
 static char *title = 0;
 static int debug = 0;
 static int colormap = 0;
 static int beat = 50;
 static char *sqlstatement = NULL;
 static int batch = 1; /* number of queries to combine in one run */
-static long maxio = 0;
+static lng maxio = 0;
 static int cpus = 0;
 
 static FILE *gnudata;
@@ -275,10 +275,10 @@ typedef struct BOX {
        int row;
        int color;
        int thread;
-       long clkstart, clkend;
-       long ticks;
-       long memstart, memend;
-       long reads, writes;
+       lng clkstart, clkend;
+       lng ticks;
+       lng memstart, memend;
+       lng reads, writes;
        char *stmt;
        char *fcn;
        int state;
@@ -286,17 +286,17 @@ typedef struct BOX {
 
 
 int threads[MAXTHREADS];
-long lastclk[MAXTHREADS];
+lng lastclk[MAXTHREADS];
 int prevthreads[MAXTHREADS];
 Box box[MAXBOX];
 int topbox = 0;
 
-long totalclkticks = 0; /* number of clock ticks reported */
-long totalexecticks = 0; /* number of ticks reported for processing */
-long lastclktick = 0;
+lng totalclkticks = 0; /* number of clock ticks reported */
+lng totalexecticks = 0; /* number of ticks reported for processing */
+lng lastclktick = 0;
 
 
-long starttime = 0;
+lng starttime = 0;
 
 static void dumpbox(int i)
 {
@@ -304,9 +304,9 @@ static void dumpbox(int i)
        if (box[i].fcn)
                printf("%s ", box[i].fcn);
        printf("thread %d ", box[i].thread);
-       printf("clk %ld - %ld ", box[i].clkstart, box[i].clkend);
-       printf("mem %ld - %ld ", box[i].memstart, box[i].memend);
-       printf("ticks %ld ", box[i].ticks);
+       printf("clk "LLFMT" - "LLFMT" ", box[i].clkstart, box[i].clkend);
+       printf("mem "LLFMT" - "LLFMT" ", box[i].memstart, box[i].memend);
+       printf("ticks "LLFMT" ", box[i].ticks);
        if (box[i].stmt)
                printf("%s ", box[i].stmt);
        printf("\n");
@@ -477,7 +477,7 @@ static char *getRGB(char *name)
 /* The initial dictionary is geared towars TPCH-use */
 struct COLOR {
        int freq;
-       long timeused;
+       lng timeused;
        char *mod, *fcn, *col;
 }
 colors[] =
@@ -601,10 +601,10 @@ static void dumpboxes(void)
                if (box[i].clkend && box[i].fcn) {
                        if (box[i].state < PING) {
                                //io counters are zero at start of instruction !
-                               //fprintf(f,"%ld %3.2f 0 0 \n", 
box[i].clkstart, (box[i].memstart/1024.0));
-                               fprintf(f, "%ld %3.2f 0 0\n", box[i].clkend, 
(box[i].memend / 1024.0));
+                               //fprintf(f,""LLFMT" %3.2f 0 0 \n", 
box[i].clkstart, (box[i].memstart/1024.0));
+                               fprintf(f, ""LLFMT" %3.2f 0 0\n", 
box[i].clkend, (box[i].memend / 1024.0));
                        } else {
-                               fprintf(f, "%ld %3.2f %ld %ld\n", 
box[i].clkend, (box[i].memend / 1024.0), box[i].reads, box[i].writes);
+                               fprintf(f, ""LLFMT" %3.2f "LLFMT" "LLFMT"\n", 
box[i].clkend, (box[i].memend / 1024.0), box[i].reads, box[i].writes);
                                if (cpus == 0) {
                                        char *s = box[i].stmt;
                                        while (s && isspace((int) *s))
@@ -620,7 +620,7 @@ static void dumpboxes(void)
                                        }
                                        fprintf(fcpu, "\n");
                                }
-                               fprintf(fcpu, "%ld %s\n", box[i].clkend, 
box[i].stmt);
+                               fprintf(fcpu, ""LLFMT" %s\n", box[i].clkend, 
box[i].stmt);
                        }
                }
 
@@ -634,8 +634,8 @@ static void dumpboxes(void)
 static void showmemory(void)
 {
        int i;
-       long max = 0, min = LONG_MAX;
-       long mx, mn;
+       lng max = 0, min = LONG_LONG_MAX;
+       lng mx, mn;
 
        for (i = 0; i < topbox; i++)
                if (box[i].clkend && box[i].fcn) {
@@ -657,14 +657,14 @@ static void showmemory(void)
        fprintf(gnudata, "set size 1,0.07\n");
        fprintf(gnudata, "set origin 0.0,0.87\n");
 
-       fprintf(gnudata, "set xrange [%f:%f]\n", (double) startrange, ((double) 
lastclktick - starttime));
+       fprintf(gnudata, "set xrange ["LLFMT":"LLFMT"]\n", startrange, 
lastclktick - starttime);
        fprintf(gnudata, "set ylabel \"memory in GB\"\n");
        fprintf(gnudata, "unset xtics\n");
-       mn = (long) (min / 1024.0);
-       mx = (long) (max / 1024.0);
+       mn = (lng) (min / 1024.0);
+       mx = (lng) (max / 1024.0);
        mx += (mn == mx) + 1;
-       fprintf(gnudata, "set yrange [%ld:%ld]\n", mn, (long) mx);
-       fprintf(gnudata, "set ytics (\"%.1f\" %ld, \"%.1f\" %ld)\n", min / 
1024.0, mn, max / 1024.0, mx);
+       fprintf(gnudata, "set yrange ["LLFMT":"LLFMT"]\n", mn, mx);
+       fprintf(gnudata, "set ytics (\"%.1f\" "LLFMT", \"%.1f\" "LLFMT")\n", 
min / 1024.0, mn, max / 1024.0, mx);
        fprintf(gnudata, "plot \"%s.dat\" using 1:2 notitle with dots linecolor 
rgb \"blue\"\n", (tracefile ? "scratch" : filename));
        fprintf(gnudata, "unset yrange\n");
 }
@@ -684,7 +684,7 @@ static void showcpu(void)
        fprintf(gnudata, "unset ytics\n");
        fprintf(gnudata, "unset border\n");
 
-       fprintf(gnudata, "set xrange [%f:%f]\n", (double) startrange, ((double) 
lastclktick - starttime));
+       fprintf(gnudata, "set xrange ["LLFMT":"LLFMT"]\n", startrange, 
lastclktick - starttime);
        fprintf(gnudata, "set yrange [0:%d.%d]\n", cpus, cpus);
        if (cpus)
                fprintf(gnudata, "plot ");
@@ -698,7 +698,7 @@ static void showcpu(void)
 static void showio(void)
 {
        int i;
-       long max = 0;
+       lng max = 0;
 
        for (i = 0; i < topbox; i++)
                if (box[i].clkend && box[i].state >= PING) {
@@ -715,12 +715,12 @@ static void showio(void)
        fprintf(gnudata, "set rmarg 10\n");
        fprintf(gnudata, "set size 1,0.07\n");
        fprintf(gnudata, "set origin 0.0,0.87\n");
-       fprintf(gnudata, "set xrange [%f:%f]\n", (double) startrange, (double) 
(lastclktick - starttime));
-       fprintf(gnudata, "set yrange [1:%ld]\n", ((1.1 * max / beat) <= 2 ? 2 : 
(long) (1.1 * max / beat)));
+       fprintf(gnudata, "set xrange ["LLFMT":"LLFMT"]\n", startrange, 
lastclktick - starttime);
+       fprintf(gnudata, "set yrange [1:"LLFMT"]\n", ((1.1 * max / beat) <= 2 ? 
2 : (lng) (1.1 * max / beat)));
        fprintf(gnudata, "unset xtics\n");
        fprintf(gnudata, "unset ytics\n");
        fprintf(gnudata, "unset ylabel\n");
-       fprintf(gnudata, "set y2tics in (\"%d\" %ld)\n", (int) (max / beat), 
max / beat);
+       fprintf(gnudata, "set y2tics in (\""LLFMT"\" "LLFMT")\n", max / beat, 
max / beat);
        fprintf(gnudata, "set y2label \"IO per ms\"\n");
        fprintf(gnudata, "plot \"%s.dat\" using 1:(($3+$4)/%d.0) title 
\"reads\" with boxes fs solid linecolor rgb \"gray\" ,\\\n", (tracefile ? 
"scratch" : filename), beat);
        fprintf(gnudata, "\"%s.dat\" using 1:($4/%d.0) title \"writes\" with 
boxes fs solid linecolor rgb \"red\"  \n", (tracefile ? "scratch" : filename), 
beat);
@@ -740,7 +740,7 @@ static void showcolormap(char *filename,
        int h = 500;
        char *scale;
        double tu = 0;
-       long total = 0, totfreq = 0;
+       lng total = 0, totfreq = 0;
 
        if (all) {
                snprintf(buf, BUFSIZ, "%s.gpl", filename);
@@ -799,7 +799,7 @@ static void showcolormap(char *filename,
                }
 
        h -= 45;
-       fprintf(f, "set label %d \" %ld MAL instructions executed\" at %d,%d\n",
+       fprintf(f, "set label %d \" "LLFMT" MAL instructions executed\" at 
%d,%d\n",
                        object++, totfreq, (int) (0.2 * w), h - 35);
        fprintf(f, "plot 0 notitle with lines linecolor rgb \"white\"\n");
 }
@@ -849,9 +849,9 @@ static void keepdata(char *filename)
                        //if ( debug)
                        //fprintf(stderr,"%3d\t%8ld\t%5ld\t%s\n", 
box[i].thread, box[i].clkstart, box[i].clkend-box[i].clkstart, box[i].fcn);
 
-                       fprintf(f, "%d\t%ld\t%ld\t", box[i].thread, 
box[i].clkstart, box[i].clkend);
-                       fprintf(f, "%ld\t%ld\t%ld\t", box[i].ticks, 
box[i].memstart, box[i].memend);
-                       fprintf(f, "%d\t%ld\t%ld\t", box[i].state, 
box[i].reads, box[i].writes);
+                       fprintf(f, "%d\t"LLFMT"\t"LLFMT"\t", box[i].thread, 
box[i].clkstart, box[i].clkend);
+                       fprintf(f, ""LLFMT"\t"LLFMT"\t"LLFMT"\t", box[i].ticks, 
box[i].memstart, box[i].memend);
+                       fprintf(f, "%d\t"LLFMT"\t"LLFMT"\t", box[i].state, 
box[i].reads, box[i].writes);
                        fprintf(f, "%s\t", box[i].fcn);
                        fprintf(f, "%s\n", box[i].stmt ? box[i].stmt : 
box[i].fcn);
                }
@@ -880,7 +880,7 @@ static void scandata(char *filename)
                if ( fgets(line,2 * BUFSIZ,f) == NULL) {
                        fprintf(stderr, "scandata read error\n");
                }
-               if ( (cnt =sscanf(line, 
"%d\t%ld\t%ld\t%ld\t%ld\t%ld\t%d\t%ld\t%ld\t%s\t%s\n", 
+               if ( (cnt =sscanf(line, 
"%d\t"LLFMT"\t"LLFMT"\t"LLFMT"\t"LLFMT"\t"LLFMT"\t%d\t"LLFMT"\t"LLFMT"\t%s\t%s\n",
 
                                        &box[i].thread, &box[i].clkstart, 
&box[i].clkend,
                                        &box[i].ticks, &box[i].memstart, 
&box[i].memend,
                                        &box[i].state, &box[i].reads, 
&box[i].writes, buf, buf2)) != 11){
@@ -944,7 +944,7 @@ static void createTomogram(void)
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to