WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] xenmon: --ms_per_sample: check too large value

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xenmon: --ms_per_sample: check too large value
From: "KUWAMURA Shin'ya" <kuwa@xxxxxxxxxxxxxx>
Date: Fri, 08 Sep 2006 10:50:47 +0900 (JST)
Delivery-date: Thu, 07 Sep 2006 18:51:35 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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.

Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>

Thanks,
-- 
  KUWAMURA Shin'ya
diff -r 66dd34f2f439 tools/xenmon/xenmon.py
--- a/tools/xenmon/xenmon.py    Tue Sep 05 12:20:31 2006 -0700
+++ b/tools/xenmon/xenmon.py    Wed Sep 06 17:07:34 2006 +0900
@@ -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
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>