1 #!/bin/sh 2 # 3 # Copyright (C) 2010 The Android Open Source Project 4 # 5 # Licensed under the Apache License, Version 2.0 (the "License"); 6 # you may not use this file except in compliance with the License. 7 # You may obtain a copy of the License at 8 # 9 # http://www.apache.org/licenses/LICENSE-2.0 10 # 11 # Unless required by applicable law or agreed to in writing, software 12 # distributed under the License is distributed on an "AS IS" BASIS, 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 # See the License for the specific language governing permissions and 15 # limitations under the License. 16 17 # This is designed to be run on the device to create I/O load. 18 # 19 # adb push diskload.sh /data/local/tmp 20 # adb shell su root sh /data/local/tmp/diskload.sh /data/testfile 21 22 dd if=/dev/zero bs=65536 of=$1.0 & pid0=$!; echo start $pid0; sleep 2 23 dd if=/dev/zero bs=65536 of=$1.1 & pid1=$!; echo start $pid1; sleep 2 24 dd if=/dev/zero bs=65536 of=$1.2 & pid2=$!; echo start $pid2; sleep 2 25 dd if=/dev/zero bs=65536 of=$1.3 & pid3=$!; echo start $pid3; sleep 2 26 dd if=/dev/zero bs=65536 of=$1.4 & pid4=$!; echo start $pid4; sleep 2 27 dd if=/dev/zero bs=65536 of=$1.5 & pid5=$!; echo start $pid5; sleep 2 28 dd if=/dev/zero bs=65536 of=$1.6 & pid6=$!; echo start $pid6; sleep 2 29 dd if=/dev/zero bs=65536 of=$1.7 & pid7=$!; echo start $pid7; sleep 2 30 dd if=/dev/zero bs=65536 of=$1.8 & pid8=$!; echo start $pid8; sleep 2 31 dd if=/dev/zero bs=65536 of=$1.9 & pid9=$!; echo start $pid9; sleep 2 32 33 kill $pid0; echo kill $pid0; sleep 2 34 kill $pid1; echo kill $pid1; sleep 2 35 kill $pid2; echo kill $pid2; sleep 2 36 kill $pid3; echo kill $pid3; sleep 2 37 kill $pid4; echo kill $pid4; sleep 2 38 kill $pid5; echo kill $pid5; sleep 2 39 kill $pid6; echo kill $pid6; sleep 2 40 kill $pid7; echo kill $pid7; sleep 2 41 kill $pid8; echo kill $pid8; sleep 2 42 kill $pid9; echo kill $pid9; sleep 2 43 44 ls -l $1.0 $1.1 $1.2 $1.3 $1.4 $1.5 $1.6 $1.7 $1.8 $1.9 45 rm $1.0 $1.1 $1.2 $1.3 $1.4 $1.5 $1.6 $1.7 $1.8 $1.9 46