Status: | Merged |
---|---|
Approved by: | Daniel d'Andrada |
Approved revision: | no longer in the source branch. |
Merged at revision: | 246 |
Proposed branch: | lp:~gerboland/qtmir/lttng |
Merge into: | lp:qtmir |
Prerequisite: | lp:~gerboland/qtmir/initialSurfaceGeometry |
Diff against target: |
309 lines (+87/-6) 11 files modified
debian/control (+3/-0) src/lttng-compiler.pri (+25/-0) src/modules/Unity/Application/Application.pro (+4/-0) src/modules/Unity/Application/application_manager.cpp (+14/-6) src/modules/Unity/Application/mirsurfacemanager.cpp (+4/-0) src/modules/Unity/Application/tracepoints.tp (+9/-0) src/platforms/mirserver/mirplacementstrategy.cpp (+5/-0) src/platforms/mirserver/mirserver.pro (+4/-0) src/platforms/mirserver/sessionauthorizer.cpp (+4/-0) src/platforms/mirserver/sessionlistener.cpp (+5/-0) src/platforms/mirserver/tracepoints.tp (+10/-0) |
To merge this branch: | bzr merge lp:~gerboland/qtmir/lttng |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel d'Andrada (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Review via email: mp+231750@code.launchpad.net |
This proposal supersedes a proposal from 2014-08-15.
Commit message
Add LTTng tracepoints
Description of the change
* Are there any related MPs required for this MP to build/function as expected? Please list.
N
* Did you perform an exploratory manual test run of your code change and any related functionality?
Y
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:233
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:234
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
Code looks ok, it's pretty simple. But didn't actually try out lttng.
I wonder if the traces are already good enough as they are or if we should add some parameters such as the process id of the client for which we create a surface so that you can separate traces from/for different clients.
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
> Code looks ok, it's pretty simple. But didn't actually try out lttng.
>
> I wonder if the traces are already good enough as they are or if we should add
> some parameters such as the process id of the client for which we create a
> surface so that you can separate traces from/for different clients.
I did as much as upstart-app-launch does - it just emits events, no paramaters attached. The main statistic we're interested in is the launch time for a single app. In that case, I don't think we care about separating the individual clients. We can always add more later.
Michał Sawicz (saviq) wrote : Posted in a previous version of this proposal | # |
This needs another review looks like?
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:242
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:244
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:245
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:246
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Daniel d'Andrada (dandrader) wrote : | # |
Still looks fine.
- 237. By Daniel d'Andrada
-
Revamp screenshotting to use an image provider again, removing screenshot-related methods on Application
Implementing sourceSize support to scale down images if needed to save memory Fixes: 1359819, 1359821
Approved by: Michał Sawicz, Gerry Boland, Michael Zanetti - 238. By Daniel van Vugt
-
Add support for building against Mir when it's installed somewhere other
than /usr (like with a custom $PKG_CONFIG_PATH).
Approved by: Gerry Boland, PS Jenkins bot - 239. By PS Jenkins bot
-
Releasing 0.4.2+14.
10.20140825- 0ubuntu1 - 240. By Cemil Azizoglu
-
Rebuild for the Mir 0.7.0 release.
Approved by: Michał Sawicz - 241. By PS Jenkins bot
-
Releasing 0.4.2+14.
10.20140829- 0ubuntu1 - 242. By Nick Dedekind
-
Added support for nested prompt sessions. Fixes: 1358388
Approved by: Gerry Boland, PS Jenkins bot - 243. By PS Jenkins bot
-
Releasing 0.4.3+14.
10.20140903- 0ubuntu1 - 244. By Gerry Boland
-
Add lttng tracepoints
Preview Diff
1 | === modified file 'debian/control' |
2 | --- debian/control 2014-08-21 15:06:43 +0000 |
3 | +++ debian/control 2014-09-04 11:12:02 +0000 |
4 | @@ -11,6 +11,7 @@ |
5 | libboost-system-dev, |
6 | libfontconfig1-dev, |
7 | libglib2.0-dev, |
8 | + liblttng-ust-dev, |
9 | libmirclient-dev (>= 0.6.0), |
10 | libmirserver-dev (>= 0.6.0), |
11 | libprocess-cpp-dev, |
12 | @@ -25,6 +26,8 @@ |
13 | libmircommon-dev, |
14 | pkg-config, |
15 | protobuf-compiler, |
16 | +# lttng-gen-ts needs python3, but doesn't depend on it itself: bug 1359147 |
17 | + python3:any, |
18 | qt5-default, |
19 | qtbase5-dev, |
20 | qtbase5-private-dev, |
21 | |
22 | === added file 'src/lttng-compiler.pri' |
23 | --- src/lttng-compiler.pri 1970-01-01 00:00:00 +0000 |
24 | +++ src/lttng-compiler.pri 2014-09-04 11:12:02 +0000 |
25 | @@ -0,0 +1,25 @@ |
26 | +# Add extra compiler to handle LTTng TP files |
27 | +# Append the files to the LTTNG_TP_FILES list |
28 | + |
29 | +# Note by Gerry (Aug 2014) - I tried to have lttng-gen-tp generate an object file but it failed to link with |
30 | +# the shared library we want. If there's a way to pass -fPIC to lttng-gen-tp, this workaround can be avoided |
31 | +QMAKE_EXTRA_COMPILERS += lttng_gen_tp_header |
32 | +lttng_gen_tp_header.name = "Generating headers .TP files and adding to HEADERS list" |
33 | +lttng_gen_tp_header.input = LTTNG_TP_FILES |
34 | +lttng_gen_tp_header.output = $${OUT_PWD}/${QMAKE_FILE_BASE}.h |
35 | +lttng_gen_tp_header.commands = lttng-gen-tp -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} |
36 | +lttng_gen_tp_header.dependency_type = TYPE_H |
37 | +lttng_gen_tp_header.variable_out = HEADERS #appends the generated file name to the HEADERS list |
38 | +lttng_gen_tp_header.CONFIG = no_link target_predeps |
39 | + |
40 | +QMAKE_EXTRA_COMPILERS += lttng_gen_tp_sources |
41 | +lttng_gen_tp_sources.name = "Generating sources from .TP files and adding to SOURCES list" |
42 | +lttng_gen_tp_sources.input = LTTNG_TP_FILES |
43 | +lttng_gen_tp_sources.output = $${OUT_PWD}/${QMAKE_FILE_BASE}.c |
44 | +lttng_gen_tp_sources.commands = lttng-gen-tp -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} |
45 | +lttng_gen_tp_sources.dependency_type = TYPE_C |
46 | +lttng_gen_tp_sources.variable_out = SOURCES #appends the generated file name to the SOURCES list |
47 | +lttng_gen_tp_sources.CONFIG = no_link target_predeps |
48 | + |
49 | +CONFIG += link_pkgconfig |
50 | +PKGCONFIG += lttng-ust |
51 | |
52 | === modified file 'src/modules/Unity/Application/Application.pro' |
53 | --- src/modules/Unity/Application/Application.pro 2014-08-29 11:15:51 +0000 |
54 | +++ src/modules/Unity/Application/Application.pro 2014-09-04 11:12:02 +0000 |
55 | @@ -1,3 +1,5 @@ |
56 | +include(../../../lttng-compiler.pri) |
57 | + |
58 | TARGET = unityapplicationplugin |
59 | TEMPLATE = lib |
60 | |
61 | @@ -64,6 +66,8 @@ |
62 | sessionmodel.h \ |
63 | upstart/applicationcontroller.h |
64 | |
65 | +LTTNG_TP_FILES += tracepoints.tp |
66 | + |
67 | installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /) |
68 | |
69 | QML_FILES = qmldir |
70 | |
71 | === modified file 'src/modules/Unity/Application/application_manager.cpp' |
72 | --- src/modules/Unity/Application/application_manager.cpp 2014-08-29 11:48:54 +0000 |
73 | +++ src/modules/Unity/Application/application_manager.cpp 2014-09-04 11:12:02 +0000 |
74 | @@ -23,7 +23,7 @@ |
75 | #include "proc_info.h" |
76 | #include "taskcontroller.h" |
77 | #include "upstart/applicationcontroller.h" |
78 | - |
79 | +#include "tracepoints.h" // generated from tracepoints.tp |
80 | |
81 | // mirserver |
82 | #include "mirserverconfiguration.h" |
83 | @@ -424,6 +424,7 @@ |
84 | Application *ApplicationManager::startApplication(const QString &inputAppId, ExecFlags flags, |
85 | const QStringList &arguments) |
86 | { |
87 | + tracepoint(qtmir, startApplication); |
88 | QString appId = toShortAppIdIfPossible(inputAppId); |
89 | qCDebug(QTMIR_APPLICATIONS) << "ApplicationManager::startApplication - this=" << this << "appId" << qPrintable(appId); |
90 | |
91 | @@ -461,6 +462,7 @@ |
92 | |
93 | void ApplicationManager::onProcessStarting(const QString &appId) |
94 | { |
95 | + tracepoint(qtmir, onProcessStarting); |
96 | qCDebug(QTMIR_APPLICATIONS) << "ApplicationManager::onProcessStarting - appId=" << appId; |
97 | |
98 | Application *application = findApplication(appId); |
99 | @@ -562,6 +564,7 @@ |
100 | |
101 | void ApplicationManager::onProcessStopped(const QString &appId) |
102 | { |
103 | + tracepoint(qtmir, onProcessStopped); |
104 | qCDebug(QTMIR_APPLICATIONS) << "ApplicationManager::onProcessStopped - appId=" << appId; |
105 | Application *application = findApplication(appId); |
106 | |
107 | @@ -637,16 +640,21 @@ |
108 | |
109 | void ApplicationManager::authorizeSession(const quint64 pid, bool &authorized) |
110 | { |
111 | + tracepoint(qtmir, authorizeSession); |
112 | authorized = false; //to be proven wrong |
113 | |
114 | qCDebug(QTMIR_APPLICATIONS) << "ApplicationManager::authorizeSession - pid=" << pid; |
115 | |
116 | for (Application *app : m_applications) { |
117 | - if (app->state() == Application::Starting |
118 | - && m_taskController->appIdHasProcessId(app->appId(), pid)) { |
119 | - app->setPid(pid); |
120 | - authorized = true; |
121 | - return; |
122 | + if (app->state() == Application::Starting) { |
123 | + tracepoint(qtmir, appIdHasProcessId_start); |
124 | + if (m_taskController->appIdHasProcessId(app->appId(), pid)) { |
125 | + app->setPid(pid); |
126 | + authorized = true; |
127 | + tracepoint(qtmir, appIdHasProcessId_end, 1); //found |
128 | + return; |
129 | + } |
130 | + tracepoint(qtmir, appIdHasProcessId_end, 0); // not found |
131 | } |
132 | } |
133 | |
134 | |
135 | === modified file 'src/modules/Unity/Application/mirsurfacemanager.cpp' |
136 | --- src/modules/Unity/Application/mirsurfacemanager.cpp 2014-08-29 14:58:07 +0000 |
137 | +++ src/modules/Unity/Application/mirsurfacemanager.cpp 2014-09-04 11:12:02 +0000 |
138 | @@ -23,6 +23,7 @@ |
139 | #include "mirsurfacemanager.h" |
140 | #include "sessionmanager.h" |
141 | #include "application_manager.h" |
142 | +#include "tracepoints.h" // generated from tracepoints.tp |
143 | |
144 | // QPA mirserver |
145 | #include "nativeinterface.h" |
146 | @@ -114,6 +115,7 @@ |
147 | |
148 | // Only notify QML of surface creation once it has drawn its first frame. |
149 | connect(qmlSurface, &MirSurfaceItem::firstFrameDrawn, this, [&](MirSurfaceItem *item) { |
150 | + tracepoint(qtmir, firstFrameDrawn); |
151 | Q_EMIT surfaceCreated(item); |
152 | |
153 | insert(0, item); |
154 | @@ -128,7 +130,9 @@ |
155 | } |
156 | |
157 | remove(mirSurfaceItem); |
158 | + tracepoint(qtmir, surfaceDestroyed); |
159 | }); |
160 | + tracepoint(qtmir, surfaceCreated); |
161 | } |
162 | |
163 | void MirSurfaceManager::onSessionDestroyingSurface(const mir::scene::Session *session, |
164 | |
165 | === added file 'src/modules/Unity/Application/tracepoints.tp' |
166 | --- src/modules/Unity/Application/tracepoints.tp 1970-01-01 00:00:00 +0000 |
167 | +++ src/modules/Unity/Application/tracepoints.tp 2014-09-04 11:12:02 +0000 |
168 | @@ -0,0 +1,9 @@ |
169 | +TRACEPOINT_EVENT(qtmir, startApplication, TP_ARGS(0), TP_FIELDS()) |
170 | +TRACEPOINT_EVENT(qtmir, onProcessStarting, TP_ARGS(0), TP_FIELDS()) |
171 | +TRACEPOINT_EVENT(qtmir, authorizeSession, TP_ARGS(0), TP_FIELDS()) |
172 | +TRACEPOINT_EVENT(qtmir, onProcessStopped, TP_ARGS(0), TP_FIELDS()) |
173 | +TRACEPOINT_EVENT(qtmir, surfaceCreated, TP_ARGS(0), TP_FIELDS()) |
174 | +TRACEPOINT_EVENT(qtmir, surfaceDestroyed, TP_ARGS(0), TP_FIELDS()) |
175 | +TRACEPOINT_EVENT(qtmir, firstFrameDrawn, TP_ARGS(0), TP_FIELDS()) |
176 | +TRACEPOINT_EVENT(qtmir, appIdHasProcessId_start, TP_ARGS(0), TP_FIELDS()) |
177 | +TRACEPOINT_EVENT(qtmir, appIdHasProcessId_end, TP_ARGS(int, found), TP_FIELDS(ctf_integer(int, found, found))) |
178 | |
179 | === modified file 'src/platforms/mirserver/mirplacementstrategy.cpp' |
180 | --- src/platforms/mirserver/mirplacementstrategy.cpp 2014-07-01 13:38:06 +0000 |
181 | +++ src/platforms/mirserver/mirplacementstrategy.cpp 2014-09-04 11:12:02 +0000 |
182 | @@ -16,6 +16,7 @@ |
183 | |
184 | #include "mirplacementstrategy.h" |
185 | #include "logging.h" |
186 | +#include "tracepoints.h" // generated from tracepoints.tp |
187 | |
188 | #include <mir/geometry/rectangle.h> |
189 | #include <mir/shell/display_layout.h> |
190 | @@ -35,6 +36,8 @@ |
191 | MirPlacementStrategy::place(ms::Session const& /*session*/, |
192 | ms::SurfaceCreationParameters const& requestParameters) |
193 | { |
194 | + tracepoint(qtmirserver, surfacePlacementStart); |
195 | + |
196 | // TODO: Callback unity8 so that it can make a decision on that. |
197 | // unity8 must bear in mind that the called function will be on a Mir thread though. |
198 | // The QPA shouldn't be deciding for itself on such things. |
199 | @@ -50,5 +53,7 @@ |
200 | << requestParameters.size.width.as_int() << "," << requestParameters.size.height.as_int() << ") and returned (" |
201 | << placedParameters.size.width.as_int() << "," << placedParameters.size.height.as_int() << ")"; |
202 | |
203 | + tracepoint(qtmirserver, surfacePlacementEnd); |
204 | + |
205 | return placedParameters; |
206 | } |
207 | |
208 | === modified file 'src/platforms/mirserver/mirserver.pro' |
209 | --- src/platforms/mirserver/mirserver.pro 2014-08-05 09:14:13 +0000 |
210 | +++ src/platforms/mirserver/mirserver.pro 2014-09-04 11:12:02 +0000 |
211 | @@ -1,3 +1,5 @@ |
212 | +include(../../lttng-compiler.pri) |
213 | + |
214 | TARGET = qpa-mirserver |
215 | TEMPLATE = lib |
216 | |
217 | @@ -73,6 +75,8 @@ |
218 | unityprotobufservice.h \ |
219 | unityrpc.h |
220 | |
221 | +LTTNG_TP_FILES += tracepoints.tp |
222 | + |
223 | # Installation path |
224 | target.path += $$[QT_INSTALL_PLUGINS]/platforms |
225 | |
226 | |
227 | === modified file 'src/platforms/mirserver/sessionauthorizer.cpp' |
228 | --- src/platforms/mirserver/sessionauthorizer.cpp 2014-07-18 08:53:13 +0000 |
229 | +++ src/platforms/mirserver/sessionauthorizer.cpp 2014-09-04 11:12:02 +0000 |
230 | @@ -16,6 +16,7 @@ |
231 | |
232 | #include "sessionauthorizer.h" |
233 | #include "logging.h" |
234 | +#include "tracepoints.h" // generated from tracepoints.tp |
235 | |
236 | // mir |
237 | #include <mir/frontend/session_credentials.h> |
238 | @@ -33,10 +34,13 @@ |
239 | |
240 | bool SessionAuthorizer::connection_is_allowed(SessionCredentials const& creds) |
241 | { |
242 | + tracepoint(qtmirserver, sessionAuthorizeStart); |
243 | qCDebug(QTMIR_MIR_MESSAGES) << "SessionAuthorizer::connection_is_allowed - this=" << this << "pid=" << creds.pid(); |
244 | bool authorized = true; |
245 | |
246 | Q_EMIT requestAuthorizationForSession(creds.pid(), authorized); // needs to block until authorized value returned |
247 | + tracepoint(qtmirserver, sessionAuthorizeEnd); |
248 | + |
249 | return authorized; |
250 | } |
251 | |
252 | |
253 | === modified file 'src/platforms/mirserver/sessionlistener.cpp' |
254 | --- src/platforms/mirserver/sessionlistener.cpp 2014-07-01 13:38:06 +0000 |
255 | +++ src/platforms/mirserver/sessionlistener.cpp 2014-09-04 11:12:02 +0000 |
256 | @@ -16,6 +16,7 @@ |
257 | |
258 | #include "sessionlistener.h" |
259 | #include "logging.h" |
260 | +#include "tracepoints.h" // generated from tracepoints.tp |
261 | |
262 | namespace ms = mir::scene; |
263 | |
264 | @@ -38,12 +39,14 @@ |
265 | |
266 | void SessionListener::starting(std::shared_ptr<ms::Session> const& session) |
267 | { |
268 | + tracepoint(qtmirserver, starting); |
269 | qCDebug(QTMIR_MIR_MESSAGES) << "SessionListener::starting - this=" << this << "session=" << session.get(); |
270 | Q_EMIT sessionStarting(session); |
271 | } |
272 | |
273 | void SessionListener::stopping(std::shared_ptr<ms::Session> const& session) |
274 | { |
275 | + tracepoint(qtmirserver, stopping); |
276 | qCDebug(QTMIR_MIR_MESSAGES) << "SessionListener::stopping - this=" << this << "session=" << session.get(); |
277 | Q_EMIT sessionStopping(session); |
278 | } |
279 | @@ -62,6 +65,7 @@ |
280 | |
281 | void SessionListener::surface_created(ms::Session& session, std::shared_ptr<ms::Surface> const& surface) |
282 | { |
283 | + tracepoint(qtmirserver, surfaceCreated); |
284 | qCDebug(QTMIR_MIR_MESSAGES) << "SessionListener::surface_created - this=" << this << "session=" << &session |
285 | << "surface=" << surface.get(); |
286 | Q_EMIT sessionCreatedSurface(&session, surface); |
287 | @@ -69,6 +73,7 @@ |
288 | |
289 | void SessionListener::destroying_surface(ms::Session& session, std::shared_ptr<ms::Surface> const& surface) |
290 | { |
291 | + tracepoint(qtmirserver, surfaceDestroyed); |
292 | qCDebug(QTMIR_MIR_MESSAGES) << "SessionListener::destroying_surface - this=" << this << "session=" << &session |
293 | << "surface=" << surface.get(); |
294 | Q_EMIT sessionDestroyingSurface(&session, surface); |
295 | |
296 | === added file 'src/platforms/mirserver/tracepoints.tp' |
297 | --- src/platforms/mirserver/tracepoints.tp 1970-01-01 00:00:00 +0000 |
298 | +++ src/platforms/mirserver/tracepoints.tp 2014-09-04 11:12:02 +0000 |
299 | @@ -0,0 +1,10 @@ |
300 | +TRACEPOINT_EVENT(qtmirserver, starting, TP_ARGS(0), TP_FIELDS()) |
301 | +TRACEPOINT_EVENT(qtmirserver, stopping, TP_ARGS(0), TP_FIELDS()) |
302 | +TRACEPOINT_EVENT(qtmirserver, surfaceCreated, TP_ARGS(0), TP_FIELDS()) |
303 | +TRACEPOINT_EVENT(qtmirserver, surfaceDestroyed, TP_ARGS(0), TP_FIELDS()) |
304 | + |
305 | +TRACEPOINT_EVENT(qtmirserver, sessionAuthorizeStart, TP_ARGS(0), TP_FIELDS()) |
306 | +TRACEPOINT_EVENT(qtmirserver, sessionAuthorizeEnd, TP_ARGS(0), TP_FIELDS()) |
307 | + |
308 | +TRACEPOINT_EVENT(qtmirserver, surfacePlacementStart, TP_ARGS(0), TP_FIELDS()) |
309 | +TRACEPOINT_EVENT(qtmirserver, surfacePlacementEnd, TP_ARGS(0), TP_FIELDS()) |
To test, here's a good guide: http:// gould.cx/ ted/blog/ Measuring_ Upstart_ App_Launch_ using_LTTng