summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSakib Sajal <sakib.sajal@windriver.com>2021-03-22 04:32:24 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-23 22:51:25 +0000
commit4b5a93d190452465dfab0e9482b381f0587a028e (patch)
tree12ae672815bd059f58ae233cfdc9e658c1d9475d
parentab6fb347a606276c7ea15ee7fba1b2aab52a97f2 (diff)
downloadpoky-contrib-4b5a93d190452465dfab0e9482b381f0587a028e.tar.gz
poky-contrib-4b5a93d190452465dfab0e9482b381f0587a028e.tar.bz2
poky-contrib-4b5a93d190452465dfab0e9482b381f0587a028e.zip
scripts: add oe-time-dd-test.sh
oe-time-dd-test records how much time it takes to write <count> number of kilobytes to the filesystem. It also records the number of processes that are in running (R), uninterruptible sleep (D) and interruptible sleep (S) state from the output of "top" command. The purporse of this script is to find which part of the build system puts stress on the filesystem io and log all the processes. (From OE-Core rev: 26d82f92e5ed2ebdde158d66b86eaf248f56892a) Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/oe-time-dd-test.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/oe-time-dd-test.sh b/scripts/oe-time-dd-test.sh
new file mode 100644
index 0000000000..970a86dff0
--- /dev/null
+++ b/scripts/oe-time-dd-test.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# oe-time-dd-test records how much time it takes to
+# write <count> number of kilobytes to the filesystem.
+# It also records the number of processes that are in
+# running (R), uninterruptible sleep (D) and interruptible
+# sleep (S) state from the output of "top" command.
+# The purporse of this script is to find which part of
+# the build system puts stress on the filesystem io and
+# log all the processes.
+
+usage() {
+ echo "Usage: $0 <count>"
+}
+
+if [ $# -ne 1 ]; then
+ usage
+ exit 1
+fi
+
+uptime
+/usr/bin/time -f "%e" dd if=/dev/zero of=foo bs=1024 count=$1 conv=fsync
+top -b -n 1 | grep -v "0 0 0" | grep -E ' [RSD] ' | cut -c 46-47 | sort | uniq -c