Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Sakib Sajal" <sakib.sajal@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH] scripts/oe-timeout-dd-test.sh: add script
Date: Sun, 7 Mar 2021 15:58:17 -0500	[thread overview]
Message-ID: <20210307205817.5679-1-sakib.sajal@windriver.com> (raw)

oe-timeout-dd-test tries to write <count> number of
kilobytes to the filesystem within a specified
<timeout>. 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.

To use and monitor a build, add to local.conf:
BB_HEARTBEAT_EVENT = "<interval to log data>"
BB_LOG_HOST_STAT_ON_INTERVAL = "1"
BB_LOG_HOST_STAT_CMDS = "oe-timeout-dd-test.sh <timeout> <count>"

Log can be found at:
$TMPDIR/buildstats/<build_number>/host_stats file.

Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
---
 scripts/oe-timeout-dd-test.sh | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 scripts/oe-timeout-dd-test.sh

diff --git a/scripts/oe-timeout-dd-test.sh b/scripts/oe-timeout-dd-test.sh
new file mode 100644
index 0000000000..40b3948c32
--- /dev/null
+++ b/scripts/oe-timeout-dd-test.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# oe-timeout-dd-test tries to write <count> number of
+# kilobytes to the filesystem within a specified time
+# constraint. 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 <timeout> <count>"
+}
+
+if [ $# -ne 2 ]; then
+        usage
+        exit 1
+fi
+
+timeout $1 dd if=/dev/zero of=/tmp/foo bs=1024 count=$2 >/dev/null 2>&1
+
+if [ $? -ne 0 ]
+then
+        top -b -n 1
+else
+        echo "success"
+fi
+
-- 
2.29.2


             reply	other threads:[~2021-03-07 20:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-07 20:58 Sakib Sajal [this message]
2021-03-08 14:50 ` [OE-core] [PATCH] scripts/oe-timeout-dd-test.sh: add script Randy MacLeod
2021-03-08 17:33   ` Richard Purdie
2021-03-08 20:46     ` Sakib Sajal
2021-03-08 22:10       ` Richard Purdie
2021-03-11 20:53         ` Yi Fan Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210307205817.5679-1-sakib.sajal@windriver.com \
    --to=sakib.sajal@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox