Add trace reordering script.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/utils/trace-reorder.py Fri Jul 03 11:44:52 2009 +0200
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+# coding: utf-8
+
+'''
+Copyright (C) 2009 Guillaume Seguin <guillaume@segu.in>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+Authors :
+ Guillaume Seguin <guillaume@segu.in>
+'''
+
+import sys
+
+if len (sys.argv) != 2:
+ print "Usage : %s ASCIITRACEFILE" % sys.argv[0]
+ raise SystemExit
+
+f = open (sys.argv[1])
+lines = f.readlines ()
+sets = {}
+for line in lines:
+ bits = line.split (" ")
+ date, context = bits[1:3]
+ key = float (date), int (context)
+ if key not in sets:
+ sets[key] = []
+ sets[key].append (line)
+
+f = open (sys.argv[1], "w")
+for key in sorted (sets.keys ()):
+ for line in sets[key]:
+ f.write (line)