我们处理了一些在money或稳定性测试中复制的软件监督问题。根据
logcat,内核和跟踪日志分析,SWWD阻塞的线程的回溯不是固定的。 在
换句话说,阻塞的线程在特定功能中不会被阻塞。 SWWD的原因是相对的
与整个Android系统的性能。为了调试这些问题,我们需要更详细的CPU,
procrank,内存和顶级信息。 以下是捕获这些信息的脚本和用法
与时间间隔。
[Perfscript.sh]
#=================================================================
#Scriptof capturing CPU, procrank, memory and top information with time interval.
mkdirPerfLogs
cdPerfLogs
rm./*.txt
echo"Start..."
while:
do
echo"Perf"
MYDATE=`date+%y-%m-%d_%H:%M:%S`
echo$MYDATE
#Printcurrent CPU frequency
#Modifybelow lines based on CPU core number.
echo""
echo"${MYDATE}" >> cpuinfo_cur_freq.txt &
echo"cpu0 cur freq:`cat/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq`" >>
cpuinfo_cur_freq.txt&
echo"cpu1 cur freq:`cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq`">>
cpuinfo_cur_freq.txt&
echo"cpu2 cur freq:`cat/sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq`" >>
cpuinfo_cur_freq.txt&
echo"cpu3 cur freq:`cat/sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq`" >>
cpuinfo_cur_freq.txt&
echo"cpu4 cur freq:`cat/sys/devices/system/cpu/cpu4/cpufreq/scaling_cur_freq`" >>
cpuinfo_cur_freq.txt&
echo"cpu5 cur freq:`cat/sys/devices/system/cpu/cpu5/cpufreq/scaling_cur_freq`" >>
cpuinfo_cur_freq.txt&
echo"cpu6 cur freq:`cat /sys/devices/system/cpu/cpu6/cpufreq/scaling_cur_freq`">>
cpuinfo_cur_freq.txt&
echo"cpu7 cur freq:`cat/sys/devices/system/cpu/cpu7/cpufreq/scaling_cur_freq`" >>
cpuinfo_cur_freq.txt&
echo"${MYDATE}" >> procrank.txt &
procrank>> procrank.txt &
echo"${MYDATE}" >> proc_meminfo.txt &
cat/proc/meminfo >> proc_meminfo.txt &
echo"${MYDATE}" >> meminfo.txt &
dumpsysmeminfo >> meminfo.txt &
echo"${MYDATE}" >> top.txt &
top -t-m 8 -n 1 >> top.txt &
sleep60 #60 seconds, you can modify the time interval.
done
#
#=================================================================
[Usage]
adbroot
adbremount
adbpush Perfscript.sh /data
adbshell
cd/data
shPerfscript.sh
//Testthe issue ......
//Pulllogs.
adb pull/data/PerfLogs .