[PATCH] accept custom list of threads to run

From: Fengguang Wu
Date: Thu Jan 16 2014 - 19:11:52 EST


Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
---
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 <testcase>'
+if len(sys.argv) < 4:
+ print >> sys.stderr, 'Usage: runtest.py <testcase> <duration> <threads...>'
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


--T4sUOijqQbZv57TR--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/