Changeset: 5f0f6b3d714d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5f0f6b3d714d
Modified Files:
        clients/mapiclient/mclient.c
        clients/mapiclient/stethoscope.c
        clients/mapiclient/tachograph.c
        monetdb5/mal/mal_profiler.c
        monetdb5/modules/mal/profiler.mal
Branch: profiler
Log Message:

Sync


diffs (157 lines):

diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -69,8 +69,7 @@
 
 enum modes {
        MAL,
-       SQL,
-       PROFILER
+       SQL
 };
 
 static enum modes mode = SQL;
@@ -2112,8 +2111,6 @@ doFileBulk(Mapi mid, FILE *fp)
 static void
 showCommands(void)
 {
-       if (mode == PROFILER)
-               return;
        /* shared control options */
        mnstr_printf(toConsole, "\\?      - show this message\n");
        if (mode == MAL)
@@ -2973,7 +2970,7 @@ usage(const char *prog, int xit)
        fprintf(stderr, " -f kind     | --format=kind      specify output 
format {csv,tab,raw,sql,xml}\n");
        fprintf(stderr, " -H          | --history          load/save cmdline 
history (default off)\n");
        fprintf(stderr, " -i          | --interactive[=tm] interpret `\\' 
commands on stdin, use time formatting {ms,s,m}\n");
-       fprintf(stderr, " -l language | --language=lang    
{sql,mal,profiler}\n");
+       fprintf(stderr, " -l language | --language=lang    {sql,mal}\n");
        fprintf(stderr, " -L logfile  | --log=logfile      save client/server 
interaction\n");
        fprintf(stderr, " -s stmt     | --statement=stmt   run single 
statement\n");
        fprintf(stderr, " -X          | --Xdebug           trace mapi network 
interaction\n");
@@ -3140,12 +3137,8 @@ main(int argc, char **argv)
                                free(language);
                                language = strdup("msql");
                                mode = MAL;
-                       } else if (strcmp(optarg, "profiler") == 0) {
-                               free(language);
-                               language = strdup("profiler");
-                               mode = MAL;
                        } else {
-                               fprintf(stderr, "language option needs to be 
sql, mal, or profiler\n");
+                               fprintf(stderr, "language option needs to be 
sql or mal\n");
                                exit(-1);
                        }
                        break;
diff --git a/clients/mapiclient/stethoscope.c b/clients/mapiclient/stethoscope.c
--- a/clients/mapiclient/stethoscope.c
+++ b/clients/mapiclient/stethoscope.c
@@ -171,7 +171,7 @@ main(int argc, char **argv)
        FILE *trace = NULL;
        EventRecord *ev = malloc(sizeof(EventRecord));
 
-       static struct option long_options[15] = {
+       static struct option long_options[10] = {
                { "dbname", 1, 0, 'd' },
                { "user", 1, 0, 'u' },
                { "port", 1, 0, 'p' },
@@ -195,7 +195,7 @@ main(int argc, char **argv)
 
        while (1) {
                int option_index = 0;
-               int c = getopt_long(argc, argv, "d:u:p:P:h:?:o:D:b",
+               int c = getopt_long(argc, argv, "d:u:p:P:h:?o:Db:",
                                        long_options, &option_index);
                if (c == -1)
                        break;
@@ -297,7 +297,7 @@ main(int argc, char **argv)
                fprintf(stderr,"-- connection with server %s\n", uri ? uri : 
host);
 
        for (portnr = 50010; portnr < 62010; portnr++) 
-               if ((conn = udp_rastream(hostname, portnr, "profileStream")) != 
NULL)
+               if ((conn = open_rastream(hostname, portnr)) != NULL)
                        break;
        
        if ( conn == NULL) {
@@ -308,18 +308,14 @@ main(int argc, char **argv)
 
        printf("-- opened TCP profile stream %s:%d for %s\n", hostname, portnr, 
host);
 
-       snprintf(buf, BUFSIZ, " port := profiler.setstream(\"%s\", %d);", 
hostname, portnr);
-       if( debug)
-               fprintf(stderr,"--%s\n",buf);
-       doQ(buf);
-
        snprintf(buf,BUFSIZ-1,"profiler.setheartbeat(%d);",beat);
        if( debug)
                fprintf(stderr,"-- %s\n",buf);
        doQ(buf);
-       snprintf(buf,BUFSIZ-1,"profiler.start();");
+
+       snprintf(buf, BUFSIZ, " profiler.setstream(\"%s\", %d);", hostname, 
portnr);
        if( debug)
-               fprintf(stderr,"-- %s\n",buf);
+               fprintf(stderr,"--%s\n",buf);
        doQ(buf);
 
        snprintf(buf,BUFSIZ,"%s.trace",basefilename);
diff --git a/clients/mapiclient/tachograph.c b/clients/mapiclient/tachograph.c
--- a/clients/mapiclient/tachograph.c
+++ b/clients/mapiclient/tachograph.c
@@ -413,7 +413,7 @@ main(int argc, char **argv)
 
        while (1) {
                int option_index = 0;
-               int c = getopt_long(argc, argv, "d:u:p:P:h:?:b:i:o:c:q:w:D",
+               int c = getopt_long(argc, argv, "d:u:p:P:h:?:o:q:w:D",
                                        long_options, &option_index);
                if (c == -1)
                        break;
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
@@ -118,7 +118,8 @@ setProfilerStream(Module cntxt, const ch
 {
        (void)cntxt;        /* still unused */
        MT_lock_set(&mal_profileLock, "setstream");
-       if ((eventstream = udp_wastream(host, port, "profileStream")) == NULL) {
+       //if ((eventstream = udp_wastream(host, port, "profileStream")) == 
NULL) {
+       if ((eventstream = wastream(host, port, "profileStream")) == NULL) {
                MT_lock_unset(&mal_profileLock, "setstream");
                throw(IO, "mal.profiler", RUNTIME_STREAM_FAILED);
        }
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
@@ -10,13 +10,13 @@ pattern tomograph(b:int)
 address CMDtomograph
 comment "Start tomograph profiler with heart beat";
 
-pattern tachograph(start:bit)
-address CMDtachograph
-comment "Start/stop gathering profile traces "'
+#pattern tachograph(start:bit)
+#address CMDtachograph
+#comment "Start/stop gathering profile traces "'
 
-pattern stethoscope(start:int)
-address CMDstethoscope
-comment "Start/stop gathering profile traces "'
+#pattern stethoscope(start:int)
+#address CMDstethoscope
+#comment "Start/stop gathering profile traces "'
 
 pattern start()
 address CMDstartProfiler
@@ -42,10 +42,9 @@ pattern setstream(host:str, port:int):vo
 address CMDsetProfilerStream
 comment "Send the log events to a stream ";
 
-# legacy
 pattern openStream(host:str, port:int):void
 address CMDsetProfilerStream
-comment "Send the log events to a stream ";
+comment "Send the log events to a client calling ";
 
 command closeStream():void
 address CMDcloseProfilerStream
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to