Changeset: 9c6207bbd5aa for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9c6207bbd5aa
Modified Files:
monetdb5/mal/mal.h
monetdb5/mal/mal_interpreter.mx
monetdb5/mal/mal_profiler.mx
Branch: default
Log Message:
Trace dataflow resource claims
Shows claims made by parallel threads and the total estimated memory claim
diffs (87 lines):
diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h
--- a/monetdb5/mal/mal.h
+++ b/monetdb5/mal/mal.h
@@ -45,13 +45,16 @@
* @
*/
#define MAXSCRIPT 64
+#define MEMORY_THRESHOLD 0.8
-mal_export char monet_cwd[PATHLENGTH];
-mal_export int monet_welcome;
-mal_export str *monet_script;
-mal_export int monet_daemon;
-mal_export size_t monet_memory;
-mal_export int nrservers;
+mal_export char monet_cwd[PATHLENGTH];
+mal_export int monet_welcome;
+mal_export str *monet_script;
+mal_export int monet_daemon;
+mal_export size_t monet_memory;
+mal_export int nrservers;
+mal_export lng memorypool; /* memory claimed by
concurrent threads */
+mal_export int memoryclaims; /* number of threads active
with expensive operations */
#define mal_set_lock(X,Y) if(GDKprotected) MT_lock_set(&X,Y)
#define mal_unset_lock(X,Y) if(GDKprotected) MT_lock_unset(&X,Y)
diff --git a/monetdb5/mal/mal_interpreter.mx b/monetdb5/mal/mal_interpreter.mx
--- a/monetdb5/mal/mal_interpreter.mx
+++ b/monetdb5/mal/mal_interpreter.mx
@@ -78,13 +78,11 @@ mal_export ptr getArgReference(MalStkPtr
static str runMALsequence(Client cntxt, MalBlkPtr mb, int startpc, int stoppc,
MalStkPtr stk, MalStkPtr env, InstrPtr pcicaller);
static void displayVolume(Client cntxt, lng vol);
-#define MEMORY_THRESHOLD 0.8
-
#define USE_DFLOW_ADMISSION
+/* does not seem to have a major impact */
+lng memorypool = 0; /* memory claimed by concurrent threads */
+int memoryclaims = 0; /* number of threads active with expensive operations
*/
#ifdef USE_DFLOW_ADMISSION
-/* does not seem to have a major impact */
-static lng memorypool; /* memory claimed by concurrent threads */
-static int memoryclaims = 0; /* number of threads active with expensive
operations */
mal_export int DFLOWadmission(lng argclaim, lng hotclaim);
#endif
diff --git a/monetdb5/mal/mal_profiler.mx b/monetdb5/mal/mal_profiler.mx
--- a/monetdb5/mal/mal_profiler.mx
+++ b/monetdb5/mal/mal_profiler.mx
@@ -346,6 +346,7 @@ static int delayswitch = 0; /* to wait b
#define PROFstart 16
#define PROFtype 17
#define PROFdot 18
+#define PROFflow 19
static struct {
str name; /* which logical counter is needed */
@@ -370,7 +371,8 @@ static struct {
/* 16 */ { "start", 0},
/* 17 */ { "type", 0},
/* 18 */ { "dot", 0},
- /* 19 */ { 0, 0}
+ /* 19 */ { "flow", 0},
+ /* 20 */ { 0, 0}
};
/*
@@ -464,6 +466,8 @@ offlineProfilerHeader(void)
if (profileCounter[PROFthread].status) {
log0("thread,\t");
}
+ if (profileCounter[PROFflow].status)
+ log0("claim,\tmemory,\t");
if (profileCounter[PROFfunc].status) {
log0("function,\t");
}
@@ -590,6 +594,10 @@ offlineProfilerEvent(int idx, MalBlkPtr
if (profileCounter[PROFthread].status) {
log(" %d,\t", THRgettid());
}
+ if (profileCounter[PROFflow].status) {
+ log("%d,\t", memoryclaims);
+ log(LLFMT",\t", memoryclaims?((lng)(MEMORY_THRESHOLD *
monet_memory)-memorypool)/1024/1024:0);
+ }
if (profileCounter[PROFfunc].status) {
if (getModuleId(pci) && getFunctionId(pci)) {
log2("\"%s.%s\",\t",
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list