From: "KUWAMURA Shin'ya" Subject: [PATCH] xenmon: --ms_per_sample: check too large value Date: Fri, 08 Sep 2006 10:50:47 +0900 (JST) Message-ID: <20060908.105047.77000778.kuwa@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Fri_Sep__8_10_50_47_2006_681)--" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org ----Next_Part(Fri_Sep__8_10_50_47_2006_681)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Thanks, -- KUWAMURA Shin'ya ----Next_Part(Fri_Sep__8_10_50_47_2006_681)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xenmon-ms_per_sample-large.patch" 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: ----Next_Part(Fri_Sep__8_10_50_47_2006_681)-- Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ----Next_Part(Fri_Sep__8_10_50_47_2006_681)----