[Android Software/Hacking General [Developers Only]] HSD-Pilot:
This is my Script to set / tweak my Governor on my XZ.

It's easy to handle, i guess.

#!/system/bin/sh

LOG_FILE=/data/Init.d_Tweaks.log

sleep 60

# Set Scaling Governor

GOVERNOR="conservative"

echo $GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

echo $GOVERNOR > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor

echo $GOVERNOR > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor

echo $GOVERNOR > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor

echo "$GOVERNOR Governor is running" | tee -a $LOG_FILE;

# Set Min & Max Frequency

# 384000 486000 594000 702000 810000 918000 1026000 1134000 1242000 1350000 1458000 1512000

CPU_MIN="384000"

CPU_MAX="1242000"

echo $CPU_MIN > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

echo $CPU_MAX > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

echo $CPU_MIN > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq

echo $CPU_MAX > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq

echo $CPU_MIN > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq

echo $CPU_MAX > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq

echo $CPU_MIN > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq

echo $CPU_MAX > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq

echo "Min / Max Frequency is set to $CPU_MIN / $CPU_MAX" | tee -a $LOG_FILE;

# Set IO Sheduler

SHEDULER="deadline"

echo $SHEDULER > /sys/block/mmcblk0/queue/scheduler

echo $SHEDULER > /sys/block/mmcblk1/queue/scheduler

echo "$SHEDULER Sheduler is running" | tee -a $LOG_FILE;

# Set SD Cache

READ_AHEAD_KB="512"

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/254:0/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/254:1/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:0/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:32/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/0:18/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:0/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:1/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:2/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:3/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:4/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:5/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:6/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:7/read_ahead_kb

echo "256" > /sys/devices/virtual/bdi/default/read_ahead_kb

echo "SD Cache is set to $READ_AHEAD_KB kb" | tee -a $LOG_FILE;

# Tweak Governor

# Ondemand

if [ -d "/sys/devices/system/cpu/cpufreq/$GOVERNOR" ]; then

# Ondemand Tweaked

echo "90" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold

echo "85" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load

echo "85" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core

echo "75000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate

echo "2" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor

echo "384000" > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq

echo "1242000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq

echo "10" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential

echo "35" > /sys/devices/system/cpu/cpufreq/ondemand/freq_step

# Ondemand Battery

# echo "95" /sys/devices/system/cpu/cpufreq/ondemand/up_threshold

# echo "85" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load

# echo "85" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core

# echo "120000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate

# echo "1" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor

# echo "384000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq

# echo "1026000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq

# echo "5" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential

# echo "10" > /sys/devices/system/cpu/cpufreq/ondemand/freq_step

# Ondemand Performance

# echo "70" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold

# echo "60" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load

# echo "60" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core

# echo "50000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate

# echo "2" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor

# echo "702000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq

# echo "1512000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq

# echo "15" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential

# echo "50" > /sys/devices/system/cpu/cpufreq/ondemand/freq_step

fi;

# Interactive

if [ -d "/sys/devices/system/cpu/cpufreq/$GOVERNOR" ]; then

# Interactive Tweaked

echo "90" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load

echo "1242000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq

echo "20000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time

echo "30000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate

# Interactive Battery

# echo "95" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load

# echo "1026000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq

# echo "10000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time

# echo "40000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate

# Interactive Performance

# echo "80" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load

# echo "1512000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq

# echo "40000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time

# echo "20000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate

fi;

# Conservative

if [ -d "/sys/devices/system/cpu/cpufreq/$GOVERNOR" ]; then

# Conservative Tweaked

echo "90" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold

echo "60000" > /sys/devices/system/cpu/cpufreq/conservative/sampling_rate

echo "3" > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor

echo "30" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold

echo "15" > /sys/devices/system/cpu/cpufreq/conservative/freq_step

# Conservative Battery

# echo "95" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold

# echo "120000" > /sys/devices/system/cpu/cpufreq/conservative/sampling_rate

# echo "1" > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor

# echo "40" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold

# echo "10" > /sys/devices/system/cpu/cpufreq/conservative/freq_step

# Conservative Performance

# echo "60" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold

# echo "40000" > /sys/devices/system/cpu/cpufreq/conservative/sampling_rate

# echo "5" > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor

# echo "20" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold

# echo "25" > /sys/devices/system/cpu/cpufreq/conservative/freq_step

fi;

echo "$GOVERNOR Governor is Tweaked" | tee -a $LOG_FILE;

# Custom Kernel Tweaks

# reduce / increase [mv] for all Frequencys

# echo "-90000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels

# Set GPU Governor

# echo "simple" > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/pwrscale/trustzone/governor

# Set GPU Clock

# echo "325000000" > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/max_gpuclk

# Swap / Tap 2 Wake

# echo "0" > /sys/android_touch/doubletap2wake

# echo "0" > /sys/android_touch/sweep2wake

# echo "Custom Kernel Settings are applied" | tee -a $LOG_FILE;

echo " " | tee -a $LOG_FILE;

echo "@ $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;

echo " " | tee -a $LOG_FILE;

Gesendet von meinem C6603 mit Tapatalk