Changeset: ea31e1543085 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ea31e1543085
Added Files:
clients/python2/test/test_monetize.py
clients/python3/test/test_monetize.py
Removed Files:
sql/test/BugTracker-2013/Tests/constraint_checking.Bug_3335.sql
Modified Files:
clients/R/MonetDB.R/R/monetdb.R
clients/mapiclient/tomograph.c
clients/python2/monetdb/sql/monetize.py
clients/python2/test/capabilities.py
clients/python2/test/runtests.py
clients/python3/monetdb/sql/monetize.py
clients/python3/test/capabilities.py
clients/python3/test/runtests.py
common/stream/stream.c
gdk/ChangeLog.Feb2013
gdk/gdk_batop.c
gdk/gdk_heap.c
gdk/gdk_posix.c
gdk/gdk_private.h
gdk/gdk_storage.c
gdk/gdk_utils.c
monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.err
monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.err.Windows
monetdb5/modules/atoms/mtime.c
monetdb5/modules/mal/mat.c
sql/test/BugConstraints/Tests/add_constraint_1643522.stable.err
sql/test/BugConstraints/Tests/delete_primarykey_1643845.stable.err
sql/test/BugConstraints/Tests/drop_column_1643542.stable.err
sql/test/BugConstraints/Tests/update_primarykey_1643375.stable.err
sql/test/BugTracker-2008/Tests/sql_command_kills_db.SF-2233677.stable.err
sql/test/BugTracker-2009/Tests/ambiguous_order_by.SF-2827916.stable.err
sql/test/BugTracker-2009/Tests/ambiguous_view.stable.err
sql/test/BugTracker-2009/Tests/assert_in_update.SF-2807336.stable.err
sql/test/BugTracker-2009/Tests/copy_into_error_off_by_one.SF-2833696.stable.err
sql/test/BugTracker-2009/Tests/copy_multiple_files.SF-2902320.stable.err
sql/test/BugTracker-2009/Tests/create_on_ro_db_crash.SF-2830238.stable.err
sql/test/BugTracker-2009/Tests/create_table_dup_name.SF-2879005.stable.err
sql/test/BugTracker-2009/Tests/drop-sequence-crash.SF-2854195.stable.err
sql/test/BugTracker-2009/Tests/except_error_wrong.SF-2808409.stable.err
sql/test/BugTracker-2009/Tests/explain_gives_crash.SF-2741829.stable.err
sql/test/BugTracker-2009/Tests/incomplete.SF.2536893.stable.err
sql/test/BugTracker-2009/Tests/insert_into_values_bug.SF-2807609.stable.err
sql/test/BugTracker-2009/Tests/limit_in_subquery.SF-2620437.stable.err
sql/test/BugTracker-2009/Tests/not_invalidtable_crash.SF-2927174.stable.err
sql/test/BugTracker-2009/Tests/overflow.SF-2853458.stable.err
sql/test/BugTracker-2009/Tests/overflow.SF-2853458.stable.err.Solaris
sql/test/BugTracker-2009/Tests/overflow.SF-2853458.stable.err.Windows
sql/test/BugTracker-2009/Tests/primekeyconstraint.SF-2783425.stable.err
sql/test/BugTracker-2009/Tests/rollback_bug.stable.err
sql/test/BugTracker-2009/Tests/rollback_mistake.SF-2814622.stable.err
sql/test/BugTracker-2009/Tests/segv_for_unknown_identifier_in_subquery.SF-2874045.stable.err
sql/test/BugTracker-2009/Tests/select_X_where_bla_EQ_whatever.SF-282597.stable.err
sql/test/BugTracker-2009/Tests/select_from_history.SF-2556566.stable.err
sql/test/BugTracker-2009/Tests/subquery_returns_table_crash.SF-2513620.stable.err
sql/test/BugTracker-2009/Tests/temp_table_fail_leaves_data.SF-2793286.stable.err
sql/test/BugTracker-2009/Tests/temporary_table_leftover.SF-2734713.stable.err
sql/test/BugTracker-2009/Tests/unique_constraint_on_char.SF-2873564.stable.err
sql/test/BugTracker-2009/Tests/wrong_error_message.SF-2637051.stable.err
sql/test/BugTracker-2010/Tests/TypeException_with_missing_function.Bug-2674.stable.err
sql/test/BugTracker-2010/Tests/call_function_without_warning.Bug-2752.stable.err
sql/test/BugTracker-2010/Tests/copy-into-too-long-string.Bug-2358.stable.err
sql/test/BugTracker-2010/Tests/crash_default_unlocked.Bug-2744.stable.err
sql/test/BugTracker-2010/Tests/crash_on_in_2.Bug-2604.stable.err
sql/test/BugTracker-2010/Tests/crashonschema.Bug-2547.stable.err
sql/test/BugTracker-2010/Tests/duplicate-key.Bug-2667.stable.err
sql/test/BugTracker-2010/Tests/error-truncated.Bug-2615.stable.err
sql/test/BugTracker-2010/Tests/error-truncated.Bug-2615.stable.err.Darwin
sql/test/BugTracker-2010/Tests/error-truncated.Bug-2615.stable.err.Windows
sql/test/BugTracker-2010/Tests/incomplete-utf8-sequence.Bug-2575.stable.err
sql/test/BugTracker-2010/Tests/prepare_stmt.Bug-2533.Bug-2534.stable.err
sql/test/BugTracker-2010/Tests/second_function_existing_signature.Bug-2611.stable.err
sql/test/BugTracker-2010/Tests/select_from_seq.Bug-2730.stable.err
sql/test/BugTracker-2010/Tests/select_star.Bug-2563.stable.err
sql/test/BugTracker-2010/Tests/sequence-restart-with-null.Bug-2648.stable.err
sql/test/BugTracker-2010/Tests/subselect.Bug-2537.stable.err
sql/test/BugTracker-2010/Tests/sum_on_date_crash.Bug-2643.stable.err
sql/test/BugTracker-2010/Tests/times-crash.Bug-2586.stable.err
sql/test/BugTracker-2010/Tests/wrong_error_message_dropping_view.Bug-2713.stable.err
sql/test/BugTracker-2012/Tests/create_function.Bug-3172.stable.err
sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.stable.err
sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090_nogeom.stable.err
sql/test/BugTracker-2012/Tests/table_function_with_column_subselects.Bug-3172.stable.err
sql/test/BugTracker-2013/Tests/All
sql/test/BugTracker-2013/Tests/binary_copy_into.Bug-3345.stable.err
sql/test/BugTracker-2013/Tests/check-constraint.Bug-3335.stable.out
sql/test/BugTracker-2013/Tests/psm_functions_and_accessrights.Bug-3300.stable.err
sql/test/BugTracker/Tests/bind_with_cast.SF-1720934.stable.err
sql/test/BugTracker/Tests/cardinality_violation.SF-1240701.stable.err
sql/test/BugTracker/Tests/cardinality_violation.SF-1240701.stable.err.Windows
sql/test/Dependencies/Tests/Dependencies.stable.err
sql/test/Tests/coalesce.stable.err.single
sql/test/Tests/setoptimizer.stable.err
sql/test/Triggers/Tests/recursive_triggers.stable.err
sql/test/mapi/Tests/python2_test_monetdb_sql.stable.err
sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err
sql/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-table.stable.err
sql/test/ssqq/Tests/insert_queue.stable.err
Branch: mutation
Log Message:
merge with default
diffs (truncated from 2341 to 300 lines):
diff --git a/clients/R/MonetDB.R/R/monetdb.R b/clients/R/MonetDB.R/R/monetdb.R
--- a/clients/R/MonetDB.R/R/monetdb.R
+++ b/clients/R/MonetDB.R/R/monetdb.R
@@ -187,6 +187,8 @@ setMethod("dbSendQuery", signature(conn=
if (!env$success) {
sp <- strsplit(env$message,"!",fixed=T)[[1]]
+ # truncate statement to not hide actual error
message
+ if (nchar(statement) > 100) { statement <-
paste0(substring(statement,1,100),"...") }
if (length(sp) == 3) {
errno <- as.numeric(sp[[2]])
errmsg <- sp[[3]]
diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -146,11 +146,15 @@ static int colormap = 0;
static int fixedmap=1;
static int beat = 50;
static char *sqlstatement = NULL;
+static int batchsize = 1; /* number of queries to combine in one run */
static int batch = 1; /* number of queries to combine in one run */
static lng maxio = 0;
static int cpus = 0;
+static int atlas= 0;
+static int atlaspage = 0;
+static FILE *gnudata;
-static FILE *gnudata;
+static int capturing=0;
static void
usage(void)
@@ -168,7 +172,8 @@ usage(void)
fprintf(stderr, " -i | --input=<profiler event file > \n");
fprintf(stderr, " -o | --output=<file prefix > (default
'tomograph'\n");
fprintf(stderr, " -b | --beat=<delay> in milliseconds (default 50)\n");
- fprintf(stderr, " -B | --batch=<number> of combined queries\n");
+ fprintf(stderr, " -A | --atlas=<number> of pages\n");
+ fprintf(stderr, " -B | --batch=<number> of queries per page\n");
fprintf(stderr, " -a | --adaptive colormap \n");
fprintf(stderr, " -m | --colormap=<userdefined colormap>\n");
fprintf(stderr, " -D | --debug\n");
@@ -229,7 +234,10 @@ stopListening(int i)
mnstr_close(walk->s);
}
}
+ atlaspage= atlas-1;
+ batch = 0;
createTomogram();
+ exit(0);
}
static int
@@ -297,10 +305,8 @@ typedef struct BOX {
int state;
} Box;
-
int threads[MAXTHREADS];
lng lastclk[MAXTHREADS];
-int prevthreads[MAXTHREADS];
Box box[MAXBOX];
int topbox = 0;
@@ -308,9 +314,38 @@ lng totalclkticks = 0; /* number of cloc
lng totalexecticks = 0; /* number of ticks reported for processing */
lng lastclktick = 0;
lng totalticks;
+lng starttime = 0;
+int figures = 0;
+char *currentfunction= 0;
+int object = 1;
+static void resetTomograph(void){
+ static char buf[128];
+ int i;
+ if(atlas) {
+ snprintf(buf,128,"atlas_%02d",++atlaspage);
+ filename = buf;
+ } else
+ filename = "tomograph";
+ if (debug)
+ fprintf(stderr, "RESET tomograph %d\n", atlaspage);
+ for(i=0; i< MAXTHREADS; i++)
+ lastclk[MAXTHREADS]=0;
+ topbox =0;
+ for (i = 0; i < MAXTHREADS; i++)
+ threads[i] = topbox++;
-lng starttime = 0;
+ startrange = 0, endrange = 0;
+ maxio = 0;
+ cpus = 0;
+ batch = batchsize;
+ totalclkticks = 0;
+ totalexecticks = 0;
+ lastclktick = 0;
+ figures = 0;
+ currentfunction = 0;
+ object = 1;
+}
static void dumpbox(int i)
{
@@ -712,8 +747,6 @@ static int cmp_clr ( const void * _one ,
0))));
}
-int object = 1;
-
static void initcolors(FILE *map)
{
int i = 0;
@@ -1402,7 +1435,6 @@ static void createTomogram(void)
char *scalename = "\0\0\0\0";
int digits;
int TME;
- static int figures = 0;
snprintf(buf, BUFSIZ, "%s.gpl", filename);
gnudata = fopen(buf, "w");
@@ -1549,16 +1581,25 @@ static void createTomogram(void)
fprintf(gnudata, "unset multiplot\n");
keepdata(filename);
(void) fclose(gnudata);
+ gnudata = 0;
- if (figures++ == 0) {
- fprintf(stderr, "Created tomogram '%s' \n", buf);
- fprintf(stderr, "Run: 'gnuplot %s.gpl' to create the '%s.pdf'
file\n", buf, filename);
+ // show follow up action only once
+ if (atlas && atlaspage == atlas-1){
+ fprintf(stderr, "Created tomogram atlas\n");
+ for( i = 0; i<= atlas; i++)
+ fprintf(stderr, "gnuplot atlas_%02d.gpl\n",i);
+ fprintf(stderr, "gs -dNOPAUSE -sDEVICE=pdfwrite
-sOUTPUTFILE=atlas.pdf -dBATCH atlas_??.pdf\n");
+ exit(0);
+ } else
+ if (!atlas && figures++ == 0) {
+ fprintf(stderr, "Created tomogram '%s'\n", buf);
+ fprintf(stderr, "Run: 'gnuplot %s.gpl' to create the
'%s.pdf' file\n", buf, filename);
if (tracefile == 0) {
fprintf(stderr, "The memory map is stored in
'%s.dat'\n", filename);
fprintf(stderr, "The trace is saved in '%s.trace' for
use with --trace option\n", filename);
}
+ exit(0);
}
- exit(0);
}
/* the main issue to deal with in the analyse is
@@ -1569,58 +1610,85 @@ static void createTomogram(void)
* A secondary issue is to properly count the functions
* being monitored.
*/
-char *currentfunction= 0;
-static void update(int state, int thread, lng clkticks, lng ticks, lng memory,
lng footprint, lng reads, lng writes, char *fcn, char *stmt)
+static void
+update(int state, int thread, lng clkticks, lng ticks, lng memory, lng
footprint, lng reads, lng writes, char *fcn, char *stmt)
{
int idx;
Box b;
char *s;
/* ignore the flow of control statements 'function' and 'end' */
- if (fcn && strncmp(fcn, "end ", 4) == 0)
+ if (fcn && strncmp(fcn, "end ", 4) == 0) {
return;
+ }
if (starttime == 0) {
/* ignore all instructions up to the first function call,
unless input comes from a file */
- if ( inputfile == NULL && (state >= PING || fcn == 0 ||
strncmp(fcn, "function", 8) != 0))
+ if ( inputfile == NULL && (state >= PING || fcn == 0 ||
strncmp(fcn, "function", 8) )){
return;
+ }
+ if (debug)
+ fprintf(stderr, "Start capturing updates \n");
assert(clkticks >= 0);
starttime = clkticks;
}
/* monitor top level function brackets */
if (state == START && fcn && strncmp(fcn, "function", 8) == 0 ){
- if ( currentfunction == 0) {
+ capturing++;
+ starttime = clkticks;
+ if ( currentfunction == 0)
currentfunction = strdup(fcn+9);
- if (debug)
- fprintf(stderr, "Enter function %s batch %d\n",
currentfunction, batch);
- }
+ if (debug)
+ fprintf(stderr, "Enter function %s capture %d\n",
currentfunction, capturing);
return;
}
if (state == DONE && fcn && strncmp(fcn, "function", 8) == 0 ){
if ( currentfunction && strcmp(currentfunction, fcn+9) == 0){
+ capturing--;
if (debug)
- fprintf(stderr, "Leave function %s batch %d\n",
currentfunction, batch);
+ fprintf(stderr, "Leave function %s capture
%d\n", currentfunction, capturing);
free(currentfunction);
currentfunction = 0;
} else return;
+
if ( batch -- > 1) return;
- deactivateBeat();
+
+ if (atlas == atlaspage){
+ deactivateBeat();
+ createTomogram();
+ totalclkticks = 0; /* number of clock ticks reported */
+ totalexecticks = 0; /* number of ticks reported for
processing */
+ if (fcn && title == 0)
+ title = strdup(fcn + 9);
+ return;
+ }
+ // create a new atlas page
createTomogram();
totalclkticks = 0; /* number of clock ticks reported */
totalexecticks = 0; /* number of ticks reported for processing
*/
- if (fcn && title == 0)
+ if (fcn )
title = strdup(fcn + 9);
+ resetTomograph();
return;
}
if (state == DONE && strncmp(fcn, "profiler.tomograph", 18) == 0) {
if (debug)
fprintf(stderr, "Profiler.tomograph ends %d\n", batch);
- deactivateBeat();
+ if (atlas == atlaspage){
+ deactivateBeat();
+ createTomogram();
+ totalclkticks = 0; /* number of clock ticks reported */
+ totalexecticks = 0; /* number of ticks reported for
processing */
+ return;
+ }
createTomogram();
totalclkticks = 0; /* number of clock ticks reported */
totalexecticks = 0; /* number of ticks reported for processing
*/
+ if (fcn )
+ title = strdup(fcn + 9);
+ resetTomograph();
return;
}
@@ -1639,7 +1707,7 @@ static void update(int state, int thread
}
/* handle a ping event, keep the current instruction in focus */
- if (state >= PING) {
+ if (state >= PING && capturing) {
idx = threads[thread];
b = box[idx];
box[idx].state = state;
@@ -1667,6 +1735,8 @@ static void update(int state, int thread
idx = threads[thread];
/* start of instruction box */
if (state == START && thread < MAXTHREADS) {
+ if (debug)
+ fprintf(stderr, "Start box %s thread %d idx %d box
%d\n", currentfunction, thread,idx,topbox);
box[idx].state = state;
box[idx].thread = thread;
box[idx].clkstart = clkticks;
@@ -1677,6 +1747,8 @@ static void update(int state, int thread
}
/* end the instruction box */
if (state == DONE && thread < MAXTHREADS && fcn && box[idx].fcn &&
strcmp(fcn, box[idx].fcn) == 0) {
+ if (debug)
+ fprintf(stderr, "End box %s thread %d idx %d box %d\n",
currentfunction, thread,idx,topbox);
lastclk[thread] = clkticks;
box[idx].clkend = clkticks;
box[idx].memend = memory;
@@ -2093,7 +2165,7 @@ doProfile(void *d)
/* TOMOGRAPH EXTENSIONS */
i = parser(response);
if (debug )
- fprintf(stderr, "ERROR %d:%s\n", i, response);
+ fprintf(stderr, "PARSE %d:%s\n", i, response);
response = e + 1;
}
/* handle last line in buffer */
@@ -2140,7 +2212,7 @@ main(int argc, char **argv)
wthread *walk;
- static struct option long_options[17] = {
+ static struct option long_options[18] = {
{ "dbname", 1, 0, 'd' },
{ "user", 1, 0, 'u' },
{ "port", 1, 0, 'p' },
@@ -2154,6 +2226,7 @@ main(int argc, char **argv)
{ "debug", 0, 0, 'D' },
{ "beat", 1, 0, 'b' },
{ "batch", 1, 0, 'B' },
+ { "atlas", 1, 0, 'A' },
{ "sql", 1, 0, 's' },
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list