9ns: Implement fsync with chan_ctl
[akaros.git] / tests / strace.c
index ab2d798..f9aa624 100644 (file)
@@ -194,6 +194,7 @@ static struct trace_set proc_trace_set = { "proc",
         SYS_change_vcore,
         SYS_notify,
         SYS_self_notify,
+        SYS_send_event,
         SYS_vc_entry,
         SYS_halt_core,
         SYS_pop_ctx,
@@ -219,8 +220,9 @@ static struct trace_set sched_trace_set = { "sched",
 };
 
 static struct trace_set vmm_trace_set = { "vmm",
-       {SYS_vmm_setup,
+       {SYS_vmm_add_gpcs,
         SYS_vmm_poke_guest,
+        SYS_vmm_ctl,
         SYS_pop_ctx,
         0}
 };
@@ -392,6 +394,25 @@ static void build_ignore_list(char *trace_set)
        }
 }
 
+/* Removes the timestamp part of the line.  Use the return string in place of
+ * the full line you pass in. */
+static char *remove_timestamps(char *full_line)
+{
+       char *close_brace;
+
+       /* Format: E [  13655.986589401]-[      0.000000000] Syscall.  The seconds
+        * field may vary in size, so we need to find the second ']'. */
+       close_brace = strchr(full_line, ']');
+       if (!close_brace)
+               return full_line;
+       close_brace = strchr(close_brace + 1, ']');
+       if (!close_brace)
+               return full_line;
+       /* move starting E or X marker */
+       *close_brace = full_line[0];
+       return close_brace;
+}
+
 static void parse_traces(int fd)
 {
        char *line, *_line;
@@ -409,12 +430,8 @@ static void parse_traces(int fd)
                        fprintf(opts.outfile, "%s", _line);
                        continue;
                }
-               if (!opts.with_time) {
-                       /* move starting E or X marker */
-                       _line[40] = _line[0];
-                       /* skip over the timestamp */
-                       _line = &_line[40];
-               }
+               if (!opts.with_time)
+                       _line = remove_timestamps(_line);
                fprintf(opts.outfile, "%s", _line);
        }
        /* This is a little hokey.  If the process exited, then the qio hung up and