Browse Source

Make statistics only on the part of the trace between start_profiling and stop_profiling

Samuel Thibault 11 years ago
parent
commit
163ef6b095
2 changed files with 22 additions and 6 deletions
  1. 11 3
      tools/starpu_paje_draw_histogram.in
  2. 11 3
      tools/starpu_paje_state_stats.in

+ 11 - 3
tools/starpu_paje_draw_histogram.in

@@ -109,10 +109,17 @@ for file in $inputfiles; do
 	exit 5
     fi
 # Sorting traces
-    grep -e '^\(\(%\)\|\(\(1\|2\|3\|4\|5\|6\|7\|8\|9\)\>\)\)' $file > start.trace
-    grep -e '^\(\(%\)\|\(\(1\|2\|3\|4\|5\|6\|7\|8\|9\)\>\)\)' -v $file > end.trace
+    grep -e '^\(\(%\)\|\(\(1\|2\|3\|4\|5\|6\|7\|8\)\>\)\)' $file > start.trace
+    grep -e '^\(\(%\)\|\(\(1\|2\|3\|4\|5\|6\|7\|8\)\>\)\)' -v $file > end.trace
     sort -s -V --key=2,2 end.trace > endSorted.trace
-    cat start.trace endSorted.trace > outputSorted.trace
+    if grep -q start_profiling endSorted.trace
+    then
+	echo Using start_profiling/stop_profiling trace selection.
+	sed -ne '/start_profiling/,/stop_profiling/p' < endSorted.trace > endSorted2.trace
+    else
+	cp endSorted.trace endSorted2.trace
+    fi
+    cat start.trace endSorted2.trace > outputSorted.trace
 
 # Transferring to .csv
     pj_dump -n outputSorted.trace > $file.csv
@@ -135,3 +142,4 @@ rm -f outputSorted.trace
 rm -f start.trace
 rm -f end.trace
 rm -f endSorted.trace
+rm -f endSorted2.trace

+ 11 - 3
tools/starpu_paje_state_stats.in

@@ -110,10 +110,17 @@ for file in $inputfiles; do
 	exit 5
     fi
 # Sorting traces
-    grep -e '^\(\(%\)\|\(\(1\|2\|3\|4\|5\|6\|7\|8\|9\)\>\)\)' $file > start.trace
-    grep -e '^\(\(%\)\|\(\(1\|2\|3\|4\|5\|6\|7\|8\|9\)\>\)\)' -v $file > end.trace
+    grep -e '^\(\(%\)\|\(\(1\|2\|3\|4\|5\|6\|7\|8\)\>\)\)' $file > start.trace
+    grep -e '^\(\(%\)\|\(\(1\|2\|3\|4\|5\|6\|7\|8\)\>\)\)' -v $file > end.trace
     sort -s -V --key=2,2 end.trace > endSorted.trace
-    cat start.trace endSorted.trace > outputSorted.trace
+    if grep -q start_profiling endSorted.trace
+    then
+	echo Using start_profiling/stop_profiling trace selection.
+	sed -ne '/start_profiling/,/stop_profiling/p' < endSorted.trace > endSorted2.trace
+    else
+	cp endSorted.trace endSorted2.trace
+    fi
+    cat start.trace endSorted2.trace > outputSorted.trace
 
 # Transferring to .csv
     pj_dump -n outputSorted.trace > $file.csv
@@ -136,3 +143,4 @@ rm -f outputSorted.trace
 rm -f start.trace
 rm -f end.trace
 rm -f endSorted.trace
+rm -f endSorted2.trace