Merge lp:~aacid/ubuntu-performance-tests/work_with_qt_56 into lp:ubuntu-performance-tests

Proposed by Albert Astals Cid
Status: Merged
Merged at revision: 54
Proposed branch: lp:~aacid/ubuntu-performance-tests/work_with_qt_56
Merge into: lp:ubuntu-performance-tests
Diff against target: 49 lines (+28/-4)
1 file modified
kpi/dashqmlmetrics/runner.py (+28/-4)
To merge this branch: bzr merge lp:~aacid/ubuntu-performance-tests/work_with_qt_56
Reviewer Review Type Date Requested Status
Sergio Cazzolato Pending
Review via email: mp+303700@code.launchpad.net

Commit message

Work with Qt 5.6 qmlprofiler

To post a comment you must log in.
Revision history for this message
Sergio Cazzolato (sergio-j-cazzolato) wrote :

I modified the implementation and pushed to the trunk, it is working well with the old qmlprofiler version. Could you please validate the trunk against the new qmlprofiler?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'kpi/dashqmlmetrics/runner.py'
2--- kpi/dashqmlmetrics/runner.py 2016-07-06 04:26:30 +0000
3+++ kpi/dashqmlmetrics/runner.py 2016-08-23 15:59:09 +0000
4@@ -124,10 +124,25 @@
5 logger.info('Waiting for dash to start')
6 time.sleep(1)
7
8+ # Determine if qmlprofiler is >= 5.6
9+ qmlprofiler = subprocess.Popen(
10+ "qmlprofiler -fromStart", shell=True,
11+ universal_newlines=True, stdin=subprocess.PIPE,
12+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
13+ stdout, stderr = qmlprofiler.communicate()
14+
15+ is_new_qmlprofiler = "Unknown option" in stderr
16+
17 # Start the qmlprofiler, connects to localhost but is really the adb device
18- qmlprofiler = subprocess.Popen(
19- "qmlprofiler -v -fromStart -attach 127.0.0.1 -p 11111", shell=True,
20- universal_newlines=True, stdin=subprocess.PIPE)
21+ if is_new_qmlprofiler:
22+ qmlprofiler = subprocess.Popen(
23+ "qmlprofiler --interactive -attach 127.0.0.1 -p 11111", shell=True,
24+ universal_newlines=True, stdin=subprocess.PIPE,
25+ stderr=subprocess.PIPE)
26+ else:
27+ qmlprofiler = subprocess.Popen(
28+ "qmlprofiler -v -fromStart -attach 127.0.0.1 -p 11111", shell=True,
29+ universal_newlines=True, stdin=subprocess.PIPE)
30
31 # Wait for autopilot to finish
32 logger.info("Waiting for autopilot test to finish")
33@@ -135,7 +150,16 @@
34 logger.info("Autopilot test finished")
35
36 logger.info("Finishing QML profiler")
37- qmlprofiler.communicate("r\nq\n")
38+ if is_new_qmlprofiler:
39+ qmlprofiler.stdin.writelines("f trace_"+str(int(time.time()))+".qtd\n")
40+ qmlprofiler.stdin.flush()
41+ output = qmlprofiler.stderr.readline()
42+ while not "Data written to" in output:
43+ output = qmlprofiler.stderr.readline()
44+ qmlprofiler.stdin.writelines("q\n")
45+ qmlprofiler.communicate()
46+ else:
47+ qmlprofiler.communicate("r\nq\n")
48 qmlprofiler.wait()
49 logger.info("QML profiles finished")
50

Subscribers

People subscribed via source and target branches