Changeset: a954ebff3c16 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a954ebff3c16
Modified Files:
        clients/mapiclient/eventparser.c
        monetdb5/mal/mal_profiler.c
Branch: Nov2019
Log Message:

Merge branch Apr2019 into Nov2019


diffs (52 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
@@ -144,7 +144,7 @@ renderProfilerEvent(MalBlkPtr mb, MalStk
        str stmt, c;
        str stmtq;
        lng usec= GDKusec();
-       uint64_t microseconds = (uint64_t)startup_time.tv_sec*1000000 + 
(uint64_t)startup_time.tv_usec + (uint64_t)usec;
+       uint64_t microseconds = (uint64_t)usec - 
((uint64_t)startup_time.tv_sec*1000000 - (uint64_t)startup_time.tv_usec);
 
        // ignore generation of events for instructions that are called too 
often
        if(highwatermark && highwatermark + (start == 0) < pci->calls)
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to