Add kernel cmdline to kernel identifier
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 27 Aug 2009 17:07:17 +0000 (19:07 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 27 Aug 2009 17:07:17 +0000 (19:07 +0200)
tests/_lib.sh

index 987d753..64620c0 100644 (file)
@@ -85,10 +85,24 @@ run_tests() {
     done
 }
 
+kvers() {
+    local cmdline=$(cat /proc/cmdline|sed -e 's/BOOT_IMAGE=[^ ]*//' \
+                                         -e 's/root=[^ ]*//' \
+                                         -e 's/ro//' \
+                                         -e 's/quiet//' \
+                                         -e 's/rootfstype=[^ ]*//' \
+                                         -e 's/elevator=[^ ]*//' \
+                                         -e 's/^ *//' \
+                                         -e 's/ *$//'|tr -s ' ' '_')
+    v=$(uname -r)
+    [ -n "$cmdline" ] && v="$v:$cmdline"
+    echo $v
+}
+
 plot() {
     for i in "${!PLOT_CMD[@]}"; do
        cmd="${PLOT_CMD[$i]}";
-       cmd=$(echo "$cmd" | sed -e "/set title/ s/[\"']\(.*\)[\"']/'\1 ($(uname -r), CPU\\\\@${clk}Mhz)'/")
+       cmd=$(echo "$cmd" | sed -e "/set title/ s/[\"']\(.*\)[\"']/'\1 ($(kvers), CPU\\\\@${clk}Mhz)'/")
        if [ -z "$OPT_NO_X11" ]; then
            echo "set terminal x11 enhanced; ${cmd}" | gnuplot -persist
        fi
@@ -131,7 +145,7 @@ go() {
     fi
     for clk in $mhz; do
     echo "===================="
-       dir=$(create_dirs_and_links `basename $0 .sh` `uname -r` $clk)
+       dir=$(create_dirs_and_links `basename $0 .sh` `kvers` $clk)
        set -x
        pushd $dir