Merge lp:~aacid/ubuntu-ui-toolkit/lttng_ui_ready_tracepoint into lp:ubuntu-ui-toolkit/staging
- lttng_ui_ready_tracepoint
- Merge into staging
Status: | Rejected |
---|---|
Rejected by: | Albert Astals Cid |
Proposed branch: | lp:~aacid/ubuntu-ui-toolkit/lttng_ui_ready_tracepoint |
Merge into: | lp:ubuntu-ui-toolkit/staging |
Diff against target: |
342 lines (+235/-3) 11 files modified
components.api (+2/-0) debian/control (+1/-0) debian/qml-module-ubuntu-components.install (+1/-0) src/Ubuntu/Components/Components.pro (+2/-1) src/Ubuntu/Components/lttng/lttng.pro (+9/-0) src/Ubuntu/Components/lttng/tracepoints.c (+21/-0) src/Ubuntu/Components/lttng/uclttng_tp.h (+37/-0) src/Ubuntu/Components/plugin/plugin.cpp (+11/-0) src/Ubuntu/Components/plugin/plugin.pri (+9/-2) src/Ubuntu/Components/plugin/uclttng.cpp (+104/-0) src/Ubuntu/Components/plugin/uclttng.h (+38/-0) |
To merge this branch: | bzr merge lp:~aacid/ubuntu-ui-toolkit/lttng_ui_ready_tracepoint |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
ubuntu-sdk-build-bot | continuous-integration | Approve | |
Cris Dywan | Needs Fixing | ||
Loïc Molinari | Pending | ||
Review via email: mp+298618@code.launchpad.net |
Commit message
Add LTTNG.userInter
With it developers can signal to lttng that their UI is ready
Description of the change
Can be tested with http://
- 2023. By Albert Astals Cid
-
Update components.api
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2022
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2022
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2022
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2022
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2023
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2023
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2023
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
- 2024. By Albert Astals Cid
-
install the .so and only create one .so
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2023
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2023
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2024
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2024
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2024
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
- 2025. By Albert Astals Cid
-
the world is too pedantic and makes me waste time
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2024
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2024
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2025
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2025
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2025
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2025
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2025
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
- 2026. By Albert Astals Cid
-
soname without version
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2026
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2026
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2026
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2026
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2026
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2026
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2026
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2026
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2026
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2026
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
Florian Boucault (fboucault) wrote : | # |
#ifndef UPM_RENDERING_
Florian Boucault (fboucault) wrote : | # |
Needs documentation: 1 example + a short explanation of where it is typically used
Cris Dywan (kalikiana) wrote : | # |
Me thinks this could live in PerformanceMetrics since it's another aspect of "how to measure performance".
Examples would be nice, for instance "If used in a messaging application, ready could mean that all visible messages are rendered on screen. In a camera use case, once the view finder shows a picture it's ready to use."
Maybe once this lands we can have a blog post with some code patterns to answer those questions, some of which might not be trivial.
Should lttng be in Recommends? To ensure it's available on a developer machine, albeit not required. And I'll assume it's seeded on phone images?
Florian Boucault (fboucault) wrote : | # |
Loic is thinking that we might have a Ubuntu.Metrics module in the future. Maybe it belongs there rather than in Ubuntu.Components
- 2027. By Albert Astals Cid
-
fix the ifdef/define
- 2028. By Albert Astals Cid
-
Add code/documentation
Albert Astals Cid (aacid) wrote : | # |
> #ifndef UPM_RENDERING_
Fixed
Albert Astals Cid (aacid) wrote : | # |
> Needs documentation: 1 example + a short explanation of where it is typically
> used
Added some documentation, please review
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2027
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2027
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
- 2029. By Albert Astals Cid
-
Add Recommends as per kalikiana's suggestion
Albert Astals Cid (aacid) wrote : | # |
> Me thinks this could live in PerformanceMetrics since it's another aspect of
> "how to measure performance".
I'm going to need someone else to make the decision:
A) leave it here
B) Move it to PerformanceMetrics
C) Create a new Metrics module that Loic will later extend
Who can make a call on this?
> Examples would be nice, for instance "If used in a messaging application,
> ready could mean that all visible messages are rendered on screen. In a camera
> use case, once the view finder shows a picture it's ready to use."
> Maybe once this lands we can have a blog post with some code patterns to
> answer those questions, some of which might not be trivial.
I think the "That is the program has loaded enough buttons, labels, etc. so that the user can now start using it." should be enough for people to understand it, but if you have a better wording/suggestion i'm open to adding that instead.
>
> Should lttng be in Recommends? To ensure it's available on a developer
> machine, albeit not required. And I'll assume it's seeded on phone images?
Added as Recommends, liblttng-ust0 is required by lots of stuff on the phone, so yes it's already in the image.
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2027
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2027
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2027
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2029
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2029
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2029
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2029
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2029
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
Cris Dywan (kalikiana) wrote : | # |
> > Me thinks this could live in PerformanceMetrics since it's another aspect of
> > "how to measure performance".
>
> I'm going to need someone else to make the decision:
> A) leave it here
> B) Move it to PerformanceMetrics
> C) Create a new Metrics module that Loic will later extend
>
> Who can make a call on this?
A new module should have good reason to be added. Right now it's a single function.
Is there an argument warranting a new module? Florian didn't seem to have a strong opinion when I asked him.
How would "Metrics" differ from "PerformanceMet
Albert Astals Cid (aacid) wrote : | # |
Loic can you comment on why we would need a new module?
Loïc Molinari (loic.molinari) wrote : | # |
The metrics library is now ready to be reviewed here [1]. Maybe we can discuss the naming there, the main reason being that it contains all kind of metrics (to be either logged to various devices and rendered as an overlay on top of QtQuick windows).
In light of this new library, I think it makes it's more consistent to integrate the feature proposed in this MR directly with the new library. So, Albert, I basically ported and integrated your nice work to the new lib in these 3 MRs [2][3][4].
[1] https:/
[2] https:/
[3] https:/
[4] https:/
Albert Astals Cid (aacid) wrote : | # |
Ok, abandoned this MR
Unmerged revisions
- 2029. By Albert Astals Cid
-
Add Recommends as per kalikiana's suggestion
- 2028. By Albert Astals Cid
-
Add code/documentation
- 2027. By Albert Astals Cid
-
fix the ifdef/define
- 2026. By Albert Astals Cid
-
soname without version
- 2025. By Albert Astals Cid
-
the world is too pedantic and makes me waste time
- 2024. By Albert Astals Cid
-
install the .so and only create one .so
- 2023. By Albert Astals Cid
-
Update components.api
- 2022. By Albert Astals Cid
-
Add LTTNG.userInter
faceReady With it developers can signal to lttng that their UI is ready
Preview Diff
1 | === modified file 'components.api' |
2 | --- components.api 2016-06-27 10:03:01 +0000 |
3 | +++ components.api 2016-06-30 12:40:45 +0000 |
4 | @@ -489,6 +489,8 @@ |
5 | property var model |
6 | property bool multiSelection |
7 | property int selectedIndex |
8 | +Ubuntu.Components.LTTNG 1.3: QtObject singleton |
9 | + function userInterfaceReady() |
10 | Ubuntu.Components.Label 1.0 0.1: Text |
11 | property string fontSize |
12 | Ubuntu.Components.Label 1.3 UbuntuToolkit::UCLabel: Text |
13 | |
14 | === modified file 'debian/control' |
15 | --- debian/control 2016-06-24 13:10:20 +0000 |
16 | +++ debian/control 2016-06-30 12:40:45 +0000 |
17 | @@ -83,6 +83,7 @@ |
18 | ubuntu-ui-toolkit-theme (= ${binary:Version}), |
19 | ${misc:Depends}, |
20 | ${shlibs:Depends}, |
21 | +Recommends: liblttng-ust0, |
22 | Conflicts: qt-components-ubuntu, |
23 | Breaks: qtdeclarative5-ubuntu-ui-toolkit-plugin (<< ${source:Version}), |
24 | Replaces: qt-components-ubuntu, |
25 | |
26 | === modified file 'debian/qml-module-ubuntu-components.install' |
27 | --- debian/qml-module-ubuntu-components.install 2016-06-23 09:13:51 +0000 |
28 | +++ debian/qml-module-ubuntu-components.install 2016-06-30 12:40:45 +0000 |
29 | @@ -22,6 +22,7 @@ |
30 | usr/lib/*/qt5/qml/Ubuntu/Components/Styles/qmldir |
31 | usr/lib/*/qt5/qml/Ubuntu/Components/artwork |
32 | usr/lib/*/qt5/qml/Ubuntu/Components/libUbuntuComponents.so |
33 | +usr/lib/*/qt5/qml/Ubuntu/Components/libUbuntuComponentsLTTNG.so |
34 | usr/lib/*/qt5/qml/Ubuntu/Components/plugins.qmltypes |
35 | usr/lib/*/qt5/qml/Ubuntu/Components/qmldir |
36 | usr/share/locale/*/LC_MESSAGES/ubuntu-ui-toolkit.mo |
37 | |
38 | === modified file 'src/Ubuntu/Components/Components.pro' |
39 | --- src/Ubuntu/Components/Components.pro 2016-06-23 13:37:24 +0000 |
40 | +++ src/Ubuntu/Components/Components.pro 2016-06-30 12:40:45 +0000 |
41 | @@ -6,4 +6,5 @@ |
42 | Popups \ |
43 | Styles \ |
44 | Themes \ |
45 | - Labs |
46 | + Labs \ |
47 | + lttng |
48 | |
49 | === added directory 'src/Ubuntu/Components/lttng' |
50 | === added file 'src/Ubuntu/Components/lttng/lttng.pro' |
51 | --- src/Ubuntu/Components/lttng/lttng.pro 1970-01-01 00:00:00 +0000 |
52 | +++ src/Ubuntu/Components/lttng/lttng.pro 2016-06-30 12:40:45 +0000 |
53 | @@ -0,0 +1,9 @@ |
54 | +TEMPLATE = lib |
55 | +TARGET = UbuntuComponentsLTTNG |
56 | +SOURCES = tracepoints.c |
57 | +LIBS += -llttng-ust |
58 | +CONFIG -= create_prl |
59 | +CONFIG += unversioned_libname |
60 | + |
61 | +target.path = $$[QT_INSTALL_QML]/Ubuntu/Components |
62 | +INSTALLS += target |
63 | |
64 | === added file 'src/Ubuntu/Components/lttng/tracepoints.c' |
65 | --- src/Ubuntu/Components/lttng/tracepoints.c 1970-01-01 00:00:00 +0000 |
66 | +++ src/Ubuntu/Components/lttng/tracepoints.c 2016-06-30 12:40:45 +0000 |
67 | @@ -0,0 +1,21 @@ |
68 | +/* |
69 | + * Copyright 2016 Canonical Ltd. |
70 | + * |
71 | + * This program is free software; you can redistribute it and/or modify |
72 | + * it under the terms of the GNU Lesser General Public License as published by |
73 | + * the Free Software Foundation; version 3. |
74 | + * |
75 | + * This program is distributed in the hope that it will be useful, |
76 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
77 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
78 | + * GNU Lesser General Public License for more details. |
79 | + * |
80 | + * You should have received a copy of the GNU Lesser General Public License |
81 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
82 | + * |
83 | + */ |
84 | + |
85 | +/* The probes need to be compiled in a C file (not C++) */ |
86 | +#define TRACEPOINT_CREATE_PROBES |
87 | + |
88 | +#include "uclttng_tp.h" |
89 | |
90 | === added file 'src/Ubuntu/Components/lttng/uclttng_tp.h' |
91 | --- src/Ubuntu/Components/lttng/uclttng_tp.h 1970-01-01 00:00:00 +0000 |
92 | +++ src/Ubuntu/Components/lttng/uclttng_tp.h 2016-06-30 12:40:45 +0000 |
93 | @@ -0,0 +1,37 @@ |
94 | +/* |
95 | + * Copyright 2016 Canonical Ltd. |
96 | + * |
97 | + * This program is free software; you can redistribute it and/or modify |
98 | + * it under the terms of the GNU Lesser General Public License as published by |
99 | + * the Free Software Foundation; version 3. |
100 | + * |
101 | + * This program is distributed in the hope that it will be useful, |
102 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
103 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
104 | + * GNU Lesser General Public License for more details. |
105 | + * |
106 | + * You should have received a copy of the GNU Lesser General Public License |
107 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
108 | + * |
109 | + */ |
110 | + |
111 | +#undef TRACEPOINT_PROVIDER |
112 | +#define TRACEPOINT_PROVIDER uc_lttng |
113 | + |
114 | +#if !defined(UC_LTTNG_TP_H_) || defined(TRACEPOINT_HEADER_MULTI_READ) |
115 | +#define UC_LTTNG_TP_H_ |
116 | + |
117 | +#include <lttng/tracepoint.h> |
118 | + |
119 | +TRACEPOINT_EVENT(uc_lttng, user_interface_ready, |
120 | + TP_ARGS(), |
121 | + TP_FIELDS() |
122 | +) |
123 | + |
124 | +#endif |
125 | + |
126 | +#undef TRACEPOINT_INCLUDE |
127 | +#define TRACEPOINT_INCLUDE "./uclttng_tp.h" |
128 | + |
129 | +/* This part must be outside ifdef protection */ |
130 | +#include <lttng/tracepoint-event.h> |
131 | |
132 | === modified file 'src/Ubuntu/Components/plugin/plugin.cpp' |
133 | --- src/Ubuntu/Components/plugin/plugin.cpp 2016-06-21 14:21:46 +0000 |
134 | +++ src/Ubuntu/Components/plugin/plugin.cpp 2016-06-30 12:40:45 +0000 |
135 | @@ -17,10 +17,19 @@ |
136 | |
137 | #include <QtQml/QQmlEngine> |
138 | #include "plugin.h" |
139 | +#include "uclttng.h" |
140 | #include "ucnamespace.h" |
141 | #include <ubuntutoolkitmodule.h> |
142 | #include <ubuntugesturesmodule.h> |
143 | |
144 | +static QObject *lttng_singleton_provider(QQmlEngine *engine, QJSEngine *scriptEngine) |
145 | +{ |
146 | + Q_UNUSED(engine) |
147 | + Q_UNUSED(scriptEngine) |
148 | + |
149 | + return new UbuntuComponentsLTTNG(); |
150 | +} |
151 | + |
152 | UbuntuComponentsPlugin::~UbuntuComponentsPlugin() |
153 | { |
154 | UT_PREPEND_NAMESPACE(UbuntuToolkitModule)::undefineModule(); |
155 | @@ -34,6 +43,8 @@ |
156 | |
157 | qmlRegisterSimpleSingletonType<UbuntuToolkit::UCNamespace>(uri, 1, 2, "Ubuntu"); |
158 | qmlRegisterSimpleSingletonType<UbuntuToolkit::UCNamespaceV13>(uri, 1, 3, "Ubuntu"); |
159 | + qmlRegisterSingletonType<UbuntuComponentsLTTNG>(uri, 1, 3, "LTTNG", lttng_singleton_provider); |
160 | + |
161 | |
162 | UG_PREPEND_NAMESPACE(UbuntuGesturesModule)::defineModule(uri); |
163 | UT_PREPEND_NAMESPACE(UbuntuToolkitModule)::defineModule(); |
164 | |
165 | === modified file 'src/Ubuntu/Components/plugin/plugin.pri' |
166 | --- src/Ubuntu/Components/plugin/plugin.pri 2016-06-17 15:55:58 +0000 |
167 | +++ src/Ubuntu/Components/plugin/plugin.pri 2016-06-30 12:40:45 +0000 |
168 | @@ -5,12 +5,19 @@ |
169 | QT += v8-private |
170 | } |
171 | |
172 | +DEFINES += LTTNG_INSTALL_LIB_PATH=\\\"$$[QT_INSTALL_QML]/$$TARGETPATH/libUbuntuComponentsLTTNG.so\\\" |
173 | +DEFINES += LTTNG_BUILD_LIB_PATH=\\\"$$OUT_PWD/lttng/libUbuntuComponentsLTTNG.so\\\" |
174 | + |
175 | CONFIG += no_keywords c++11 |
176 | |
177 | INCLUDEPATH+=$$PWD |
178 | |
179 | HEADERS += $$PWD/plugin.h \ |
180 | - $$PWD/ucnamespace.h |
181 | + $$PWD/ucnamespace.h \ |
182 | + $$PWD/uclttng.h |
183 | |
184 | SOURCES += $$PWD/plugin.cpp \ |
185 | - $$PWD/ucnamespace.cpp |
186 | + $$PWD/ucnamespace.cpp \ |
187 | + $$PWD/uclttng.cpp |
188 | + |
189 | +LIBS += -ldl |
190 | \ No newline at end of file |
191 | |
192 | === added file 'src/Ubuntu/Components/plugin/uclttng.cpp' |
193 | --- src/Ubuntu/Components/plugin/uclttng.cpp 1970-01-01 00:00:00 +0000 |
194 | +++ src/Ubuntu/Components/plugin/uclttng.cpp 2016-06-30 12:40:45 +0000 |
195 | @@ -0,0 +1,104 @@ |
196 | +/* |
197 | + * Copyright 2016 Canonical Ltd. |
198 | + * |
199 | + * This program is free software; you can redistribute it and/or modify |
200 | + * it under the terms of the GNU Lesser General Public License as published by |
201 | + * the Free Software Foundation; version 3. |
202 | + * |
203 | + * This program is distributed in the hope that it will be useful, |
204 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
205 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
206 | + * GNU Lesser General Public License for more details. |
207 | + * |
208 | + * You should have received a copy of the GNU Lesser General Public License |
209 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
210 | + * |
211 | + */ |
212 | + |
213 | +#include "uclttng.h" |
214 | + |
215 | +#include <QDebug> |
216 | +#include <QtCore/qmath.h> |
217 | + |
218 | +#include <dlfcn.h> |
219 | + |
220 | +#define TRACEPOINT_DEFINE |
221 | +#define TRACEPOINT_PROBE_DYNAMIC_LINKAGE |
222 | +#include "../lttng/uclttng_tp.h" |
223 | + |
224 | +/*! |
225 | + * \qmltype LTTNG |
226 | + * \instantiates UbuntuComponentsLTTNG |
227 | + * \inqmlmodule Ubuntu.Components |
228 | + * \ingroup ubuntu |
229 | + * \brief Singleton to emit LTTNG tracepoints. |
230 | + * |
231 | + * Logging to LTTNG can be useful for posterior analysis. This class |
232 | + * provides a singleton that can be used to emit LTTNG tracepoints (at |
233 | + * this point only the userInterfaceReady one). |
234 | + * |
235 | + * Example: |
236 | + * \qml |
237 | + * import QtQuick 2.4 |
238 | + * import Ubuntu.Components 1.3 |
239 | + * |
240 | + * MainView { |
241 | + * width: units.gu(48) |
242 | + * height: units.gu(60) |
243 | + * Page { |
244 | + * header: PageHeader { |
245 | + * id: pageHeader |
246 | + * title: "Simple page" |
247 | + * } |
248 | + * Button { |
249 | + * anchors { |
250 | + * horizontalCenter: parent.horizontalCenter |
251 | + * top: pageHeader.bottom |
252 | + * topMargin: units.gu(5) |
253 | + * } |
254 | + * width: units.gu(15) |
255 | + * text: "Push me" |
256 | + * } |
257 | + * } |
258 | + * Component.onCompleted: LTTNG.userInterfaceReady(); |
259 | + * } |
260 | + * \endqml |
261 | + */ |
262 | +UbuntuComponentsLTTNG::UbuntuComponentsLTTNG(QObject* parent) : |
263 | + QObject(parent), |
264 | + m_lttngLib(nullptr), |
265 | + m_lttngLibLoadTried(false) |
266 | +{ |
267 | +} |
268 | + |
269 | +UbuntuComponentsLTTNG::~UbuntuComponentsLTTNG() |
270 | +{ |
271 | + dlclose(m_lttngLib); |
272 | +} |
273 | + |
274 | +/*! |
275 | + * \qmlmethod void LTTNG::userInterfaceReady() |
276 | + * Logs an LTTNG tracepoint about the user interface being ready. That is |
277 | + * the program has loaded enough buttons, labels, etc. so that |
278 | + * the user can now start using it. |
279 | + */ |
280 | +void UbuntuComponentsLTTNG::userInterfaceReady() |
281 | +{ |
282 | + if (!m_lttngLib && !m_lttngLibLoadTried) { |
283 | + m_lttngLibLoadTried = true; |
284 | + |
285 | + m_lttngLib = dlopen(LTTNG_INSTALL_LIB_PATH, RTLD_NOW); |
286 | + if (!m_lttngLib) { |
287 | + qWarning() << "Failed to load installed tracepoint provider: " << dlerror(); |
288 | + qWarning() << "Trying with build time one"; |
289 | + |
290 | + m_lttngLib = dlopen(LTTNG_BUILD_LIB_PATH, RTLD_NOW); |
291 | + if (!m_lttngLib) { |
292 | + qWarning() << "Failed to load build time tracepoint provider: " << dlerror(); |
293 | + } |
294 | + } |
295 | + } |
296 | + if (m_lttngLib) { |
297 | + tracepoint(uc_lttng, user_interface_ready); |
298 | + } |
299 | +} |
300 | |
301 | === added file 'src/Ubuntu/Components/plugin/uclttng.h' |
302 | --- src/Ubuntu/Components/plugin/uclttng.h 1970-01-01 00:00:00 +0000 |
303 | +++ src/Ubuntu/Components/plugin/uclttng.h 2016-06-30 12:40:45 +0000 |
304 | @@ -0,0 +1,38 @@ |
305 | +/* |
306 | + * Copyright 2016 Canonical Ltd. |
307 | + * |
308 | + * This program is free software; you can redistribute it and/or modify |
309 | + * it under the terms of the GNU Lesser General Public License as published by |
310 | + * the Free Software Foundation; version 3. |
311 | + * |
312 | + * This program is distributed in the hope that it will be useful, |
313 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
314 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
315 | + * GNU Lesser General Public License for more details. |
316 | + * |
317 | + * You should have received a copy of the GNU Lesser General Public License |
318 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
319 | + * |
320 | + */ |
321 | + |
322 | +#ifndef UCLTTNG_H |
323 | +#define UCLTTNG_H |
324 | + |
325 | +#include <QObject> |
326 | + |
327 | +class UbuntuComponentsLTTNG : public QObject |
328 | +{ |
329 | + Q_OBJECT |
330 | + |
331 | +public: |
332 | + explicit UbuntuComponentsLTTNG(QObject* parent = 0); |
333 | + ~UbuntuComponentsLTTNG(); |
334 | + |
335 | + Q_INVOKABLE void userInterfaceReady(); |
336 | + |
337 | +private: |
338 | + void* m_lttngLib; |
339 | + bool m_lttngLibLoadTried; |
340 | +}; |
341 | + |
342 | +#endif |
FAILED: Continuous integration, rev:2022 /jenkins. ubuntu. com/ubuntu- sdk/job/ ubuntu- ui-toolkit- ci-armhf- stable/ 971/ /jenkins. ubuntu. com/ubuntu- sdk/job/ generic- update- mp/4117/ console
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/ubuntu- sdk/job/ ubuntu- ui-toolkit- ci-armhf- stable/ 971/rebuild
https:/