~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/power/cpupower/bench/cpufreq-bench_script.sh

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #!/bin/bash
  2 # SPDX-License-Identifier: GPL-2.0-or-later
  3 
  4 
  5 # Author/Copyright(c): 2009, Thomas Renninger <trenn@suse.de>, Novell Inc.
  6 
  7 # Ondemand up_threshold and sampling rate test script for cpufreq-bench
  8 # mircobenchmark.
  9 # Modify the general variables at the top or extend or copy out parts
 10 # if you want to test other things
 11 #
 12 
 13 # Default with latest kernels is 95, before micro account patches
 14 # it was 80, cmp. with git commit 808009131046b62ac434dbc796
 15 UP_THRESHOLD="60 80 95"
 16 # Depending on the kernel and the HW sampling rate could be restricted
 17 # and cannot be set that low...
 18 # E.g. before git commit cef9615a853ebc4972084f7 one could only set
 19 # min sampling rate of 80000 if CONFIG_HZ=250
 20 SAMPLING_RATE="20000 80000"
 21 
 22 function measure()
 23 {
 24     local -i up_threshold_set
 25     local -i sampling_rate_set
 26 
 27     for up_threshold in $UP_THRESHOLD;do
 28         for sampling_rate in $SAMPLING_RATE;do
 29             # Set values in sysfs
 30             echo $up_threshold >/sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
 31             echo $sampling_rate >/sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
 32             up_threshold_set=$(cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold)
 33             sampling_rate_set=$(cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate)
 34 
 35             # Verify set values in sysfs
 36             if [ ${up_threshold_set} -eq ${up_threshold} ];then
 37                 echo "up_threshold: $up_threshold, set in sysfs: ${up_threshold_set}"
 38             else
 39                 echo "WARNING: Tried to set up_threshold: $up_threshold, set in sysfs: ${up_threshold_set}"
 40             fi
 41             if [ ${sampling_rate_set} -eq ${sampling_rate} ];then
 42                 echo "sampling_rate: $sampling_rate, set in sysfs: ${sampling_rate_set}"
 43             else
 44                 echo "WARNING: Tried to set sampling_rate: $sampling_rate, set in sysfs: ${sampling_rate_set}"
 45             fi
 46 
 47             # Benchmark
 48             cpufreq-bench -o /var/log/cpufreq-bench/up_threshold_${up_threshold}_sampling_rate_${sampling_rate}
 49         done
 50     done
 51 }
 52 
 53 function create_plots()
 54 {
 55     local command
 56 
 57     for up_threshold in $UP_THRESHOLD;do
 58         command="cpufreq-bench_plot.sh -o \"sampling_rate_${SAMPLING_RATE}_up_threshold_${up_threshold}\" -t \"Ondemand sampling_rate: ${SAMPLING_RATE} comparison - Up_threshold: $up_threshold %\""
 59         for sampling_rate in $SAMPLING_RATE;do
 60             command="${command} /var/log/cpufreq-bench/up_threshold_${up_threshold}_sampling_rate_${sampling_rate}/* \"sampling_rate = $sampling_rate\""
 61         done
 62         echo $command
 63         eval "$command"
 64         echo
 65     done
 66 
 67     for sampling_rate in $SAMPLING_RATE;do
 68         command="cpufreq-bench_plot.sh -o \"up_threshold_${UP_THRESHOLD}_sampling_rate_${sampling_rate}\" -t \"Ondemand up_threshold: ${UP_THRESHOLD} % comparison - sampling_rate: $sampling_rate\""
 69         for up_threshold in $UP_THRESHOLD;do
 70             command="${command} /var/log/cpufreq-bench/up_threshold_${up_threshold}_sampling_rate_${sampling_rate}/* \"up_threshold = $up_threshold\""
 71         done
 72         echo $command
 73         eval "$command"
 74         echo
 75     done
 76 
 77     command="cpufreq-bench_plot.sh -o \"up_threshold_${UP_THRESHOLD}_sampling_rate_${SAMPLING_RATE}\" -t \"Ondemand up_threshold: ${UP_THRESHOLD} and sampling_rate ${SAMPLING_RATE} comparison\""
 78     for sampling_rate in $SAMPLING_RATE;do
 79         for up_threshold in $UP_THRESHOLD;do
 80             command="${command} /var/log/cpufreq-bench/up_threshold_${up_threshold}_sampling_rate_${sampling_rate}/* \"up_threshold = $up_threshold - sampling_rate = $sampling_rate\""
 81         done
 82     done
 83     echo "$command"
 84     eval "$command"
 85 }
 86 
 87 measure
 88 create_plots

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php