create a script directory and add a script to run test program and collect data
cover create a script directory and add a script to run test program and collect data
create a script directory and add a script to run test program and collect data
- test scripts will help to run and collect the data, automate the test and re-producible by others
- run_rt-app.py runs rt-app on the target machine and collects the output log to host
- how to run:
$ fab -f run_rt-app.py run_app
Note: requires fabric (python program) on the host
--------------
Run example
--------------
$ fab -f run_rt-app.py run_app [[email protected]] Executing task 'run_app'
===========================================================
1. Conecting remote : [email protected]
===========================================================
running script on host [fri2], OS[Linux fri2 3.8.1-yocto-standard #1 SMP PREEMPT Sat Mar 16 03:20:59 PDT 2013 i686 GNU/Linux]
===========================================================
2. Running rt-app 1 times..
===========================================================
[[email protected]] run: echo "test log (period = 100000, execution time 20000) run 1 times on each 10 sec
" > /home/root/rt-app_run_log-2013-03-19-03-52.txt
[[email protected]] run: /usr/bin/rt-app -t 100000:20000:d -D 10 >> /home/root/rt-app_run_log-2013-03-19-03-52.txt [[email protected]] out: [rt-app] <notice> [0] Using SCHED_DEADLINE policy:
[[email protected]] out: [rt-app] <notice> [0] starting thread with period: 100000, exec: 20000,deadline: 100000, priority: 10 [[email protected]] out: [rt-app] <notice> [0] Locking pages in memory
[[email protected]] out: [rt-app] <notice> [0] Exiting.
[[email protected]] out:
[localhost] local: /usr/bin/scp [email protected]:/home/root/rt-app_run_log-2013-03-19-03-52.txt .
rt-app_run_log-2013-03-19-03-52.txt 100% 7552 7.4KB/s 00:00
==============================================================================
3. Run finished, and log file rt-app_run_log-2013-03-19-03-52.txt is copied to host.
==============================================================================
Done.
Disconnecting from [email protected]... done.
--------------
Log file output
--------------
cat /home/root/rt-app_run_log-2013-03-19-03-52.txt
test log (period = 100000, execution time 20000) run 1 times on each 10 sec
#idx period min_et max_et rel_st start end deadline dur. slack Budget Used Budget
0 100000 20000 20000 33061 1859244267 1859264275 1859344264 20008 79989
0 100000 20000 20000 133176 1859344382 1859364389 1859444264 20007 79876
0 100000 20000 20000 233177 1859444383 1859464391 1859544264 20009 79873
0 100000 20000 20000 333174 1859544380 1859564389 1859644264 20009 79875
0 100000 20000 20000 433186 1859644392 1859664402 1859744264 20010 79862
...
0 100000 20000 20000 9533182 1868744388 1868764398 1868844264 20009 79867
0 100000 20000 20000 9633185 1868844391 1868864400 1868944264 20010 79864
0 100000 20000 20000 9733182 1868944388 1868964398 1869044264 20010 79867
0 100000 20000 20000 9833141 1869044347 1869064356 1869144264 20009 79908
0 100000 20000 20000 9933162 1869144368 1869164375 1869244264 20007 79889
$
Insop Song (1):
create a script directory and add a script to run test program and
collect data
docs/00-INDEX | 4 +-- docs/00-README | 6 ++-- scripts/README | 1 + scripts/run_rt-app.py | 88 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 5 deletions(-) create mode 100644 scripts/README create mode 100644 scripts/run_rt-app.py
Signature · 1 line
1.7.9.5
PATCH 1/1 create a script directory and add a script to run test program and collect data
- run_rt-app.py runs rt-app on the target machine and collects the output log to host
- how to run:
$ fab -f run_rt-app.py run_app
Note: requires fabric (python program) on the host
--- docs/00-INDEX | 4 +-- docs/00-README | 6 ++-- scripts/README | 1 + scripts/run_rt-app.py | 88 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 5 deletions(-) create mode 100644 scripts/README create mode 100644 scripts/run_rt-app.py
docs/00-INDEX +2 -2
@@ -1,4 +1,4 @@ -This is a brief list of all the files in meta-virtualization/docs and what +This is a brief list of all the files in meta-realtime/docs and what they contain. If you add a documentation file, please list it here in alphabetical order as well.
@@ -6,5 +6,5 @@ alphabetical order as well. - this file. 00-README - - info on the goals of meta-virtualization and this docs subdir + - info on the goals of meta-realtime and this docs subdir
docs/00-README +3 -3
@@ -1,6 +1,6 @@ -meta-virtualization: docs +meta-realtime: docs ========================= -The docs subdirectory is a holding tank for meta-virtualization related +The docs subdirectory is a holding tank for meta-realtime related READMEs, documentation, testing information, configuration and other -notes that help the users of meta-virt. +notes that help the users of meta-realtime.
scripts/README new file +1 -0
@@ -0,0 +1 @@ +This directory contains Various useful scripts for working with meta-realtime
scripts/run_rt-app.py new file +88 -0
88 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Quoted 29 lines · Insop Song
-
run_rt-app.pyruns rt-app on the target machine and collects the output log to host- how to run:
$ fab -f run_rt-app.py run_appNote: requires fabric (python program) on the host
Signed-off-by Insop Song <[email protected]>--- docs/00-INDEX | 4 +-- docs/00-README | 6 ++-- scripts/README | 1 + scripts/run_rt-app.py | 88 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 5 deletions(-)create mode 100644
scripts/README
create mode 100644scripts/run_rt-app.pydocs/00-INDEX +1
-1@@ -1,4 +1,4 @@ -This is a brief list of all the files in meta-virtualization/docs and what +This is a brief list of all the files in meta-realtime/docs and what they contain. If you add a documentation file, please list it here in alphabetical order as well.
docs/00-INDEX alphabetical order as well. · line 9
Quoted 5 lines
docs/00-INDEX +1
-1@@ -6,5 +6,5 @@ alphabetical order as well. - this file. 00-README - - info on the goals of meta-virtualization and this docs subdir + - info on the goals of meta-realtime and this docs subdir
Something strange is happening here, I had cherry picked my meta-virt README structure over to meta-realtime, and fixed the references .. but the changes didn't get pushed out. I've done that now. So I'll drop these chunks of the patch.
Thanks for catching this.
The rest looks good, and I've merged the changes.
Bruce
Quoted 117 lines
docs/00-README +3
-3@@ -1,6 +1,6 @@ -meta-virtualization: docs +meta-realtime: docs ========================= -The docs subdirectory is a holding tank for meta-virtualization related +The docs subdirectory is a holding tank for meta-realtime related READMEs, documentation, testing information, configuration and other -notes that help the users of meta-virt. +notes that help the users of meta-realtime.scripts/README new file +1
-0@@ -0,0 +1 @@ +This directory contains Various useful scripts for working with meta-realtimescripts/run_rt-app.py new file +88
-0@@ -0,0 +1,88 @@ +# +# run rt-app on remote machine and collect the data +# +# note: +# +# 0. install fabric 1.6 on the develop host +# - $ pip install fabric +# +# 1. copy ssh public key (copy and paste host's "~/.ssh/id_rsa.pub" to the remote's ~/.ssh/authorized_keys) +# +# 2. update the "env.hosts" with your remote system +# +# 3. run the script from the host +# - $ fab -f run_rt-app.py run_app +# + +from __future__ import with_statement +from fabric.api import * +from fabric.contrib import * +from fabric.contrib.console import confirm + +import socket +import getpass +import datetime +import time +import datetime + + +env.hosts = ['[email protected]'] +remote_ip = env.hosts[0] + +now = datetime.datetime.now() + +YES = "/usr/bin/yes" +KILLALL = "/usr/bin/killall" +SCP = "/usr/bin/scp" + +RTAPP = "/usr/bin/rt-app" + +period_t = 100000 +run_t = 30000 + +num_run = 10 +sec_run = 100 + +dir_name = "/home/root" +f_name = "rt-app_run_log-%s.txt" % now.strftime("%Y-%m-%d-%H-%M") +file_name = "%s/%s" % (dir_name, f_name) + +def pre(): + print "\n===========================================================" + print "1. Conecting remote : %s" % env.hosts[0] + print "===========================================================\n" + + # scripts that runs on the remote + un = run("uname -a", quiet=True) + hn = run("hostname", quiet=True) + print "running script on host [%s], OS[%s]" % (hn, un) + +# +# run the app on the remote and collect the data into log +# +def main(): + print "\n===========================================================" + print "2. Running rt-app %s times.." % num_run + print "===========================================================\n" + + run('echo \"test log (period = %s, execution time %s) run %s times on each %s sec \n\n\" > %s' % \ + (period_t, run_t, num_run, sec_run, file_name)) + for i in range(0, num_run): + run("%s -t %s:%s:d -D %s >> %s" % \ + (RTAPP, period_t, run_t, sec_run, file_name)) + +# +# bring the data log to the host +# +def post(): + # running this from local host + local("%s %s:%s ." % (SCP, remote_ip, file_name)) + + print "\n==============================================================================" + print "3. Run finished, and log file ""%s"" is copied to host." % f_name + print "==============================================================================\n" + +def run_app(): + pre() + main() + post()
Thank you Bruce,
More documentations and scripts for testing and analysis the data will follow.
Regards,
Insop
Quoted 180 lines · Bruce Ashfield
Quoted 32 lines · Insop Song
-
run_rt-app.pyruns rt-app on the target machine and collects the output log to host- how to run:
$ fab -f run_rt-app.py run_appNote: requires fabric (python program) on the host
Signed-off-by Insop Song <[email protected]>--- docs/00-INDEX | 4 +-- docs/00-README | 6 ++-- scripts/README | 1 + scripts/run_rt-app.py | 88 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 5 deletions(-)create mode 100644
scripts/README
create mode 100644scripts/run_rt-app.pydocs/00-INDEX +0
-1@@ -1,4 +1,4 @@ -This is a brief list of all the files in meta-virtualization/docs andwhat
docs/00-INDEX +1
-0+This is a brief list of all the files in meta-realtime/docs and what they contain. If you add a documentation file, please list it here in alphabetical order as well.docs/00-INDEX alphabetical order as well. · line 9
Quoted 5 lines
docs/00-INDEX +1
-1@@ -6,5 +6,5 @@ alphabetical order as well. - this file. 00-README - - info on the goals of meta-virtualization and this docs subdir + - info on the goals of meta-realtime and this docs subdirSomething strange is happening here, I had cherry picked my meta-virt README structure over to meta-realtime, and fixed the references .. but the changes didn't get pushed out. I've done that now. So I'll drop these chunks of the patch.
Thanks for catching this.
The rest looks good, and I've merged the changes.
Bruce
Quoted 127 lines
docs/00-README +3
-3@@ -1,6 +1,6 @@ -meta-virtualization: docs +meta-realtime: docs ========================= -The docs subdirectory is a holding tank for meta-virtualization related +The docs subdirectory is a holding tank for meta-realtime related READMEs, documentation, testing information, configuration and other -notes that help the users of meta-virt. +notes that help the users of meta-realtime.scripts/README new file +1
-0@@ -0,0 +1 @@ +This directory contains Various useful scripts for working withmeta-realtime
scripts/run_rt-app.py new file +9
-0@@ -0,0 +1,88 @@ +# +# run rt-app on remote machine and collect the data +# +# note: +# +# 0. install fabric 1.6 on the develop host +# - $ pip install fabric +# +# 1. copy ssh public key (copy and paste host's "~/.ssh/id_rsa.pub" tothe remote's ~/.ssh/authorized_keys)
scripts/run_rt-app.py new file +42
-0+# +# 2. update the "env.hosts" with your remote system +# +# 3. run the script from the host +# - $ fab -f run_rt-app.py run_app +# + +from __future__ import with_statement +from fabric.api import * +from fabric.contrib import * +from fabric.contrib.console import confirm + +import socket +import getpass +import datetime +import time +import datetime + + +env.hosts = ['[email protected]'] +remote_ip = env.hosts[0] + +now = datetime.datetime.now() + +YES = "/usr/bin/yes" +KILLALL = "/usr/bin/killall" +SCP = "/usr/bin/scp" + +RTAPP = "/usr/bin/rt-app" + +period_t = 100000 +run_t = 30000 + +num_run = 10 +sec_run = 100 + +dir_name = "/home/root" +f_name = "rt-app_run_log-%s.txt" % now.strftime("%Y-%m-%d-%H-%M") +file_name = "%s/%s" % (dir_name, f_name) + +def pre(): + print"\n==========================================================="
scripts/run_rt-app.py new file +2
-0+ print "1. Conecting remote : %s" % env.hosts[0] + print"===========================================================\n"
scripts/run_rt-app.py new file +11
-0+ + # scripts that runs on the remote + un = run("uname -a", quiet=True) + hn = run("hostname", quiet=True) + print "running script on host [%s], OS[%s]" % (hn, un) + +# +# run the app on the remote and collect the data into log +# +def main(): + print"\n==========================================================="
scripts/run_rt-app.py new file +2
-0+ print "2. Running rt-app %s times.." % num_run + print"===========================================================\n"
scripts/run_rt-app.py new file +2
-0+ + run('echo \"test log (period = %s, execution time %s) run %s timeson each %s sec \n\n\" > %s' % \
scripts/run_rt-app.py new file +13
-0+ (period_t, run_t, num_run, sec_run, file_name)) + for i in range(0, num_run): + run("%s -t %s:%s:d -D %s >> %s" % \ + (RTAPP, period_t, run_t, sec_run, file_name)) + +# +# bring the data log to the host +# +def post(): + # running this from local host + local("%s %s:%s ." % (SCP, remote_ip, file_name)) + + print"\n=============================================================================="
+ print "3. Run finished, and log file ""%s"" is copied to host." %f_name
"==============================================================================\n"scripts/run_rt-app.py new file +5
-0+ +def run_app(): + pre() + main() + post()