Skip to contentSkip to conversation

xenmon: --ms_per_sample: check too large value

PATCH In review KUWAMURA Shin'ya 1 participant 2 messages Sep 8, 2006 – Sep 19, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xenmon: --ms_per_sample: check too large value

Hi,

This patch adds the 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.

Thanks,

Signature · 1 line
  KUWAMURA Shin'ya
tools/xenmon/xenmon.py +5 -0
diff -r 66dd34f2f439 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:

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Hi,

Do you have any comment?
If you have no comment, could you commit this patch?

http://lists.xensource.com/archives/html/xen-devel/2006-09/msg00244.html

Quoted 11 lines · KUWAMURA Shin'ya

This patch adds the 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]

Quoted 5 lines
  xenmon.py: error: option --ms_per_sample: too large (> 1000 ms)

# Notice that a unit of "--time" is a second.

Best Regards,

Signature · 1 line
  KUWAMURA Shin'ya