]> rtime.felk.cvut.cz Git - can-benchmark.git/commitdiff
lib: Add echo_plot() to make plotting of multiple graphs easier
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 1 Dec 2010 11:55:27 +0000 (12:55 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 1 Dec 2010 11:55:27 +0000 (12:55 +0100)
gw-tests/gw-filter.sh
gw-tests/lib.sh

index bebdc3f260e44be2f067d3d6ff0eff9317c50d5f..757f328107ef1436c048f31fcb8e6711a08b07a1 100755 (executable)
@@ -22,11 +22,9 @@ plot [0:1500] [1:$COUNT] \\
 EOF
     lt=1
     for i in $ids; do
-       (( i != 0)) && echo ", \\"
-       echo -n "    " \"hist-$i.dat\" with lp lt $lt title \"Message id $i\"
+       echo_plot "\"hist-$i.dat\" with lp lt $lt title \"Message id $i\""
         lt=$((lt+1))
     done
-    echo
 }
     
 test_end
index 439ddc7ed6a50674a6049c882af63f419fb1a001..cacde470a1f440d1df93b0078f7720938384c8d3 100644 (file)
@@ -65,6 +65,13 @@ create_dirs_and_links() {
     echo $d
 }
 
+echo_plot() {
+    plot=$1
+    [[ "$_plot_separator" ]] && echo ", \\"
+    _plot_separator=t
+    echo -n "    " $plot
+}
+
 _run() {
     if [[ ! "$OPT_PLOT_ONLY" ]]; then
        kernel_versions=$(sshgw uname -r)