ADB RAM测试stressapptest及其内核日志收集

标签:
it |
分类: 测试 |
adb
root
adb push stressapptest
/data
adb shell chmod 0777
/data/stressapptest
adb
shell
cd
/data
l
cat
/proc/meminfo
This command will tell you how much free memory left for testing.
Search the MemFree
keyword
l
./stressapptest -s 86400 -m 4 -i 4 -c 4 -C 4
-M
xxx
It is to stress test memory copy, invert, crc check for 1hour with
900Mb memory.
-s: number of second to run the application
-m: number of memory copy threads to
run
-i: number of memory invert threads to
run
-c: CRC check
-C: number of memory CPU stress threads to
run
-M: Megabytes of ram to run
You need to use free memory as much as you can access in the
test.
More information about Stressful Application
Test
Executing Stressful application test
To execute, just type
stressapptest
on a shell and it will start executing with the default parameters. This usually is not enough for a regular test, so you may want to pass some command line arguments in order to get a real test.
Command line arguments
You can control the behavior of stressapptest just passing command-line arguments. Here is a list of the most common arguments (default arguments in parentheses):
General arguments
- -M mbytes : megabytes of ram to test (auto-detect all memory available)
- -s seconds : number of seconds to run (20)
- -m threads : number of memory copy threads to run (auto-detect to number of CPUs)
- -i threads : number of memory invert threads to run (0)
- -C threads : number of memory CPU stress threads to run (0)
- --paddr_base : allocate memory starting from this address (0, currently no support for none-0)
- -W : Use more CPU-stressful memory copy (false)
- -A : run in degraded mode on incompatible systems(off)
- -p pagesize : size in bytes of memory chunks (1024LL*1024LL)
- -n ipaddr : add a network thread connecting to system at 'ipaddr'. (none)
- --listen : run a thread to listen for and respond to network threads. (0)
Error handling
- -l logfile : log output to file 'logfile' (none)
- --max_errors n : exit early after finding 'n' errors (off)
- -v level : verbosity (0-20) (default: 8)
- --no_errors : run without checking for errors. (off)
- --force_errors : inject false errors to test error handling. (off)
- --force_errors_like_crazy : inject a lot of false errors to test error handling. (off)
- -F : don't result check each transaction. (false)
- --stop_on_errors : Stop after finding the first error. (off)
Disk testing
- -d device : add a direct write disk thread with block device (or file) 'device' (0)
- --findfiles : find locations to do disk IO automatically (false)
- -f filename : add a disk thread with tempfile 'filename' (none)
Power spike control
- --pause_delay : delay (in seconds) between power spikes (600)
- --pause_duration : duration (in seconds) of each pause (15)
Example command lines
- ./stressapptest -s 20 -M 256 -m 8 -C 8 -W # Allocate 256MB of memory and run 8 "warm copy" threads, and 8 cpu load threads. Exit after 20 seconds.
- ./stressapptest -f /tmp/file1 -f /tmp/file2 # Run 2 file IO threads, and autodetect memory size and core count to select allocated memory and memory copy threads.
Background
Many hardware issues reproduce infrequently, or only under corner cases. The theory being used here is that by maximizing bus and memory traffic, the number of transactions is increased, and therefore the probability of failing a transaction is increased.
stressapptest is a userspace test, primarily composed of threads doing memory copies and directIO disk read/write. It allocates a large block of memory (typically 85% of the total memory on the machine), and each thread will choose randomized blocks of memory to copy, or to write to disk. Typically there are two threads per processor, and two threads for each disk. Result checking is done as the test proceeds by CRCing the data as it is copied.
stressapptest can be download through svn at
svn checkout http://stressapptest.googlecode.com/svn/trunk/ stressapptest
(tgz downloads are no longer supported by code.google.com)
check the Installation Guide
check the User Guide
Logged information
stressapptest can output a logfile of miscompares detected during its execution. stressapptest cannot yet log reboot failures, or other failures not visible to user space.
仅运行./stressapptest ,系统发生重启
http://s8/mw690/002L1CUfgy6HFCdXv5Ze7&690RAM测试stressapptest及其内核日志收集" TITLE="ADB
./stressapptest -s 20 -M 256 -m 8 -C 8
-W
http://s7/mw690/002L1CUfgy6HFCDIh7g16&690RAM测试stressapptest及其内核日志收集" TITLE="ADB
./stressapptest -s 20 -M 256 -m 4 -C 4 -c 4 -i 4
http://s12/mw690/002L1CUfgy6HFDthSrNbb&690RAM测试stressapptest及其内核日志收集" TITLE="ADB
./stressapptest -s 86400 -m 4 -i 4 -c 4 -C 4
-M 180
Log: Commandline - ./stressapptest -s
86400 -m 4 -i 4 -c 4 -C 4 -M 180 -l /logs/mmtest
Stats: SAT revision 1.0.4_autoconf, 32 bit binary
Log: Android version from open source release
Log: 1 nodes, 4 cpus.
Log: Flooring memory allocation to multiple of 4:
180MB
Log: Prefer plain malloc memory allocation.
Log: Using memaligned allocation at 0x402b5000.
Stats: Starting SAT, 180M, 86400 seconds
Log: initialized 120 data patterns
Log: Allocating pages, Total: 180 Free: 72
Starting Fill threads: 8 threads, 180 pages
Starting Fill Threads 0: 22 pages
Starting Fill Threads 1: 22 pages
Starting Fill Threads 2: 22 pages
Starting Fill Threads 3: 22 pages
Starting Fill Threads 4: 22 pages
Starting Fill Threads 5: 22 pages
Starting Fill Threads 6: 22 pages
Starting Fill Threads 7: 26 pages
Log: Thread 1 running on apic ID 0 mask F (F).
Log: Thread 0 running on apic ID 0 mask F (F).
Log: Thread 2 running on apic ID 0 mask F (F).
Log: Starting fill thread 2
Log: Starting fill thread 1
Log: Starting fill thread 0
Log: Thread 3 running on apic ID 0 mask F (F).
Log: Starting fill thread 3
Log: Thread 4 running on apic ID 0 mask F (F).
Log: Starting fill thread 4
Log: Thread 5 running on apic ID 0 mask F (F).
Log: Starting fill thread 5
Log: Thread 6 running on apic ID 0 mask F (F).
Log: Starting fill thread 6
Log: Thread 7 running on apic ID 0 mask F (F).
Log: Starting fill thread 7
Log: Completed 0: Fill thread. Status 1, 22 pages filled
Log: Completed 1: Fill thread. Status 1, 22 pages filled
Log: Completed 3: Fill thread. Status 1, 22 pages filled
Log: Completed 5: Fill thread. Status 1, 22 pages filled
Log: Completed 7: Fill thread. Status 1, 26 pages filled
Log: Completed 2: Fill thread. Status 1, 22 pages filled
Log: Completed 6: Fill thread. Status 1, 22 pages filled
Log: Completed 4: Fill thread. Status 1, 22 pages filled
Log: Done filling pages.
Log: Allocating pages.
Log: address: 0x12492000, DIMM Unknown
Log: address: 0x386a000, DIMM Unknown
Log: address: 0x10aa1000, DIMM Unknown
Log: address: 0x9497000, DIMM Unknown
Log: address: 0x13054000, DIMM Unknown
Log: address: 0x484e000, DIMM Unknown
Log: address: 0xc3df000, DIMM Unknown
Log: address: 0xb514000, DIMM Unknown
Log: address: 0x6838000, DIMM Unknown
Log: address: 0xa4dd000, DIMM Unknown
Log: address: 0x10c06000, DIMM Unknown
Log: address: 0xf4eb000, DIMM Unknown
Log: address: 0x4522000, DIMM Unknown
Log: address: 0x8f96000, DIMM Unknown
Log: address: 0xdde1000, DIMM Unknown
Log: address: 0xefd8000, DIMM Unknown
Log: address: 0xd287000, DIMM Unknown
Log: address: 0x4ca0000, DIMM Unknown
Log: address: 0x12942000, DIMM Unknown
Log: address: 0x87f1000, DIMM Unknown
Log: address: 0x6a1b000, DIMM Unknown
Log: address: 0x107ea000, DIMM Unknown
Log: address: 0xcfb2000, DIMM Unknown
Log: address: 0xf0fa000, DIMM Unknown
Log: address: 0x1ef17000, DIMM Unknown
Log: address: 0x5517000, DIMM Unknown
Log: address: 0x81d0000, DIMM Unknown
Log: address: 0x12966000, DIMM Unknown
Log: address: 0x13857000, DIMM Unknown
Log: address: 0xcb9a000, DIMM Unknown
Log: address: 0xcdff000, DIMM Unknown
Log: address: 0xd953000, DIMM Unknown
Log: address: 0x11403000, DIMM Unknown
Log: address: 0x133e8000, DIMM Unknown
Log: address: 0x12bbb000, DIMM Unknown
Log: address: 0x8131000, DIMM Unknown
Log: address: 0xa520000, DIMM Unknown
Log: address: 0x10fee000, DIMM Unknown
Log: address: 0x757d000, DIMM Unknown
Log: address: 0xdc9d000, DIMM Unknown
Log: address: 0xaf8b000, DIMM Unknown
Log: address: 0x1053b000, DIMM Unknown
Log: address: 0x95e5000, DIMM Unknown
Log: address: 0x10fa2000, DIMM Unknown
Log: address: 0xd7e4000, DIMM Unknown
Log: address: 0x505c000, DIMM Unknown
Log: address: 0x499d000, DIMM Unknown
Log: address: 0x62dd000, DIMM Unknown
Log: address: 0x752a000, DIMM Unknown
Log: address: 0x13678000, DIMM Unknown
Log: address: 0x5d94000, DIMM Unknown
Log: address: 0xec29000, DIMM Unknown
Log: address: 0x53bb000, DIMM Unknown
Log: address: 0x8cae000, DIMM Unknown
Log: address: 0x126e0000, DIMM Unknown
Log: address: 0xacf8000, DIMM Unknown
Log: address: 0x8a67000, DIMM Unknown
Log: address: 0xd3be000, DIMM Unknown
Log: address: 0xabc0000, DIMM Unknown
Log: address: 0x1278e000, DIMM Unknown
Log: address: 0xce95000, DIMM Unknown
Log: address: 0x10c66000, DIMM Unknown
Log: address: 0xaa0c000, DIMM Unknown
Log: address: 0x133c0000, DIMM Unknown
Log: address: 0x8824000, DIMM Unknown
Log: address: 0xc135000, DIMM Unknown
Log: address: 0x13000000, DIMM Unknown
Log: address: 0xb1fd000, DIMM Unknown
Log: address: 0xa1b8000, DIMM Unknown
Log: address: 0xf1cd000, DIMM Unknown
Log: address: 0x1ef80000, DIMM Unknown
Log: address: 0xd2de000, DIMM Unknown
Log: address: 0x10032000, DIMM Unknown
Log: address: 0xa1f2000, DIMM Unknown
Log: address: 0x19634000, DIMM Unknown
Log: address: 0x8e65000, DIMM Unknown
Log: address: 0x57d3000, DIMM Unknown
Log: address: 0x5e03000, DIMM Unknown
Log: address: 0xb26c000, DIMM Unknown
Log: address: 0x4e08000, DIMM Unknown
Log: address: 0x10032000, DIMM Unknown
Log: address: 0x6213000, DIMM Unknown
Log: address: 0x4d81000, DIMM Unknown
Log: address: 0xde85000, DIMM Unknown
Log: address: 0xa123000, DIMM Unknown
Log: address: 0xb0f1000, DIMM Unknown
Log: address: 0xc35e000, DIMM Unknown
Log: address: 0xf5ce000, DIMM Unknown
Log: address: 0x543d000, DIMM Unknown
Log: address: 0x4bd6000, DIMM Unknown
Log: address: 0x6949000, DIMM Unknown
Log: address: 0xcbeb000, DIMM Unknown
Log: address: 0x8748000, DIMM Unknown
Log: address: 0x5c41000, DIMM Unknown
Log: address: 0xee48000, DIMM Unknown
Log: address: 0x1177b000, DIMM Unknown
Log: address: 0x81e3000, DIMM Unknown
Log: address: 0x8748000, DIMM Unknown
Log: address: 0x10bc4000, DIMM Unknown
Log: address: 0xd80b000, DIMM Unknown
Log: address: 0x19636000, DIMM Unknown
Log: address: 0x441a000, DIMM Unknown
Log: address: 0x543d000, DIMM Unknown
Log: address: 0xa123000, DIMM Unknown
Log: address: 0x4bd6000, DIMM Unknown
Log: address: 0x45e6000, DIMM Unknown
Log: address: 0x3dde000, DIMM Unknown
Log: address: 0xaaf5000, DIMM Unknown
Log: address: 0x1097c000, DIMM Unknown
Log: address: 0x8e65000, DIMM Unknown
Log: address: 0xee48000, DIMM Unknown
Log: address: 0xd6c6000, DIMM Unknown
Log: address: 0xab92000, DIMM Unknown
Log: address: 0x1e488000, DIMM Unknown
Log: address: 0x47c1000, DIMM Unknown
Log: address: 0x526e000, DIMM Unknown
Log: address: 0x19636000, DIMM Unknown
Log: address: 0x3838000, DIMM Unknown
Log: address: 0xc35e000, DIMM Unknown
Log: address: 0x8e65000, DIMM Unknown
Log: address: 0xa1f2000, DIMM Unknown
Log: address: 0x1038d000, DIMM Unknown
Log: address: 0xaf29000, DIMM Unknown
Log: address: 0xea30000, DIMM Unknown
Log: address: 0x97b9000, DIMM Unknown
Log: address: 0xd6cc000, DIMM Unknown
Log: address: 0x10bc4000, DIMM Unknown
Log: address: 0xf5ce000, DIMM Unknown
Log: address: 0xb26c000, DIMM Unknown
Log: address: 0xb557000, DIMM Unknown
Log: address: 0xd7b2000, DIMM Unknown
Log: address: 0x19634000, DIMM Unknown
Log: address: 0x9218000, DIMM Unknown
Log: address: 0x45e6000, DIMM Unknown
Log: address: 0x1eef1000, DIMM Unknown
Log: address: 0x19634000, DIMM Unknown
Log: address: 0xb557000, DIMM Unknown
Log: address: 0x8469000, DIMM Unknown
Log: address: 0xaf29000, DIMM Unknown
Log: address: 0xdafd000, DIMM Unknown
Log: address: 0x19636000, DIMM Unknown
Log: address: 0x441a000, DIMM Unknown
Log: address: 0x1048e000, DIMM Unknown
Log: address: 0x5dcc000, DIMM Unknown
Log: address: 0x5e03000, DIMM Unknown
Log: address: 0xa899000, DIMM Unknown
Log: address: 0xb26c000, DIMM Unknown
Log: address: 0xebc0000, DIMM Unknown
Log: address: 0x543d000, DIMM Unknown
Log: address: 0xd7b2000, DIMM Unknown
Log: address: 0x3dde000, DIMM Unknown
Log: address: 0xaaf5000, DIMM Unknown
Log: address: 0xf07f000, DIMM Unknown
Log: address: 0xe82a000, DIMM Unknown
Log: address: 0x3dde000, DIMM Unknown
Log: address: 0x8469000, DIMM Unknown
Log: address: 0xa7f1000, DIMM Unknown
Log: address: 0x105d0000, DIMM Unknown
Log: address: 0x4d81000, DIMM Unknown
Log: address: 0x11444000, DIMM Unknown
Log: address: 0x9218000, DIMM Unknown
Log: address: 0x5e03000, DIMM Unknown
Log: address: 0xc817000, DIMM Unknown
Log: address: 0x526e000, DIMM Unknown
Log: address: 0x1097c000, DIMM Unknown
Log: address: 0x501b000, DIMM Unknown
Log: address: 0xaf29000, DIMM Unknown
Log: address: 0x9056000, DIMM Unknown
Log: address: 0x10882000, DIMM Unknown
Log: address: 0x1048e000, DIMM Unknown
Log: address: 0xe811000, DIMM Unknown
Log: address: 0x13215000, DIMM Unknown
Log: address: 0x10882000, DIMM Unknown
Log: address: 0x8469000, DIMM Unknown
Log: address: 0xe811000, DIMM Unknown
Log: address: 0xdafd000, DIMM Unknown
Log: address: 0x10db5000, DIMM Unknown
Log: address: 0xea30000, DIMM Unknown
Log: address: 0x12adb000, DIMM Unknown
Log: address: 0x38da000, DIMM Unknown
Log: Done allocating pages.
Log: Region 0: 180.
Log: Region mask: 0x1
Log: Installing signal handlers
Log: Launching worker threads
Log: Starting worker threads
Log: Starting invert threads
Log: Starting disk stress threads
Log: Starting cpu stress threads
Log: Initializing WorkerStatus objects
Log: Spawning worker threads
Log: Spawning thread 1
Log: Spawning thread 2
Log: Spawning thread 3
Log: Spawning thread 4
Log: Thread 1 running on apic ID 0 mask F (F).
Log: Thread 2 running on apic ID 0 mask F (F).
Log: Starting copy thread 2: cpu F, mem ffffffff
Log: Starting copy thread 1: cpu F, mem ffffffff
Log: Thread 3 running on apic ID 0 mask F (F).
Log: Starting copy thread 3: cpu F, mem ffffffff
Log: Spawning thread 5
Log: Spawning thread 6
Log: Spawning thread 7
Log: Spawning thread 8
Log: Spawning thread 9
Log: Spawning thread 10
Log: Spawning thread 11
Log: Spawning thread 12
Log: Spawning thread 13
Log: Spawning thread 14
Log: Spawning thread 15
Log: Spawning thread 16
Log: Spawning thread 0
Log: Starting countdown with 86400 seconds
Log: Thread 11 running on apic ID 0 mask F (F).
Log: Starting invert thread 11
Log: Thread 12 running on apic ID 0 mask F (F).
Log: Starting invert thread 12
Log: Thread 13 running on apic ID 0 mask F (F).
Log: Starting CPU stress thread 13
Log: Thread 10 running on apic ID 0 mask F (F).
Log: Starting invert thread 10
Log: Thread 16 running on apic ID 0 mask F (F).
Log: Starting CPU stress thread 16
Log: Thread 15 running on apic ID 0 mask F (F).
Log: Starting CPU stress thread 15
Log: Thread 14 running on apic ID 0 mask F (F).
Log: Starting CPU stress thread 14
Log: Thread 7 running on apic ID 0 mask F (F).
Log: Starting Check thread 7
Log: Thread 9 running on apic ID 0 mask F (F).
Log: Starting invert thread 9
Log: Thread 0 running on apic ID 0 mask F (F).
Log: Starting system error poll thread 0
Log: Thread 5 running on apic ID 0 mask F (F).
Log: Starting Check thread 5
Log: Thread 8 running on apic ID 0 mask F (F).
Log: Starting Check thread 8
Log: Thread 6 running on apic ID 0 mask F (F).
Log: Starting Check thread 6
Log: Thread 4 running on apic ID 0 mask F (F).
Log: Starting copy thread 4: cpu F, mem ffffffff
Log: Seconds remaining: 86390
Log: Seconds remaining: 86380
Log: Seconds remaining: 86370
Log: Seconds remaining: 86360
......
if fail, the result will appear
http://s13/mw690/002L1CUfgy6HG8bcTGA7c&690RAM测试stressapptest及其内核日志收集" TITLE="ADB
or appear
http://s5/mw690/002L1CUfgy6HG8zbJXuf4&690RAM测试stressapptest及其内核日志收集" TITLE="ADB
if pass, will appear
.....
下面是第一种fail情形的分析(设备掉电进入关机充电模式, adb依旧可以用)
现在已经退出了device shell的界面,在adb 目录下,我们可以尝试输入adb devices来检测adb是否依旧连上
观测设备已经进入了关机充电模式, 但adb依旧可以用
http://s10/mw690/002L1CUfgy6HG9pO6H769&690RAM测试stressapptest及其内核日志收集" TITLE="ADB
抓取相关log信息,收集内核日志
$adb root
$adb shell dmesg >
elpidafailmesg
$adb pull
/logs/mmtest
$adb pull
/logs/.
http://s9/mw690/002L1CUfgy6HGa7BIaQ58&690RAM测试stressapptest及其内核日志收集" TITLE="ADB
此时在adb所在的目录下,你可以看到新生成的两个文件elpidafailmesg和mmtest
完整运行命令及结果如下:
C:\Users\hutaipix\Documents\Work\TOOL\fastboot>adb
root
C:\Users\hutaipix\Documents\Work\TOOL\fastboot>adb shell dmesg > elpidafailmesg
C:\Users\hutaipix\Documents\Work\TOOL\fastboot>adb
pull /logs/mmtest
2388 KB/s (267106
bytes in 0.109s)
C:\Users\hutaipix\Documents\Work\TOOL\fastboot>adb
pull /logs/.
pull: building file list...
pull: /logs/./flashing/blankphone_file -> ./flashing/blankphone_file
pull:
/logs/./info/infosystem.txt -> ./info/infosystem.txt
pull:
/logs/./aplog.8 -> ./aplog.8
pull:
/logs/./aplog.7 -> ./aplog.7
pull: /logs/./aplog.6 -> ./aplog.6
pull: /logs/./mmtest -> ./mmtest
pull: /logs/./aplog.5 -> ./aplog.5
pull: /logs/./aplog.4 ->
./aplog.4
pull: /logs/./aplog.3 -> ./aplog.3
pull: /logs/./aplog.2 -> ./aplog.2
pull: /logs/./recovery_apklog ->
./recovery_apklog
pull:
/logs/./aplog.1 -> ./aplog.1
pull: /logs/./reserved -> ./reserved
pull: /logs/./uptime ->
./uptime
pull:
/logs/./history_event -> ./history_event
pull: /logs/./currentaplogslog
-> ./currentaplogslog
pull:
/logs/./currentstatslog -> ./currentstatslog
pull:
/logs/./currentcrashlog -> ./currentcrashlog
pull: /logs/./buildid.txt
-> ./buildid.txt
pull:
/logs/./uuid.txt -> ./uuid.txt
pull: /logs/./aplog ->
./aplog
pull:
/logs/./droidboot_apklog -> ./droidboot_apklog
22 files pulled. 0 files
skipped.
2709 KB/s (44541055 bytes in 16.052s)
注意事项:
如果显示如下的Permission denied, 那是应为我们的执行权限不够, 我们需adb
root
C:\Users\hutaipix\Documents\Work\TOOL\fastboot>adb pull
/logs/.
pull: building file list...
pull: /logs/./flashing/blankphone_file ->
./flashing/blankphone_file
failed to copy '/logs/./flashing/blankphone_file' to
'./flashing/blankphone_file
': Permission denied
pull: /logs/./aplog.8 -> ./aplog.8
failed to copy '/logs/./aplog.8' to './aplog.8': Permission
denied
pull: /logs/./aplog.7 -> ./aplog.7
包括我们运行adb shell dmesg > elpidafailmesg时依旧必须adb root先,否则文件内容如下
klogctl: Operation not permitted