Changeset: eff1dd1044aa for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=eff1dd1044aa
Modified Files:
        monetdb5/mal/mal_function.c
        monetdb5/mal/mal_profiler.mx
Branch: default
Log Message:

Make profile stream accessible.


diffs (71 lines):

diff --git a/monetdb5/mal/mal_function.c b/monetdb5/mal/mal_function.c
--- a/monetdb5/mal/mal_function.c
+++ b/monetdb5/mal/mal_function.c
@@ -1039,9 +1039,13 @@ showFlowGraph(MalBlkPtr mb, MalStkPtr st
                bufstr = buffer_create(8096);
                f = buffer_wastream(bufstr, "bufstr_write");
                mapimode = 1;
+       } else if (idcmp(fname, "stethoscope") == 0) {
+               f = getProfilerStream();
        } else {
                f = open_wastream(fname);
        }
+       if ( f == NULL)
+               return;
        p = getInstrPtr(mb, 0);
        mnstr_printf(f, "digraph %s {\n", getFunctionId(p));
        p = getInstrPtr(mb, 0);
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
@@ -263,6 +263,7 @@ mal_export void setFilterOnBlock(MalBlkP
 mal_export void clrFilter(Module cntxt, str mod, str fcn);
 mal_export void setFilterVariable(MalBlkPtr mb, int i);
 mal_export void clrFilterVariable(MalBlkPtr mb, int i);
+mal_export stream getProfilerStream();
 
 mal_export void MPresetProfiler(stream *fdout);
 
@@ -307,7 +308,7 @@ mal_export void _initTrace(void);
 #include "mal_profiler.h"
 #include "mal_debugger.h"
 
-static stream *eventstream = 0;
+stream *eventstream = 0;
 
 static int offlineProfiling = FALSE;
 static int cachedProfiling = FALSE;
@@ -344,6 +345,7 @@ static int delayswitch = 0; /* to wait b
 #define PROFuser    15
 #define PROFstart   16
 #define PROFtype    17
+#define PROFdot     18
 
 static struct {
        str name;               /* which logical counter is needed */
@@ -367,7 +369,8 @@ static struct {
        /*  15 */  { "user", 0},
        /*  16 */  { "start", 0},
        /*  17 */  { "type", 0},
-       /*  18 */  { 0, 0}
+       /*  18 */  { "dot", 0},
+       /*  19 */  { 0, 0}
 };
 
 /*
@@ -829,6 +832,15 @@ MPresetProfiler(stream *fdout)
 }
 
 /*
+ * Extern sources may dump information on the profiler stream
+*/
+stream
+getProfilerStream()  
+{
+       return eventstream;
+}
+
+/*
  * @-
  * Performance tracing is triggered on an instruction basis
  * or a the global flag 'profileAll' being set.
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to