Changeset: bad2d6bbca83 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bad2d6bbca83 Modified Files: clients/mapiclient/eventparser.c monetdb5/mal/mal_profiler.c Branch: default Log Message:
Merge with Nov2019 diffs (98 lines): diff --git a/clients/mapiclient/eventparser.c b/clients/mapiclient/eventparser.c --- a/clients/mapiclient/eventparser.c +++ b/clients/mapiclient/eventparser.c @@ -205,12 +205,13 @@ keyvalueparser(char *txt, EventRecord *e *c = 0; } else val =c; - if( strstr(key,"clk")){ + if( strstr(key,"ctime")){ ev->usec = atol(val); return 0; } - if( strstr(key,"ctime")){ + if( strstr(key,"clk")){ time_t sec; + uint64_t microsec; struct tm curr_time; c = strchr(val,'.'); @@ -220,16 +221,17 @@ keyvalueparser(char *txt, EventRecord *e } sec = atol(val); + microsec = sec % 1000000; + sec /= 1000000; #ifdef HAVE_LOCALTIME_R (void)localtime_r(&sec, &curr_time); #else curr_time = *localtime(&sec); #endif ev->time = malloc(DATETIME_CHAR_LENGTH*sizeof(char)); - snprintf(ev->time, DATETIME_CHAR_LENGTH, "%d/%02d/%02d %02d:%02d:%02d.%s", + snprintf(ev->time, DATETIME_CHAR_LENGTH, "%d/%02d/%02d %02d:%02d:%02d.%lu", curr_time.tm_year + 1900, curr_time.tm_mon, curr_time.tm_mday, - curr_time.tm_hour, curr_time.tm_min, curr_time.tm_sec, - c); + curr_time.tm_hour, curr_time.tm_min, curr_time.tm_sec, microsec); ev->clkticks = sec * 1000000; if (c != NULL) { int64_t usec; 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 @@ -36,7 +36,7 @@ static str myname = 0; // avoid tracing /* The JSON rendering can be either using '\n' separators between * each key:value pair or as a single line */ //#define PRETTIFY "\n" -#define PRETTIFY +#define PRETTIFY /* When the MAL block contains a BARRIER block we may end up with tons * of profiler events. To avoid this, we stop emitting the events @@ -149,14 +149,14 @@ renderProfilerEvent(Client cntxt, MalBlk return; } -/* The stream of events can be complete read by the DBA, +/* The stream of events can be complete read by the DBA, * all other users can only see events assigned to their account */ if( malprofileruser!= MAL_ADMIN && malprofileruser != cntxt->user) return; usec= GDKusec(); - microseconds = (uint64_t)startup_time.tv_sec*1000000 + (uint64_t)startup_time.tv_usec + (uint64_t)usec; + microseconds = (uint64_t)usec - ((uint64_t)startup_time.tv_sec*1000000 - (uint64_t)startup_time.tv_usec); /* make profile event tuple */ lognew(); logadd("{"PRETTIFY); // fill in later with the event counter @@ -313,7 +313,7 @@ renderProfilerEvent(Client cntxt, MalBlk This information can be used to determine memory footprint and variable life times. */ -#define PRET +#define PRET #ifdef MALARGUMENTDETAILS // Also show details of the arguments for modelling if(mb){ @@ -726,7 +726,7 @@ getTrace(Client cntxt, const char *nme) void clearTrace(Client cntxt) { - (void) cntxt; + (void) cntxt; MT_lock_set(&mal_profileLock); if (cntxt->profticks == NULL) { MT_lock_unset(&mal_profileLock); @@ -773,8 +773,8 @@ sqlProfilerEvent(Client cntxt, MalBlkPtr if (errors > 0) { /* stop profiling if an error occurred */ cntxt->sqlprofiler = FALSE; - } - + } + MT_lock_unset(&mal_profileLock); GDKfree(stmt); } _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list