updates to speed test
[lttv.git] / trunk / masters-pmf / java_speed_test / c / main.c
index e7bac623d9b14ac641e15b5d6ea35555d1685b5f..a45fc7bd4120e3d825b5a28d630e96a8efd6ada3 100644 (file)
@@ -5,11 +5,16 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
-int main()
+int main(int argc, char **argv)
 {
        int result;
        int fd;
+       int print = 0;
+
+       if(argc >= 2 && !strcmp(argv[1], "-p"))
+               print = 1;
 
        result = fd = open("../trace.dat", O_RDONLY);
        if(result == -1) {
@@ -57,7 +62,8 @@ int main()
                arg1 = *(unsigned short *)args;
                arg2 = args+2;
 
-               printf("timestamp %u id %hu args=(arg1=%hu arg2=\"%s\")\n", timestamp, id, arg1, arg2);
+               if(print)
+                       printf("timestamp %lu id %hu args=(arg1=%hu arg2=\"%s\")\n", timestamp, id, arg1, arg2);
 
                free(args);
        }
This page took 0.022927 seconds and 4 git commands to generate.