From: Tejun Heo <tj@kernel.org>
To: axboe@kernel.dk
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-team@fb.com, cgroups@vger.kernel.org, newella@fb.com,
josef@toxicpanda.com, asml.silence@gmail.com,
ming.lei@redhat.com, bvanassche@acm.org,
Tejun Heo <tj@kernel.org>
Subject: [PATCH 3/4] iocost_monitor: exit successfully if interval is zero
Date: Mon, 13 Apr 2020 12:27:57 -0400 [thread overview]
Message-ID: <20200413162758.97252-4-tj@kernel.org> (raw)
In-Reply-To: <20200413162758.97252-1-tj@kernel.org>
This is to help external tools to decide whether iocost_monitor has all its
requirements met or not based on the exit status of an -i0 run.
Signed-off-by: Tejun Heo <tj@kernel.org>
---
tools/cgroup/iocost_monitor.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/cgroup/iocost_monitor.py b/tools/cgroup/iocost_monitor.py
index 7427a5ee761b..eb2363b868c5 100644
--- a/tools/cgroup/iocost_monitor.py
+++ b/tools/cgroup/iocost_monitor.py
@@ -28,7 +28,8 @@ parser.add_argument('devname', metavar='DEV',
parser.add_argument('--cgroup', action='append', metavar='REGEX',
help='Regex for target cgroups, ')
parser.add_argument('--interval', '-i', metavar='SECONDS', type=float, default=1,
- help='Monitoring interval in seconds')
+ help='Monitoring interval in seconds (0 exits immediately '
+ 'after checking requirements)')
parser.add_argument('--json', action='store_true',
help='Output in json')
args = parser.parse_args()
@@ -243,6 +244,9 @@ ioc = None
if ioc is None:
err(f'Could not find ioc for {devname}');
+if interval == 0:
+ sys.exit(0)
+
# Keep printing
while True:
now = time.time()
--
2.25.2
next prev parent reply other threads:[~2020-04-13 16:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-13 16:27 [PATCHSET v2 block/for-5.8] iocost: improve use_delay and latency target handling Tejun Heo
2020-04-13 16:27 ` [PATCH 1/4] blk-iocost: switch to fixed non-auto-decaying use_delay Tejun Heo
2020-04-13 16:27 ` [PATCH 2/4] blk-iocost: account for IO size when testing latencies Tejun Heo
2020-04-13 16:27 ` Tejun Heo [this message]
2020-04-13 16:27 ` [PATCH 4/4] iocost_monitor: drop string wrap around numbers when outputting json Tejun Heo
[not found] ` <20200413162758.97252-1-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2020-04-13 16:56 ` [PATCHSET v2 block/for-5.8] iocost: improve use_delay and latency target handling Pavel Begunkov
2020-04-13 17:00 ` Pavel Begunkov
2020-04-13 17:08 ` Tejun Heo
[not found] ` <20200413170833.GD60335-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>
2020-04-13 18:49 ` Pavel Begunkov
2020-04-30 21:55 ` Jens Axboe
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=20200413162758.97252-4-tj@kernel.org \
--to=tj@kernel.org \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=cgroups@vger.kernel.org \
--cc=josef@toxicpanda.com \
--cc=kernel-team@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=newella@fb.com \
/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;
as well as URLs for NNTP newsgroup(s).