File ondemand-kernel3.1.diff of Package pm-profiler

Starting with kernel 3.1, paths have changed for "up_threshold", "sampling_rate"
and "powersave_bias".


--- pm-profiler-0.1_20111222/tools/get-current-settings.orig	2011-12-22 08:36:52.000000000 +0100
+++ pm-profiler-0.1_20111222/tools/get-current-settings	2015-01-02 00:35:33.791788485 +0100
@@ -17,9 +17,10 @@
 
 function get_cpufreq_ondemand_up_threshold {
     Option="CPUFREQ_UP_THRESHOLD"
-    Value=`cat /sys/devices/system/cpu/cpu0/cpufreq/$Governor/up_threshold`
 
-    for I in /sys/devices/system/cpu/cpu[[:digit:]]*; do
+    if [ -f /sys/devices/system/cpu/cpu0/cpufreq/$Governor/up_threshold ]; then
+      Value=`cat /sys/devices/system/cpu/cpu0/cpufreq/$Governor/up_threshold`
+      for I in /sys/devices/system/cpu/cpu[[:digit:]]*; do
         if [ -d $I/cpufreq/$Governor ]; then
             Next_Value=`cat $I/cpufreq/$Governor/up_threshold`
             if [[ $Next_Value != $Value ]]; then
@@ -28,15 +29,19 @@
         else
             echo "Warning: different governor on "$I >&2
         fi
-    done
+      done
+    else
+      Value=`cat /sys/devices/system/cpu/cpufreq/$Governor/up_threshold`
+    fi
     echo $Option"="$Value
 }
 
 function get_cpufreq_ondemand_sampling_rate {
     Option="CPUFREQ_UP_CPUFREQ_SAMPLING_RATE"
-    Value=`cat /sys/devices/system/cpu/cpu0/cpufreq/$Governor/sampling_rate`
 
-    for I in /sys/devices/system/cpu/cpu[[:digit:]]*; do
+    if [ -f /sys/devices/system/cpu/cpu0/cpufreq/$Governor/sampling_rate ]; then
+      Value=`cat /sys/devices/system/cpu/cpu0/cpufreq/$Governor/sampling_rate`
+      for I in /sys/devices/system/cpu/cpu[[:digit:]]*; do
         if [ -d $I/cpufreq/$Governor ]; then
             if [ `cat $I/cpufreq/$Governor/sampling_rate` != $Value ]; then
                 echo "Warning: different values: "$Option >&2
@@ -44,15 +49,19 @@
         else
             echo "Warning: different governor on "$I >&2
         fi
-    done
+      done
+    else
+      Value=`cat /sys/devices/system/cpu/cpufreq/$Governor/sampling_rate`
+    fi
     echo $Option"="$Value
 }
 
 function get_cpufreq_ondemand_powersave_bias {
     Option="CPUFREQ_ONDEMAND_POWERSAVE_BIAS"
-    Value=`cat /sys/devices/system/cpu/cpu0/cpufreq/$Governor/powersave_bias`
 
-    for I in /sys/devices/system/cpu/cpu[[:digit:]]*; do
+    if [ -f /sys/devices/system/cpu/cpu0/cpufreq/$Governor/powersave_bias ]; then
+      Value=`cat /sys/devices/system/cpu/cpu0/cpufreq/$Governor/powersave_bias`
+      for I in /sys/devices/system/cpu/cpu[[:digit:]]*; do
         if [ -d $I/cpufreq/$Governor ]; then
             if [ `cat $I/cpufreq/$Governor/powersave_bias` != $Value ]; then
                 echo "Warning: different values: "$Option >&2
@@ -60,7 +69,10 @@
         else
             echo "Warning: different governor on "$I >&2
         fi
-    done
+      done
+    else
+      Value=`cat /sys/devices/system/cpu/cpufreq/$Governor/powersave_bias`
+    fi
     echo $Option"="$Value
 }
 
openSUSE Build Service is sponsored by