Changeset: 59042ddcfe06 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/59042ddcfe06 Modified Files: monetdb5/mal/mal_profiler.c monetdb5/mal/mal_runtime.c monetdb5/mal/mal_runtime.h Branch: default Log Message:
Removed workingset array. This is the penultimate step in removing compile-time restrictions on the number of threads. diffs (136 lines): 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 @@ -721,8 +721,6 @@ profilerEvent(MalEvent *me, NonMalEvent str openProfilerStream(Client cntxt, int m) { - int j; - #ifdef HAVE_SYS_RESOURCE_H getrusage(RUSAGE_SELF, &infoUsage); prevUsage = infoUsage; @@ -759,29 +757,6 @@ openProfilerStream(Client cntxt, int m) maleventstream = cntxt->fdout; profilerUser = cntxt->user; - // Ignore the JSON rendering mode, use compiled time version - - /* show all in progress instructions for stethoscope startup */ - /* wait a short time for instructions to finish updating their thread admin - * and then follow the locking scheme */ - - MT_sleep_ms(200); - - for (j = 0; j < THREADS; j++) { - struct MalEvent me = { - .cntxt = workingset[j].cntxt, - .mb = workingset[j].mb, - .stk = workingset[j].stk, - .pci = workingset[j].pci, - .clk = workingset[j].clock, - }; - if (me.cntxt && me.mb && me.stk && me.pci) { - /* show the event assuming the quintuple is aligned */ - MT_lock_unset(&mal_profileLock); - profilerEvent(&me, NULL); - MT_lock_set(&mal_profileLock); - } - } MT_lock_unset(&mal_profileLock); return MAL_SUCCEED; } diff --git a/monetdb5/mal/mal_runtime.c b/monetdb5/mal/mal_runtime.c --- a/monetdb5/mal/mal_runtime.c +++ b/monetdb5/mal/mal_runtime.c @@ -346,43 +346,19 @@ mal_runtime_reset(void) dropUSRstats(); } -/* - * Each MAL instruction is executed by a single thread, which means we can - * keep a simple working set around to make Stethscope attachement easy. - * The entries are privately accessed and only can be influenced by a starting stehoscope to emit work in progress. - */ -Workingset workingset[THREADS]; - /* At the start of each MAL stmt */ void runtimeProfileBegin(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci, RuntimeProfile prof) { - MT_Id tid = MT_getpid(); - lng clk = GDKusec(); + (void) cntxt; + (void) mb; + (void) stk; + (void) pci; assert(pci); - /* keep track on the instructions taken in progress for stethoscope */ - if (tid > 0 && tid <= THREADS) { - tid--; - if (profilerStatus) { - MT_lock_set(&mal_profileLock); - workingset[tid].cntxt = cntxt; - workingset[tid].mb = mb; - workingset[tid].stk = stk; - workingset[tid].pci = pci; - workingset[tid].clock = clk; - MT_lock_unset(&mal_profileLock); - } else { - workingset[tid].cntxt = cntxt; - workingset[tid].mb = mb; - workingset[tid].stk = stk; - workingset[tid].pci = pci; - workingset[tid].clock = clk; - } - } /* always collect the MAL instruction execution time */ - prof->ticks = clk; + prof->ticks = GDKusec(); } /* At the end of each MAL stmt */ @@ -390,21 +366,8 @@ void runtimeProfileExit(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci, RuntimeProfile prof) { - MT_Id tid = MT_getpid(); lng ticks = GDKusec(); - /* keep track on the instructions in progress */ - if (tid > 0 && tid <= THREADS) { - tid--; - if (profilerStatus) { - MT_lock_set(&mal_profileLock); - workingset[tid] = (struct WORKINGSET) { 0 }; - MT_lock_unset(&mal_profileLock); - } else { - workingset[tid] = (struct WORKINGSET) { 0 }; - } - } - if (profilerStatus > 0) profilerEvent(&(struct MalEvent) { cntxt, mb, stk, pci, ticks, ticks - prof->ticks }, diff --git a/monetdb5/mal/mal_runtime.h b/monetdb5/mal/mal_runtime.h --- a/monetdb5/mal/mal_runtime.h +++ b/monetdb5/mal/mal_runtime.h @@ -59,16 +59,6 @@ typedef struct USERSTAT { } *UserStats; extern size_t usrstatscnt; -typedef struct WORKINGSET { - Client cntxt; - MalBlkPtr mb; - MalStkPtr stk; - InstrPtr pci; - lng clock; /* start time */ -} Workingset; - -extern Workingset workingset[THREADS]; - extern void runtimeProfileInit(Client cntxt, MalBlkPtr mb, MalStkPtr stk); extern void runtimeProfileFinish(Client cntxt, MalBlkPtr mb, MalStkPtr stk); extern void runtimeProfileBegin(Client cntxt, MalBlkPtr mb, MalStkPtr stk, _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org