The dry run option "-d" only generates a output json file and doesn't call
rt-app. The output file can be then used with rt-app

Typical use should be:
workgen -d -o <output file> <input file>

Signed-off-by: Vincent Guittot <vincent.guit...@linaro.org>
---
 doc/workgen | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/doc/workgen b/doc/workgen
index 4951086..9a0d7cd 100755
--- a/doc/workgen
+++ b/doc/workgen
@@ -150,9 +150,10 @@ if __name__ == '__main__':
     outfile = "unikid.json"
     selfupdate = 0
     verbose = 0
+    dry_run = False
 
     try:
-        opts, args = getopt.getopt(sys.argv[1:], "o:av")
+        opts, args = getopt.getopt(sys.argv[1:], "o:avd")
     except getopt.GetoptError as err:
         print str(err) # will print something like "option -a not recognized"
         sys.exit(2)
@@ -164,15 +165,18 @@ if __name__ == '__main__':
             selfupate = 1
         if o == "-v":
             verbose = 1
+        if o == "-d":
+            dry_run = True
 
+    for f in args:
         if selfupdate:
             outfile = f
 
-    for f in args:
         check_suspend_json(f, outfile)
         check_unikid_json(outfile, outfile)
 
-        subprocess.call(["rt-app", outfile])
+        if not dry_run:
+            subprocess.call(["rt-app", outfile])
 
 
 
-- 
1.9.1


_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to