Changeset: 5f574090b78c for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5f574090b78c Modified Files: clients/Tests/exports.stable.out clients/mapiclient/eventparser.c clients/mapiclient/eventparser.h clients/mapiclient/tachograph.c monetdb5/mal/mal.c monetdb5/mal/mal.h monetdb5/mal/mal_profiler.c tools/mserver/mserver5.c Branch: default Log Message:
Capture some system properties Keep the monet_hello message around and sent it for consumption to the profilers. This could ease off-line analysis of the performance. diffs (206 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 @@ -2319,6 +2319,7 @@ int isLoaded(str modulename); int isLoopBarrier(MalBlkPtr mb, int pc); int isMapOp(InstrPtr q); int isMatJoinOp(InstrPtr q); +int isMatLeftJoinOp(InstrPtr q); int isModuleDefined(Module scope, str name); int isMultiplex(InstrPtr q); int isNotUsedIn(InstrPtr p, int start, int a); @@ -2446,6 +2447,7 @@ int mnstr_writeInt_wrap(Stream *S, int * str mnstr_writeIntwrap(void *ret, Stream *S, int *data); int mnstr_write_string(Stream *S, str data); str mnstr_write_stringwrap(void *ret, Stream *S, str *data); +char monet_characteristics[PATHLENGTH]; char monet_cwd[PATHLENGTH]; size_t monet_memory; void moveInstruction(MalBlkPtr mb, int pc, int target); @@ -2681,6 +2683,7 @@ str subdeltaRef; str subgroupRef; str subgroupdoneRef; str subjoinRef; +str subleftjoinRef; str submaxRef; str submedianRef; str subminRef; diff --git a/clients/mapiclient/eventparser.c b/clients/mapiclient/eventparser.c --- a/clients/mapiclient/eventparser.c +++ b/clients/mapiclient/eventparser.c @@ -17,6 +17,7 @@ int malargtop; char *malvariables[MAXMALARGS]; int malvartop; int debug; +char *monet_characteristics; void clearArguments(void) @@ -105,8 +106,11 @@ eventparser(char *row, EventRecord *ev) struct tm stm; /* check basic validaty first */ - if (row[0] =='#') + if (row[0] =='#'){ + if( row[1] =='{') + monet_characteristics = strdup(row+1); return 0; + } if (row[0] != '[') return -1; if ((cc= strrchr(row,']')) == 0 || *(cc+1) !=0) diff --git a/clients/mapiclient/eventparser.h b/clients/mapiclient/eventparser.h --- a/clients/mapiclient/eventparser.h +++ b/clients/mapiclient/eventparser.h @@ -93,6 +93,7 @@ extern int malargtop; extern char *malvariables[MAXMALARGS]; extern int malvartop; extern int debug; +extern char *monet_characteristics; extern void clearArguments(void); extern int eventparser(char *row, EventRecord *ev); diff --git a/clients/mapiclient/tachograph.c b/clients/mapiclient/tachograph.c --- a/clients/mapiclient/tachograph.c +++ b/clients/mapiclient/tachograph.c @@ -64,7 +64,7 @@ static stream *conn = NULL; static char hostname[128]; -static char *basefilename = "tacho"; +static char *basefilename = "tachograph"; static char *cache= "cache"; static char *dbname; static int beat = 5000; @@ -478,6 +478,8 @@ initFiles(void) fprintf(stderr,"Could not create %s\n",buf); exit(0); } + if( monet_characteristics) + fprintf(tachotrace,"%s\n",monet_characteristics); } static void diff --git a/monetdb5/mal/mal.c b/monetdb5/mal/mal.c --- a/monetdb5/mal/mal.c +++ b/monetdb5/mal/mal.c @@ -12,6 +12,7 @@ char monet_cwd[PATHLENGTH] = { 0 }; size_t monet_memory; +char monet_characteristics[PATHLENGTH]; char *mal_trace; /* enable profile events on console */ #include "mal_stack.h" diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h --- a/monetdb5/mal/mal.h +++ b/monetdb5/mal/mal.h @@ -42,6 +42,7 @@ mal_export char monet_cwd[PATHLENGTH]; mal_export size_t monet_memory; +mal_export char monet_characteristics[PATHLENGTH]; mal_export lng memorypool; /* memory claimed by concurrent threads */ mal_export int memoryclaims; /* number of threads active with expensive operations */ mal_export char *mal_trace; /* enable profile events on console */ 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 @@ -55,9 +55,11 @@ offlineProfilerHeader(void) char logbuffer[LOGLEN], *logbase; int loglen; - if (eventstream == NULL) { + if (eventstream == NULL) return ; - } + mnstr_printf(eventstream,"%s\n", monet_characteristics); + mnstr_flush(eventstream); + lognew(); logadd("# "); logadd("event,\t"); @@ -81,10 +83,8 @@ offlineProfilerHeader(void) #endif logadd("stmt,\t"); logadd("# name \n"); - if (eventstream){ - mnstr_printf(eventstream,"%s\n", logbuffer); - mnstr_flush(eventstream); - } + mnstr_printf(eventstream,"%s\n", logbuffer); + mnstr_flush(eventstream); } /* @@ -94,6 +94,7 @@ offlineProfilerHeader(void) * To avoid unnecessary locks we first build the event as a string * It uses a local logbuffer[LOGLEN] and logbase, logtop, loglen */ + static void logsend(char *logbuffer) { int error=0; if (eventstream) { @@ -205,9 +206,9 @@ offlineProfilerEvent(MalBlkPtr mb, MalSt logadd(LLFMT ",\t", pci? pci->wbytes/1024/1024:0); #ifdef NUMAprofiling - if( alter) + if( alter){ logadd("\"\",\t"); - }else { + } else { logadd("\""); for( i= pci->retc ; i < pci->argc; i++) if( !isVarConstant(mb, getArg(pci,i)) && mb->var[getArg(pci,i)]->worker) diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c --- a/tools/mserver/mserver5.c +++ b/tools/mserver/mserver5.c @@ -104,6 +104,9 @@ usage(char *prog, int xit) exit(xit); } +/* + * Collect some global system properties to relate performance results later + */ static void monet_hello(void) { @@ -112,10 +115,10 @@ monet_hello(void) #else char *linkinfo = "dynamically"; #endif - dbl sz_mem_h; char *qc = " kMGTPE"; int qi = 0; + size_t len; monet_memory = MT_npages() * MT_pagesize(); sz_mem_h = (dbl) monet_memory; @@ -150,6 +153,25 @@ monet_hello(void) printf("# Copyright (c) 1993-July 2008 CWI.\n"); printf("# Copyright (c) August 2008-2015 MonetDB B.V., all rights reserved\n"); printf("# Visit http://www.monetdb.org/ for further information\n"); + + // The properties shipped through the performance profiler + snprintf(monet_characteristics, PATHLENGTH-1, "#{ MonetDBversion:\"%s\", ", VERSION); + len = strlen(monet_characteristics); + snprintf(monet_characteristics + len, PATHLENGTH-1-len, "release:\"%s\", ", MONETDB_RELEASE); + len = strlen(monet_characteristics); + snprintf(monet_characteristics + len, PATHLENGTH-1-len, "host:\"%s\", ", HOST); + len = strlen(monet_characteristics); + snprintf(monet_characteristics + len, PATHLENGTH-1-len, "threads:\"%d\", ", GDKnr_threads); + len = strlen(monet_characteristics); + snprintf(monet_characteristics + len, PATHLENGTH-1-len, "memory:\"%.3f %cB\", ", sz_mem_h, qc[qi]); + len = strlen(monet_characteristics); + snprintf(monet_characteristics + len, PATHLENGTH-1-len, "oid:\""SZFMT"\", ", sizeof(oid) *8); + len = strlen(monet_characteristics); +#ifdef HAVE_HGE + snprintf(monet_characteristics + len, PATHLENGTH-1-len, "huge:\"\""); + len = strlen(monet_characteristics); +#endif + snprintf(monet_characteristics + len, PATHLENGTH-1-len, "}"); } static str _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list