#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) {
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);
}
byte[] arg2 = new byte[strlen];
eargs_data.readFully(arg2, 0, strlen);
- //System.out.printf("timestamp %d id %d args=(short=%d string=\"%s\") %n", timestamp, id, arg1, new String(arg2));
- String strout = String.format("timestamp %d id %d args=(short=%d string=\"%s\") %n", timestamp, id, arg1, new String(arg2));
- tmp += strout.length();
+ if(args.length>0 && args[0].equals("-p"))
+ System.out.printf("timestamp %d id %d args=(short=%d string=\"%s\") %n", timestamp, id, arg1, new String(arg2));
}
}
}
//file_input.close();
- System.out.println(tmp);
}
}