Changeset: 5d1a5c97e216 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5d1a5c97e216 Modified Files: clients/mapiclient/tomograph.c monetdb5/mal/mal_profiler.c Branch: Feb2013 Log Message:
Minor fixes in debugging tomograph (transplanted from 8249a643f873bc7f5f18398bc0069d8d215af2e6) diffs (82 lines): diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c --- a/clients/mapiclient/tomograph.c +++ b/clients/mapiclient/tomograph.c @@ -1280,21 +1280,17 @@ static int parser(char *row) static void format_result(Mapi mid, MapiHdl hdl) { - char *reply; char *line; (void) mid; do { /* handle errors first */ - if ((reply = mapi_result_error(hdl)) != NULL) { + if (mapi_result_error(hdl) != NULL) { mapi_explain_result(hdl, stderr); /* don't need to print something like '0 * tuples' if we got an error */ break; } - if (debug) - fprintf(stderr, "Receive:%s\n", reply); - switch (mapi_get_querytype(hdl)) { case Q_BLOCK: case Q_PARSE: @@ -1316,8 +1312,6 @@ format_result(Mapi mid, MapiHdl hdl) } } } while (mapi_next_result(hdl) == 1); - if (debug) - fprintf(stderr, "Done\n"); } static int @@ -1492,7 +1486,7 @@ doProfile(void *d) *e = 0; /* TOMOGRAPH EXTENSIONS */ i = parser(response); - if (debug && i) + if (debug ) fprintf(stderr, "ERROR %d:%s\n", i, response); response = e + 1; } 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 @@ -159,20 +159,19 @@ deactivateCounter(str name) * It uses a local logbuffer[LOGLEN] and logbase, logtop, loglen */ #define LOGLEN 8192 -#define lognew() loglen = 0; logbase = logbuffer; +#define lognew() loglen = 0; logbase = logbuffer; *logbase = 0; #define logadd(...) \ do { \ (void) snprintf(logbase+loglen, LOGLEN -1 - loglen, __VA_ARGS__); \ loglen += (int) strlen(logbase+loglen); \ } while (0) #define logsent() \ - do { \ + do { assert(loglen <= LOGLEN); \ MT_lock_set(&mal_profileLock, "profileLock"); \ - if (eventstream) \ - if (mnstr_write(eventstream, logbuffer,loglen,1 ) < 0) { \ - closeProfilerStream(); \ - } \ - flushLog(); \ + if (eventstream) { \ + (void)mnstr_write(eventstream, logbuffer,loglen,1 );\ + mnstr_flush(eventstream); \ + } \ eventcounter++; \ MT_lock_unset(&mal_profileLock, "profileLock"); \ } while (0) @@ -1123,7 +1122,6 @@ cachedProfilerEvent(int idx, MalBlkPtr m TRACE_id_wbytes = BUNappend(TRACE_id_wbytes, &mb->profiler[pc].wbytes, FALSE); eventcounter++; - flushLog(); MT_lock_unset(&mal_profileLock, "profileLock"); } /* _______________________________________________ checkin-list mailing list checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list