diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-09-19 11:08:11 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-09-19 11:08:11 +0100 |
commit | 0a706be1ab4651a1513bd929d4e2b2054a9c823c (patch) | |
tree | 0567e62c1dda16f494cab90c5360914267ee8f86 /tools | |
parent | 85c8c907ea1e4fead19e7663dc256617d72bad36 (diff) | |
download | xen-0a706be1ab4651a1513bd929d4e2b2054a9c823c.tar.gz xen-0a706be1ab4651a1513bd929d4e2b2054a9c823c.tar.bz2 xen-0a706be1ab4651a1513bd929d4e2b2054a9c823c.zip |
[XENMON] Add argument check of "--ms_per_sample" option.
If a value of "--ms_per_sample" option is larger than a value of
"--time" option, xenmon may generate no log file. So, too large
"--ms_per_sample" should be treated as an error.
e.g.
% xenmon.py --ms_per_sample=2000 -t 1 -n
usage: xenmon.py [options]
xenmon.py: error: option --ms_per_sample: too large (> 1000 ms)
# Notice that a unit of "--time" is a second.
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/xenmon/xenmon.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/xenmon/xenmon.py b/tools/xenmon/xenmon.py index 402b6b4e18..e6b8ce9e24 100644 --- a/tools/xenmon/xenmon.py +++ b/tools/xenmon/xenmon.py @@ -675,6 +675,11 @@ def main(): if options.mspersample < 0: parser.error("option --ms_per_sample: invalid negative value: '%d'" % options.mspersample) + # If --ms_per_sample= is too large, no data may be logged. + if not options.live and options.duration != 0 and \ + options.mspersample > options.duration * 1000: + parser.error("option --ms_per_sample: too large (> %d ms)" % + (options.duration * 1000)) start_xenbaked() if options.live: |