>From 882d7cdc4387912e1fe6a3c9e4c42cdb0ce78c23 Mon Sep 17 00:00:00 2001 From: Fengguang Wu Date: Fri, 17 Jan 2014 08:11:52 +0800 Subject: [PATCH] accept custom list of threads to run Signed-off-by: Fengguang Wu --- runtest.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/runtest.py b/runtest.py index 14d2467..8d4a2cf 100755 --- a/runtest.py +++ b/runtest.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/python import time import subprocess @@ -48,12 +48,12 @@ class linux_stat(): return 1.0 * idle / (idle + busy) -duration=5 - -if len(sys.argv) != 2: - print >> sys.stderr, 'Usage: runtest.py ' +if len(sys.argv) < 4: + print >> sys.stderr, 'Usage: runtest.py ' sys.exit(1) cmd = sys.argv[1] +duration = int(sys.argv[2]) +threads = sys.argv[3:] nr_cores=0 r = re.compile('^processor') @@ -87,7 +87,8 @@ if arch == 'ppc64': print 'tasks,processes,processes_idle,threads,threads_idle,linear' print '0,0,100,0,100,0' -for i in range(1, nr_cores+1): +for i in threads: + i = int(i) c = './%s_processes -t %d -s %d' % (cmd, i, duration) before = linux_stat() pipe = subprocess.Popen(setarch + ' ' + c, shell=True, stdout=subprocess.PIPE).stdout -- 1.7.10.4