Changeset: d9f5a0ae5663 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d9f5a0ae5663
Modified Files:
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        monetdb5/mal/mal_profiler.c
        monetdb5/modules/mal/profiler.c
        monetdb5/modules/mal/profiler.mal
Branch: default
Log Message:

Added first implementation of profiler getlimit and setlimit module functions, 
so the server can start and run tests


diffs (96 lines):

diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -11544,9 +11544,11 @@ stdout of test 'MAL-signatures` in direc
 [ "profiler",  "getSystemTime",        "command profiler.getSystemTime():lng 
",        "CMDgetSystemTime;",    "Obtain the user timing information."   ]
 [ "profiler",  "getTrace",     "pattern profiler.getTrace(e:str):bat[:any_1] 
",        "CMDgetTrace;", "Get the trace details of a specific event"     ]
 [ "profiler",  "getUserTime",  "command profiler.getUserTime():lng ",  
"CMDgetUserTime;",      "Obtain the user timing information."   ]
+[ "profiler",  "getlimit",     "command profiler.getlimit():int ",     
"CMDgetprofilerlimit;", "Set profiler limit"    ]
 [ "profiler",  "noop", "command profiler.noop():void ",        
"CMDnoopProfiler;",     "Fetch any pending performance events"  ]
 [ "profiler",  "openstream",   "pattern profiler.openstream():void ",  
"CMDopenProfilerStream;",       "Start profiling the events, send to output 
stream"     ]
 [ "profiler",  "setheartbeat", "command profiler.setheartbeat(b:int):void ",   
"CMDsetHeartbeat;",     "Set heart beat performance tracing"    ]
+[ "profiler",  "setlimit",     "command profiler.setlimit(l:int):void ",       
"CMDsetprofilerlimit;", "Get profiler limit"    ]
 [ "profiler",  "start",        "pattern profiler.start():void ",       
"CMDstartProfiler;",    "Start offline performance profiling"   ]
 [ "profiler",  "starttrace",   "pattern profiler.starttrace():void ",  
"CMDstartTrace;",       "Start collecting trace information"    ]
 [ "profiler",  "stop", "pattern profiler.stop():void ",        
"CMDstopProfiler;",     "Stop offline performance profiling"    ]
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -15948,9 +15948,11 @@ stdout of test 'MAL-signatures` in direc
 [ "profiler",  "getSystemTime",        "command profiler.getSystemTime():lng 
",        "CMDgetSystemTime;",    "Obtain the user timing information."   ]
 [ "profiler",  "getTrace",     "pattern profiler.getTrace(e:str):bat[:any_1] 
",        "CMDgetTrace;", "Get the trace details of a specific event"     ]
 [ "profiler",  "getUserTime",  "command profiler.getUserTime():lng ",  
"CMDgetUserTime;",      "Obtain the user timing information."   ]
+[ "profiler",  "getlimit",     "command profiler.getlimit():int ",     
"CMDgetprofilerlimit;", "Set profiler limit"    ]
 [ "profiler",  "noop", "command profiler.noop():void ",        
"CMDnoopProfiler;",     "Fetch any pending performance events"  ]
 [ "profiler",  "openstream",   "pattern profiler.openstream():void ",  
"CMDopenProfilerStream;",       "Start profiling the events, send to output 
stream"     ]
 [ "profiler",  "setheartbeat", "command profiler.setheartbeat(b:int):void ",   
"CMDsetHeartbeat;",     "Set heart beat performance tracing"    ]
+[ "profiler",  "setlimit",     "command profiler.setlimit(l:int):void ",       
"CMDsetprofilerlimit;", "Get profiler limit"    ]
 [ "profiler",  "start",        "pattern profiler.start():void ",       
"CMDstartProfiler;",    "Start offline performance profiling"   ]
 [ "profiler",  "starttrace",   "pattern profiler.starttrace():void ",  
"CMDstartTrace;",       "Start collecting trace information"    ]
 [ "profiler",  "stop", "pattern profiler.stop():void ",        
"CMDstopProfiler;",     "Stop offline performance profiling"    ]
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
@@ -919,6 +919,18 @@ void setHeartbeat(int delay)
        ATOMIC_SET(&hbdelay, delay);
 }
 
+/* TODO getprofilerlimit and setprofilerlimit functions */
+
+int getprofilerlimit(void)
+{
+       return 0;
+}
+
+void setprofilerlimit(int limit)
+{
+       (void) limit;
+}
+
 void initProfiler(void)
 {
        gettimeofday(&startup_time, NULL);
diff --git a/monetdb5/modules/mal/profiler.c b/monetdb5/modules/mal/profiler.c
--- a/monetdb5/modules/mal/profiler.c
+++ b/monetdb5/modules/mal/profiler.c
@@ -127,6 +127,22 @@ CMDgetTrace(Client cntxt, MalBlkPtr mb, 
        }
        throw(MAL, "getTrace", SQLSTATE(HY002) RUNTIME_OBJECT_MISSING  "%s", 
path);
 }
+
+str
+CMDgetprofilerlimit(int *res)
+{
+       *res = getprofilerlimit();
+       return MAL_SUCCEED;
+}
+
+str
+CMDsetprofilerlimit(void *res, int *lim)
+{
+       (void) res;
+       setprofilerlimit(*lim);
+       return MAL_SUCCEED;
+}
+
 /*
  * Tracing an active system.
  */
diff --git a/monetdb5/modules/mal/profiler.mal 
b/monetdb5/modules/mal/profiler.mal
--- a/monetdb5/modules/mal/profiler.mal
+++ b/monetdb5/modules/mal/profiler.mal
@@ -26,6 +26,14 @@ command setheartbeat(b:int):void
 address CMDsetHeartbeat
 comment "Set heart beat performance tracing";
 
+command getlimit():int
+address CMDgetprofilerlimit
+comment "Set profiler limit";
+
+command setlimit(l:int):void
+address CMDsetprofilerlimit
+comment "Get profiler limit";
+
 pattern openstream():void
 address CMDopenProfilerStream
 comment "Start profiling the events, send to output stream";
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to