ia64/xen-unstable

changeset 11537:e5d29225a8d1

[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>
author kfraser@localhost.localdomain
date Tue Sep 19 11:08:11 2006 +0100 (2006-09-19)
parents 33955ca54ec1
children 38765166ad7a
files tools/xenmon/xenmon.py
line diff
     1.1 --- a/tools/xenmon/xenmon.py	Tue Sep 19 11:03:36 2006 +0100
     1.2 +++ b/tools/xenmon/xenmon.py	Tue Sep 19 11:08:11 2006 +0100
     1.3 @@ -675,6 +675,11 @@ def main():
     1.4      if options.mspersample < 0:
     1.5          parser.error("option --ms_per_sample: invalid negative value: '%d'" %
     1.6                       options.mspersample)
     1.7 +    # If --ms_per_sample= is too large, no data may be logged.
     1.8 +    if not options.live and options.duration != 0 and \
     1.9 +       options.mspersample > options.duration * 1000:
    1.10 +        parser.error("option --ms_per_sample: too large (> %d ms)" %
    1.11 +                     (options.duration * 1000))
    1.12      
    1.13      start_xenbaked()
    1.14      if options.live: