Merge lp:~seth-beinhart/lava-android-test/iozone-parser into lp:lava-android-test

Proposed by Seth Beinhart
Status: Merged
Merged at revision: 254
Proposed branch: lp:~seth-beinhart/lava-android-test/iozone-parser
Merge into: lp:lava-android-test
Diff against target: 123 lines (+87/-4) (has conflicts)
2 files modified
lava_android_test/test_definitions/iozone.py (+73/-4)
lava_android_test/test_definitions/iozone/iozone.sh (+14/-0)
Text conflict in lava_android_test/test_definitions/iozone.py
To merge this branch: bzr merge lp:~seth-beinhart/lava-android-test/iozone-parser
Reviewer Review Type Date Requested Status
Yongqin Liu Approve
vishal Pending
Linaro Validation Team Pending
Review via email: mp+158995@code.launchpad.net

Description of the change

Created a custom parser for Iozone to extract measurement and add them to the bundle.
I also made it easier for an end-user to use a cross compiled binary not located on the device. They simply need to put it in the Iozone folder and un-comment the section regarding it. The user can also specify multiple commands in the sh file for a broader test coverage.

The advantage of this is external tools can be used to analyze the bundle for trends and spot dramatic changes in performance.

This is based on the latest Iozone3_414 cross compiled for android. If needed I can upload the binary.

To post a comment you must log in.
Revision history for this message
Yongqin Liu (liuyq0307) wrote :

sorry for the late of this review.
could you share the output of "iozone -a -i 0 -i 2 -s 16m -V teststring -b iozone_results" for an example.

The parse logic is a little complicate, it's better to check that with an example.

And please delete the blank lines at the end of file lava_android_test/test_definitions/iozone.py

Revision history for this message
Seth Beinhart (seth-beinhart) wrote :

You can see the full stdout here
https://docs.google.com/file/d/0B7p5eKLGVuC5c3Y4WVlGUnI3ODQ/edit?usp=sharing
A snapshot of the dashboard is here
https://docs.google.com/file/d/0B7p5eKLGVuC5WU1odHl6ekFPems/edit?usp=sharing

I will fix your whitespace concerns soon.

Revision history for this message
Yongqin Liu (liuyq0307) wrote :

> You can see the full stdout here
> https://docs.google.com/file/d/0B7p5eKLGVuC5c3Y4WVlGUnI3ODQ/edit?usp=sharing
> A snapshot of the dashboard is here
> https://docs.google.com/file/d/0B7p5eKLGVuC5WU1odHl6ekFPems/edit?usp=sharing
Sorry, I don't have permisson for this doc

> I will fix your whitespace concerns soon.

Revision history for this message
Seth Beinhart (seth-beinhart) wrote :

Sorry about that. I thought I had set up the folder to have public access. (Thats what I get for being in a hurry)

You should now have full access.

240. By Seth Beinhart

Remove additional lines at the end of iozone.py

Revision history for this message
Seth Beinhart (seth-beinhart) wrote :

Lines removed

Revision history for this message
Yongqin Liu (liuyq0307) wrote :

Sorry for the late.

It's OK, will change some of the coding style when merge.

review: Approve
Revision history for this message
Yongqin Liu (liuyq0307) wrote :

Hi, Seth Beinhart

I merged it with some modification on the conflict, coding style and change for the test_case_id by change the parse name to real_parse.

Please checkout the latest lava-android-test source, try and check it again.

Thanks,
Yongqin Liu

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'lava_android_test/test_definitions/iozone'
2=== modified file 'lava_android_test/test_definitions/iozone.py'
3--- lava_android_test/test_definitions/iozone.py 2013-05-16 09:05:03 +0000
4+++ lava_android_test/test_definitions/iozone.py 2013-05-22 15:36:32 +0000
5@@ -18,6 +18,7 @@
6 # You should have received a copy of the GNU General Public License
7 # along with this program. If not, see <http://www.gnu.org/licenses/>.
8
9+<<<<<<< TREE
10 """
11 Perform the iozone test on the target device
12
13@@ -27,19 +28,87 @@
14 """
15 import lava_android_test.config
16 import lava_android_test.testdef
17+=======
18+#import lava_android_test.config
19+from lava_android_test.config import get_config
20+import lava_android_test.testdef
21+import os
22+import re
23+
24+class IozoneParser(lava_android_test.testdef.AndroidTestParser):
25+ '''Custom parser for Iozone. -b with a results file must be specified. The results
26+ file is not parsed. However the addition of this parameter causes an organized results report
27+ to be printed at the bottom
28+ '''
29+ PATTERN_REPORT = '(?P<report_name>.*?)report' #used to find each report
30+ PATTERN_UNITS='Output is in (?P<units>\S*)' #used to determined output units
31+
32+ def parse(self,result_filename='stdout.log', output_filename='stdout.log', test_name=''):
33+ '''Parse the results of stdout. This requires the -b option be specified to IOZONE.
34+ '''
35+ #filename = artifacts.stdout_pathname
36+ pat_report = re.compile(self.PATTERN_REPORT)
37+ pat_units = re.compile(self.PATTERN_UNITS)
38+ units=''
39+ with open(output_filename, 'r') as fd:
40+ lines=fd.readlines()
41+ for i in range(0,len(lines)):
42+ line = lines[i]
43+ match_report = pat_report.search(line)
44+ match_units = pat_units.search(line)
45+ if match_report: #found report.
46+ print "match found"
47+ ''' The results are the following format
48+ <report name> report
49+ reclen 1
50+ block_size results 1
51+ '''
52+ report_name=match_report.groupdict()['report_name'].replace("\"","")
53+ i+=1
54+ rclen_line = lines[i].replace("\"","")
55+ i+=1
56+ results_line = lines[i].replace("\"","")
57+ reclen_split = rclen_line.split()
58+ results_split = results_line.split()
59+ size=results_split[0] #first value is the block size
60+ for n in range(0,len(reclen_split)):
61+ results = {'test_case_id':"iozone_%sKB_%s_rclen_%s" % (report_name, str(size), str(reclen_split[n])),
62+ 'result':'pass',
63+ 'measurement':int(results_split[n+1]),'units':units}
64+ self.results['test_results'].append(results)
65+ elif match_units:
66+ units= match_units.groupdict()['units']
67+
68+
69+>>>>>>> MERGE-SOURCE
70
71 test_name = 'iozone'
72
73-INSTALL_STEPS_ADB_PRE = []
74-ADB_SHELL_STEPS = ['iozone -a -i 0 -i 2 -s 16m -V teststring']
75-PATTERN = "^\s*(?P<test_case_id>Status?):\s+(?P<result>(PASS|FAIL)?)\s+-\s+"
76+config = get_config()
77+curdir = os.path.realpath(os.path.dirname(__file__))
78+iozone_sh_name = 'iozone.sh'
79+iozone_dir_path = os.path.join(curdir, 'iozone')
80+#copy the whole directory over
81+#this will alow users to place the crosscompiled izone binary
82+#in the folder and modify iozone.sh to remount the root fs.
83+iozone_dir_android_path = os.path.join(config.installdir_android,
84+ test_name)
85+iozone_sh_android_path = os.path.join(iozone_dir_android_path,
86+ iozone_sh_name)
87+
88+INSTALL_STEPS_ADB_PRE = ['push %s %s ' % (iozone_dir_path,
89+ iozone_dir_android_path),
90+ 'shell chmod -R 777 %s' % iozone_dir_android_path]
91+
92+ADB_SHELL_STEPS = ["%s %s" %(iozone_sh_android_path, iozone_dir_android_path)]
93
94 inst = lava_android_test.testdef.AndroidTestInstaller(
95 steps_adb_pre=INSTALL_STEPS_ADB_PRE)
96 run = lava_android_test.testdef.AndroidTestRunner(
97 adbshell_steps=ADB_SHELL_STEPS)
98-parser = lava_android_test.testdef.AndroidTestParser(PATTERN)
99+parser = IozoneParser()
100 testobj = lava_android_test.testdef.AndroidTest(testname=test_name,
101 installer=inst,
102 runner=run,
103 parser=parser)
104+
105
106=== added file 'lava_android_test/test_definitions/iozone/iozone.sh'
107--- lava_android_test/test_definitions/iozone/iozone.sh 1970-01-01 00:00:00 +0000
108+++ lava_android_test/test_definitions/iozone/iozone.sh 2013-05-22 15:36:32 +0000
109@@ -0,0 +1,14 @@
110+#!/system/bin/sh
111+#$1 is the testing location. The -b must be specified for parser.
112+#the file itself does not matter as it is not used.
113+#The -b cause results reports to be printed to stdout.
114+
115+#uncomment the following and add cross compiled iozone to this directory.
116+#mount -o remount,rw /
117+#iozone_cmd=$1"/iozone -a -i 0 -i 2 -s 16m -V teststring -b iozone_results"
118+
119+#The original command with a -b so excel results are printed to stdout and can be parsed
120+iozone_cmd="iozone -a -i 0 -i 2 -s 16m -V teststring -b iozone_results"
121+echo execute command=${iozone_cmd}
122+${iozone_cmd}
123+echo IOZONE_RET_CODE=$?

Subscribers

People subscribed via source and target branches