Log profiler: add support for writing to an existing file descriptor.
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Fri, 14 Oct 2011 21:27:14 +0000 (23:27 +0200)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Wed, 26 Oct 2011 13:02:31 +0000 (15:02 +0200)
mono/profiler/log-profiler.txt
mono/profiler/proflog.c

index 3ef5dcb74994f0b9875e7f94b9e94b09dbc85abb..10140c6b3bbcab47fc007d8b870f4b9471650880 100644 (file)
@@ -133,6 +133,8 @@ date and time, then do according to *OUTSPEC*:
        and feed the data to its standard input
        * if *OUTSPEC* begins with a *-* character, use the rest of OUTSPEC as
        the filename, but force overwrite any existing file by that name
+       * if *OUTSPEC* begins with a *#* character, use the rest of OUTSPEC as a
+       file descriptor and feed the data to it.
        * otherwise write the data the the named file: note that is a file by that
        name already exists, a warning is issued and profiling is disabled.
 
index 5a539ce8c0ff015ab9571183bebbd2fa28f23402..da74a2f462c5b361f79af32ebf1f491c860c2dde 100644 (file)
@@ -1997,6 +1997,9 @@ create_profiler (const char *filename)
        if (*nf == '|') {
                prof->file = popen (nf + 1, "w");
                prof->pipe_output = 1;
+       } else if (*nf == '#') {
+               int fd = strtol (nf + 1, NULL, 10);
+               prof->file = fdopen (fd, "a");
        } else {
                FILE *f;
                if (force_delete)