summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2018-01-05 13:01:09 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2018-01-05 13:01:09 +0530
commiteafcb2bd8cb8bbed0d6c5c48192b5381bfee79cd (patch)
tree493b900da0c88fa57f6c45ba01501bff4b80a3cb
parent5c6c60de1e0195bb8bbf3fbc282b5d1e7eab70b9 (diff)
updates
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
-rwxr-xr-xmisc/pelt_walt.sh64
1 files changed, 64 insertions, 0 deletions
diff --git a/misc/pelt_walt.sh b/misc/pelt_walt.sh
new file mode 100755
index 0000000..22c6f40
--- /dev/null
+++ b/misc/pelt_walt.sh
@@ -0,0 +1,64 @@
+#!/system/bin/sh
+
+path=/data/pelt_walt.txt
+
+reset_cpufreq_stats()
+{
+ for policy in /sys/devices/system/cpu/cpufreq/policy*;
+ do
+ echo 1 > $policy/stats/reset
+ done
+}
+
+get_cpufreq_stats()
+{
+ echo "cpufreq-stats\n" >> $path
+ grep . /sys/devices/system/cpu/cpufreq/schedutil/* >> $path
+ echo "" >> $path
+
+ for policy in /sys/devices/system/cpu/cpufreq/policy*;
+ do
+ grep . $policy/* >> $path
+ echo "" >> $path
+ grep . $policy/stats/* >> $path
+ echo "" >> $path
+ done
+}
+
+reset_thermal_stats()
+{
+ for device in /sys/kernel/debug/thermal/cooling*;
+ do
+ echo 1 > $device/reset
+ done
+}
+
+get_thermal_stats()
+{
+ echo "thermal-stats\n" >> $path
+
+ for device in /sys/class/thermal/cooling*;
+ do
+ grep . $device/* >> $path
+ echo "" >> $path
+ done
+
+ for device in /sys/kernel/debug/thermal/cooling*;
+ do
+ grep . $device/* >> $path
+ echo "" >> $path
+ grep . $device/*/* >> $path
+ echo "" >> $path
+ done
+}
+
+if [ $1 -a $1 -eq 1 ]; then
+ echo "\n\nRESETTING\n\n"
+ reset_cpufreq_stats
+ reset_thermal_stats
+else
+ echo "\n\nSTATS COLLECT\n\n"
+ echo "" > $path
+ get_cpufreq_stats
+ get_thermal_stats
+fi