??????????漰cpu??????
????1????????????
??????1???????????????????????????
??????????????????????????γ???????bug
????->??????汾??????????????????????????????????????????????汾?????
????????????
?????г???????????????????????汾??????????????????????
???????
?????????????????????????汾?????????????????????????????????java???????????Native??????????м???so??NDK????????y?????????г????汾?????????????????????????????????鵂???????????????????????????????????????????????????????????
?????????????????????
????Daily Smoke??????????MTBF?????????????????????????????????????????????????????????OOM crash??bug??????????????
???????????
?????????????????????????λ???????
??????2??????????????????????????????????????????????????????
????????????
????????????????????????????г?????????????????????
???????
?????????????????δ?????????????????????????????????·??
????2???????????????????
??????1??????????
????????CPU?????cpu
?????????busybox top -b -n 1
????????????top??????????????????0.2S?????top -t???3s?????????????0.1?????????????????????????ο?
???????????
????????? /proc/meminfo
????????????MemFree??Buffers??Cached??Active??Inactive??Active(anon)??Inactive(anon)??Active(file)??Inactive(file)??Dirty??Writeback??Mapped??Slab??????CMA????????CMA Free
?????????????
?????????dumpsys meminfo ????PID
?????????Native Heap Size??Native Heap Alloc??Native Heap Free??Dalvik Heap Size??Dalvik Heap Alloc??Dalvik Heap Free??Totle Pss??Dalvik Pss??Dalvik
???????????????native?????????????cat /proc/????pid/smaps|grep Pss????Pss
??????????????????Activity
????????? dumpsys window w|grep mFocusedApp|busybox awk '{print $5}'|busybox tr -d '}'
??????????????????
????????? date +%Y/%m/%d" "%H:%M:%S
??????????????????????
????????? busybox awk -F. 'NR==1{print $1}' /proc/uptime
????????????????м???????????????????
??????2?????????????
????????cpu——cpu.csv
????Loop:10??Time??Activity??usr??sys??nic??idle??io??irq??sirq??Data Time
???????10???趨?????????csv???????????????????????Time??????????????
??????????cpu——cpuinfo.csv
????Loop:10??Time??PID??%CPU??Command??Thread/avgs
???????Thread/avgs???????{}????????????????к??????????е??????????????в?????
???????????——mem.csv
????Time:10??MemFree??Buffers??Cached??Active??Inactive??Active(anon)??Inactive(anon)??Active(file)??Inactive(file)??Dirty??Writeback??Mapped??Slab
????????????cpu.csv?м??loop?????????????loop?????ж??????????????????????????????????????к????
??????????????——meminfo.csv??Loop:10??Time??PID??Process_Name??Pss??Native_Heap(Size)??Native_Heap(Alloc)??Native_Heap(Free)??Dalvik_Heap(Size)??Dalvik_Heap(Alloc)??Dalvik_Heap(Free)??Dalvik_Pss??Avgs
???????Avgs???????????в?????/proc/????PID/cmdline???????
??????3????????????——highcharts
??????????????????????
?????????????400???????????????????????1С?????????仯????
???????????????????????????????1000????????????????????????????
???????????????????
??????????????Activity???????
??????????CPU???????????????????????
????????????????ζ????PID????????????????????????????????????
???????????CPU?????
????????????????????top5?????????????£??в???????????????????????????
????????????????
??????????????????=MemFree+Buffer+Cache??Active??Inactive??io=Dirty+Writeback??Mapped??Slab??
??????????????????棬MemFree??Buffer??Cache??????CMA??????CMAFree
????Dirty??Writeback???Dirty??Writeback
????Active??Inactive???Active??Inactive??Active(anon)??Inactive(anon)??Active(file)??Inactive(file);
????Mapped??Slab???Mapped??Slab
???????????????PSS????????
???????????????????PSS???????????
??????????????????????????
??????????PSS??????????У?java???????heap????????native????????PSS
????????????
??????????????л???sleep*loop??????????????Time????????????????????????????????
????????????????????????highcharts????
????3????????????????
??????1??shell???????????
???????????
????->?????Activity
????->?????
????->CPU
????->?????
????->??????棨?????????5?????????
?????????????н??????????????????????????????6-8S?????Σ???????????????????????????????1S??ɡ?
??????2??Python????????json??
???????????????????????????json??????????????????????zip
??????3??node-webkit???????????
??????????????????json?????????????????????????????????????????????????????????
????4??Ч????


???????????£?????????????????????????????????Ч????
????1.???????????????????????????????????????м??????????????
????2.?????????????root+busybox
????3.?????????????windows?μ?exe??shell??????????push??ò??漰???????CSVtoJson.exe???output.py???????exe??MCM??????.exe??????node-webkit????win32?汾?????????????????????????н??????????
????4???????????????汾????json????????Html????е?json????????MCM_HTML/head/mcm.js??node????json??????????????