Merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-metrics-lttng into lp:ubuntu-ui-toolkit/staging

Proposed by Loïc Molinari
Status: Merged
Approved by: Zsombor Egri
Approved revision: 2055
Merged at revision: 2066
Proposed branch: lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-metrics-lttng
Merge into: lp:ubuntu-ui-toolkit/staging
Prerequisite: lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-metrics
Diff against target: 472 lines (+329/-5)
13 files modified
debian/control (+1/-0)
debian/libubuntumetrics5.install (+1/-0)
src/Ubuntu/UbuntuMetrics/UbuntuMetrics.pro (+4/-0)
src/Ubuntu/UbuntuMetrics/logger.cpp (+87/-0)
src/Ubuntu/UbuntuMetrics/logger.h (+16/-0)
src/Ubuntu/UbuntuMetrics/lttng/lttng.c (+40/-0)
src/Ubuntu/UbuntuMetrics/lttng/lttng.pro (+8/-0)
src/Ubuntu/UbuntuMetrics/lttng/lttng_p.h (+58/-0)
src/Ubuntu/UbuntuMetrics/lttng/tracepoints.c (+21/-0)
src/Ubuntu/UbuntuMetrics/lttng/tracepoints_p.h (+72/-0)
src/Ubuntu/UbuntuToolkit/ubuntutoolkitmodule.cpp (+8/-2)
src/src.pro (+4/-0)
ubuntu-ui-toolkit-launcher/launcher.cpp (+9/-3)
To merge this branch: bzr merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-metrics-lttng
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
Zsombor Egri Approve
Review via email: mp+302363@code.launchpad.net

Commit message

Added LTTng support to UbuntuMetrics.

Description of the change

Added LTTng support to UbuntuMetrics.

To post a comment you must log in.
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) wrote :

No complains :)

review: Approve
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2016-08-09 03:19:08 +0000
3+++ debian/control 2016-08-09 03:19:09 +0000
4@@ -226,6 +226,7 @@
5 Architecture: any
6 Multi-Arch: same
7 Pre-Depends: dpkg (>= 1.15.6~),
8+ liblttng-ust0,
9 ${misc:Pre-Depends},
10 Depends: ${misc:Depends},
11 ${shlibs:Depends},
12
13=== modified file 'debian/libubuntumetrics5.install'
14--- debian/libubuntumetrics5.install 2016-08-09 03:19:08 +0000
15+++ debian/libubuntumetrics5.install 2016-08-09 03:19:09 +0000
16@@ -1,1 +1,2 @@
17 usr/lib/*/libUbuntuMetrics.so.*
18+usr/lib/*/qt5/plugins/ubuntu/metrics/libumlttng.so
19
20=== modified file 'src/Ubuntu/UbuntuMetrics/UbuntuMetrics.pro'
21--- src/Ubuntu/UbuntuMetrics/UbuntuMetrics.pro 2016-08-09 03:19:08 +0000
22+++ src/Ubuntu/UbuntuMetrics/UbuntuMetrics.pro 2016-08-09 03:19:09 +0000
23@@ -2,12 +2,16 @@
24 TARGET=UbuntuMetrics
25 QT += core-private gui-private quick-private
26 CONFIG += dll no_keywords c++11
27+LIBS += -ldl
28
29 contains(QT_CONFIG, opengles2) {
30 CONFIG += egl
31 DEFINES += MESA_EGL_NO_X11_HEADERS
32 }
33
34+DEFINES += LTTNG_PLUGIN_INSTALL_PATH=\\\"$$[QT_INSTALL_PLUGINS]/ubuntu/metrics/libumlttng.so\\\"
35+DEFINES += LTTNG_PLUGIN_BUILD_PATH=\\\"$$OUT_PWD/lttng/libumlttng.so\\\"
36+
37 load(qt_build_config)
38 load(ubuntu_qt_module)
39
40
41=== modified file 'src/Ubuntu/UbuntuMetrics/logger.cpp'
42--- src/Ubuntu/UbuntuMetrics/logger.cpp 2016-08-09 03:19:08 +0000
43+++ src/Ubuntu/UbuntuMetrics/logger.cpp 2016-08-09 03:19:09 +0000
44@@ -21,6 +21,12 @@
45 #include <QtCore/QDir>
46 #include <QtCore/QTime>
47
48+// LTTng shared object runtime loading.
49+#include <dlfcn.h>
50+#define TRACEPOINT_DEFINE
51+#define TRACEPOINT_PROBE_DYNAMIC_LINKAGE
52+#include "lttng/lttng_p.h"
53+
54 UMFileLogger::UMFileLogger(const QString& fileName, bool parsable)
55 : d_ptr(new UMFileLoggerPrivate(fileName, parsable))
56 {
57@@ -203,3 +209,84 @@
58 {
59 return !!(d_func()->m_flags & UMFileLoggerPrivate::Parsable);
60 }
61+
62+UMLTTNGPlugin* UMLTTNGLogger::m_plugin = nullptr;
63+bool UMLTTNGLogger::m_error = false;
64+
65+UMLTTNGLogger::UMLTTNGLogger()
66+{
67+ // The LTTng tracepoints are dlopen'd so that we don't directly link to
68+ // liblttng-ust which spawns two threads when the lib is loaded. That allows
69+ // to avoid the cost of it at startup when the user doesn't use LTTng (as
70+ // well as not showing them in the metrics).
71+
72+ if (!m_error && !m_plugin) {
73+ // Ensure the plugin is first loaded from the build path to ease
74+ // development on the toolkit from uninstalled sources.
75+ // FIXME(loicm) Security concerns?
76+ void* handle = dlopen(LTTNG_PLUGIN_BUILD_PATH, RTLD_LAZY);
77+ if (!handle) {
78+ handle = dlopen(LTTNG_PLUGIN_INSTALL_PATH, RTLD_LAZY);
79+ if (!handle) {
80+ WARN("ApplicationMonitor: %s", dlerror());
81+ m_error = true;
82+ return;
83+ }
84+ }
85+ m_plugin = static_cast<UMLTTNGPlugin*>(dlsym(handle, "umLttngPlugin"));
86+ if (!m_plugin) {
87+ WARN("ApplicationMonitor: %s", dlerror());
88+ m_error = true;
89+ }
90+ }
91+}
92+
93+void UMLTTNGLogger::log(const UMEvent& event)
94+{
95+ if (Q_LIKELY(m_plugin)) {
96+ switch (event.type) {
97+
98+ case UMEvent::Process: {
99+ UMLTTNGProcessEvent processEvent = {
100+ .vszMemory = event.process.vszMemory,
101+ .rssMemory = event.process.rssMemory,
102+ .cpuUsage = event.process.cpuUsage,
103+ .threadCount = event.process.threadCount
104+ };
105+ m_plugin->logProcessEvent(&processEvent);
106+ break;
107+ }
108+
109+ case UMEvent::Frame: {
110+ UMLTTNGFrameEvent frameEvent = {
111+ .window = event.frame.window,
112+ .number = event.frame.number,
113+ .deltaTime = event.frame.deltaTime * 0.000001f,
114+ .syncTime = event.frame.syncTime * 0.000001f,
115+ .renderTime = event.frame.renderTime * 0.000001f,
116+ .gpuTime = event.frame.gpuTime * 0.000001f,
117+ .swapTime = event.frame.swapTime * 0.000001f
118+ };
119+ m_plugin->logFrameEvent(&frameEvent);
120+ break;
121+ }
122+
123+ case UMEvent::Window: {
124+ const char* stateString[] = { "Hidden", "Shown", "Resized" };
125+ Q_STATIC_ASSERT(ARRAY_SIZE(stateString) == UMWindowEvent::StateCount);
126+ UMLTTNGWindowEvent windowEvent = {
127+ .state = stateString[event.window.state],
128+ .id = event.window.id,
129+ .width = event.window.width,
130+ .height = event.window.height
131+ };
132+ m_plugin->logWindowEvent(&windowEvent);
133+ break;
134+ }
135+
136+ default:
137+ DNOT_REACHED();
138+ break;
139+ }
140+ }
141+}
142
143=== modified file 'src/Ubuntu/UbuntuMetrics/logger.h'
144--- src/Ubuntu/UbuntuMetrics/logger.h 2016-08-09 03:19:08 +0000
145+++ src/Ubuntu/UbuntuMetrics/logger.h 2016-08-09 03:19:09 +0000
146@@ -23,6 +23,7 @@
147
148 class UMEvent;
149 class UMFileLoggerPrivate;
150+struct UMLTTNGPlugin;
151
152 // Log events to a specific device.
153 class UBUNTU_METRICS_EXPORT UMLogger
154@@ -56,4 +57,19 @@
155 Q_DECLARE_PRIVATE(UMFileLogger);
156 };
157
158+// Log events to LTTng.
159+class UBUNTU_METRICS_EXPORT UMLTTNGLogger : public UMLogger
160+{
161+public:
162+ UMLTTNGLogger();
163+ void log(const UMEvent& event) Q_DECL_OVERRIDE;
164+ bool isOpen() Q_DECL_OVERRIDE { return true; }
165+
166+private:
167+ static UMLTTNGPlugin* m_plugin;
168+ static bool m_error;
169+
170+ void* __reserved;
171+};
172+
173 #endif // LOGGER_H
174
175=== added directory 'src/Ubuntu/UbuntuMetrics/lttng'
176=== added file 'src/Ubuntu/UbuntuMetrics/lttng/lttng.c'
177--- src/Ubuntu/UbuntuMetrics/lttng/lttng.c 1970-01-01 00:00:00 +0000
178+++ src/Ubuntu/UbuntuMetrics/lttng/lttng.c 2016-08-09 03:19:09 +0000
179@@ -0,0 +1,40 @@
180+// Copyright © 2016 Canonical Ltd.
181+// Authors: Loïc Molinari <loic.molinari@canonical.com>
182+// Albert Astals Cid <albert.astals@canonical.com>
183+//
184+// This file is part of Ubuntu UI Toolkit.
185+//
186+// Ubuntu UI Toolkit is free software: you can redistribute it and/or modify it
187+// under the terms of the GNU Lesser General Public License as published by the
188+// Free Software Foundation; version 3.
189+//
190+// Ubuntu UI Toolkit is distributed in the hope that it will be useful, but
191+// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
192+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
193+// for more details.
194+//
195+// You should have received a copy of the GNU Lesser General Public License
196+// along with Ubuntu UI Toolkit. If not, see <http://www.gnu.org/licenses/>.
197+
198+#include "tracepoints_p.h"
199+
200+static void logProcessEvent(UMLTTNGProcessEvent* event)
201+{
202+ tracepoint(UbuntuMetrics, process, event);
203+}
204+
205+static void logFrameEvent(UMLTTNGFrameEvent* event)
206+{
207+ tracepoint(UbuntuMetrics, frame, event);
208+}
209+
210+static void logWindowEvent(UMLTTNGWindowEvent* event)
211+{
212+ tracepoint(UbuntuMetrics, window, event);
213+}
214+
215+const struct UMLTTNGPlugin umLttngPlugin = {
216+ &logProcessEvent,
217+ &logFrameEvent,
218+ &logWindowEvent
219+};
220
221=== added file 'src/Ubuntu/UbuntuMetrics/lttng/lttng.pro'
222--- src/Ubuntu/UbuntuMetrics/lttng/lttng.pro 1970-01-01 00:00:00 +0000
223+++ src/Ubuntu/UbuntuMetrics/lttng/lttng.pro 2016-08-09 03:19:09 +0000
224@@ -0,0 +1,8 @@
225+QT -= core gui
226+TEMPLATE = lib
227+TARGET = umlttng
228+CONFIG += plugin
229+LIBS += -llttng-ust
230+SOURCES = tracepoints.c lttng.c
231+target.path = $$[QT_INSTALL_PLUGINS]/ubuntu/metrics
232+INSTALLS += target
233
234=== added file 'src/Ubuntu/UbuntuMetrics/lttng/lttng_p.h'
235--- src/Ubuntu/UbuntuMetrics/lttng/lttng_p.h 1970-01-01 00:00:00 +0000
236+++ src/Ubuntu/UbuntuMetrics/lttng/lttng_p.h 2016-08-09 03:19:09 +0000
237@@ -0,0 +1,58 @@
238+// Copyright © 2016 Canonical Ltd.
239+// Authors: Loïc Molinari <loic.molinari@canonical.com>
240+// Albert Astals Cid <albert.astals@canonical.com>
241+//
242+// This file is part of Ubuntu UI Toolkit.
243+//
244+// Ubuntu UI Toolkit is free software: you can redistribute it and/or modify it
245+// under the terms of the GNU Lesser General Public License as published by the
246+// Free Software Foundation; version 3.
247+//
248+// Ubuntu UI Toolkit is distributed in the hope that it will be useful, but
249+// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
250+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
251+// for more details.
252+//
253+// You should have received a copy of the GNU Lesser General Public License
254+// along with Ubuntu UI Toolkit. If not, see <http://www.gnu.org/licenses/>.
255+
256+#ifndef LTTNG_P_H
257+#define LTTNG_P_H
258+
259+#include <stdint.h>
260+
261+typedef struct _UMLTTNGProcessEvent UMLTTNGProcessEvent;
262+typedef struct _UMLTTNGFrameEvent UMLTTNGFrameEvent;
263+typedef struct _UMLTTNGWindowEvent UMLTTNGWindowEvent;
264+
265+struct UMLTTNGPlugin {
266+ void (*logProcessEvent)(UMLTTNGProcessEvent*);
267+ void (*logFrameEvent)(UMLTTNGFrameEvent*);
268+ void (*logWindowEvent)(UMLTTNGWindowEvent*);
269+};
270+
271+struct _UMLTTNGProcessEvent {
272+ uint32_t vszMemory;
273+ uint32_t rssMemory;
274+ uint16_t cpuUsage;
275+ uint16_t threadCount;
276+};
277+
278+struct _UMLTTNGFrameEvent {
279+ uint32_t window;
280+ uint32_t number;
281+ float deltaTime;
282+ float syncTime;
283+ float renderTime;
284+ float gpuTime;
285+ float swapTime;
286+};
287+
288+struct _UMLTTNGWindowEvent {
289+ const char* state;
290+ uint32_t id;
291+ uint16_t width;
292+ uint16_t height;
293+};
294+
295+#endif // LTTNG_P_H
296
297=== added file 'src/Ubuntu/UbuntuMetrics/lttng/tracepoints.c'
298--- src/Ubuntu/UbuntuMetrics/lttng/tracepoints.c 1970-01-01 00:00:00 +0000
299+++ src/Ubuntu/UbuntuMetrics/lttng/tracepoints.c 2016-08-09 03:19:09 +0000
300@@ -0,0 +1,21 @@
301+// Copyright © 2016 Canonical Ltd.
302+// Authors: Loïc Molinari <loic.molinari@canonical.com>
303+// Albert Astals Cid <albert.astals@canonical.com>
304+//
305+// This file is part of Ubuntu UI Toolkit.
306+//
307+// Ubuntu UI Toolkit is free software: you can redistribute it and/or modify it
308+// under the terms of the GNU Lesser General Public License as published by the
309+// Free Software Foundation; version 3.
310+//
311+// Ubuntu UI Toolkit is distributed in the hope that it will be useful, but
312+// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
313+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
314+// for more details.
315+//
316+// You should have received a copy of the GNU Lesser General Public License
317+// along with Ubuntu UI Toolkit. If not, see <http://www.gnu.org/licenses/>.
318+
319+#define TRACEPOINT_CREATE_PROBES
320+#define TRACEPOINT_DEFINE
321+#include "tracepoints_p.h"
322
323=== added file 'src/Ubuntu/UbuntuMetrics/lttng/tracepoints_p.h'
324--- src/Ubuntu/UbuntuMetrics/lttng/tracepoints_p.h 1970-01-01 00:00:00 +0000
325+++ src/Ubuntu/UbuntuMetrics/lttng/tracepoints_p.h 2016-08-09 03:19:09 +0000
326@@ -0,0 +1,72 @@
327+// Copyright © 2016 Canonical Ltd.
328+// Authors: Loïc Molinari <loic.molinari@canonical.com>
329+// Albert Astals Cid <albert.astals@canonical.com>
330+//
331+// This file is part of Ubuntu UI Toolkit.
332+//
333+// Ubuntu UI Toolkit is free software: you can redistribute it and/or modify it
334+// under the terms of the GNU Lesser General Public License as published by the
335+// Free Software Foundation; version 3.
336+//
337+// Ubuntu UI Toolkit is distributed in the hope that it will be useful, but
338+// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
339+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
340+// for more details.
341+//
342+// You should have received a copy of the GNU Lesser General Public License
343+// along with Ubuntu UI Toolkit. If not, see <http://www.gnu.org/licenses/>.
344+
345+#include "lttng_p.h"
346+
347+#undef TRACEPOINT_PROVIDER
348+#define TRACEPOINT_PROVIDER UbuntuMetrics
349+#undef TRACEPOINT_INCLUDE
350+#define TRACEPOINT_INCLUDE "./tracepoints_p.h"
351+#if !defined(TRACEPOINTS_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
352+#define TRACEPOINTS_P_H
353+#include <lttng/tracepoint.h>
354+
355+TRACEPOINT_EVENT(
356+ UbuntuMetrics, process,
357+ TP_ARGS(
358+ UMLTTNGProcessEvent*, processEvent
359+ ),
360+ TP_FIELDS(
361+ ctf_integer(uint16_t, cpu_usage, processEvent->cpuUsage)
362+ ctf_integer(uint32_t, vsz_memory, processEvent->vszMemory)
363+ ctf_integer(uint32_t, rss_memory, processEvent->rssMemory)
364+ ctf_integer(uint16_t, thread_count, processEvent->threadCount)
365+ )
366+)
367+
368+TRACEPOINT_EVENT(
369+ UbuntuMetrics, frame,
370+ TP_ARGS(
371+ UMLTTNGFrameEvent*, frameEvent
372+ ),
373+ TP_FIELDS(
374+ ctf_integer(uint32_t, window, frameEvent->window)
375+ ctf_integer(uint32_t, number, frameEvent->number)
376+ ctf_float(float, delta_time, frameEvent->deltaTime)
377+ ctf_float(float, sync_time, frameEvent->syncTime)
378+ ctf_float(float, render_time, frameEvent->renderTime)
379+ ctf_float(float, gpu_time, frameEvent->gpuTime)
380+ ctf_float(float, swap_time, frameEvent->swapTime)
381+ )
382+)
383+
384+TRACEPOINT_EVENT(
385+ UbuntuMetrics, window,
386+ TP_ARGS(
387+ UMLTTNGWindowEvent*, windowEvent
388+ ),
389+ TP_FIELDS(
390+ ctf_integer(uint32_t, id, windowEvent->id)
391+ ctf_string(state, windowEvent->state)
392+ ctf_integer(uint16_t, width, windowEvent->width)
393+ ctf_integer(uint16_t, height, windowEvent->height)
394+ )
395+)
396+
397+#endif // TRACEPOINTS_P_H
398+#include <lttng/tracepoint-event.h>
399
400=== modified file 'src/Ubuntu/UbuntuToolkit/ubuntutoolkitmodule.cpp'
401--- src/Ubuntu/UbuntuToolkit/ubuntutoolkitmodule.cpp 2016-08-09 03:19:08 +0000
402+++ src/Ubuntu/UbuntuToolkit/ubuntutoolkitmodule.cpp 2016-08-09 03:19:09 +0000
403@@ -294,8 +294,14 @@
404 }
405 const QByteArray metricsLogging = qgetenv("UC_METRICS_LOGGING");
406 if (!metricsLogging.isNull()) {
407- UMLogger* logger = (metricsLogging.isEmpty() || metricsLogging == "stdout")
408- ? new UMFileLogger(stdout) : new UMFileLogger(metricsLogging);
409+ UMLogger* logger;
410+ if (metricsLogging.isEmpty() || metricsLogging == "stdout") {
411+ logger = new UMFileLogger(stdout);
412+ } else if (metricsLogging == "lttng") {
413+ logger = new UMLTTNGLogger();
414+ } else {
415+ logger = new UMFileLogger(metricsLogging);
416+ }
417 if (logger->isOpen()) {
418 applicationMonitor->installLogger(logger);
419 applicationMonitor->setLogging(true);
420
421=== modified file 'src/src.pro'
422--- src/src.pro 2016-08-09 03:19:08 +0000
423+++ src/src.pro 2016-08-09 03:19:09 +0000
424@@ -6,6 +6,9 @@
425 src_metrics.subdir = Ubuntu/UbuntuMetrics
426 src_metrics.target = sub-metrics
427
428+src_metrics_lttng.subdir = Ubuntu/UbuntuMetrics/lttng
429+src_metrics_lttng.target = sub-metrics-lttng
430+
431 src_toolkitlib.subdir = Ubuntu/UbuntuToolkit
432 src_toolkitlib.target = sub-libtoolkit
433 src_toolkitlib.depends = sub-gestures sub-metrics
434@@ -27,6 +30,7 @@
435 SUBDIRS += \
436 src_gestures \
437 src_metrics \
438+ src_metrics_lttng \
439 src_toolkitlib \
440 src_components \
441 src_layouts \
442
443=== modified file 'ubuntu-ui-toolkit-launcher/launcher.cpp'
444--- ubuntu-ui-toolkit-launcher/launcher.cpp 2016-08-09 03:19:08 +0000
445+++ ubuntu-ui-toolkit-launcher/launcher.cpp 2016-08-09 03:19:09 +0000
446@@ -76,7 +76,7 @@
447 QCommandLineOption _desktop_file_hint("desktop_file_hint", "Desktop file - ignored", "desktop_file");
448 QCommandLineOption _metricsOverlay("metrics-overlay", "Enable the metrics overlay");
449 QCommandLineOption _metricsLogging(
450- "metrics-logging", "Enable metrics logging, <device> can be 'stdout' or a local or "
451+ "metrics-logging", "Enable metrics logging, <device> can be 'stdout', 'lttng', a local or "
452 "absolute filename", "device");
453 QCommandLineOption _metricsLoggingFilter(
454 "metrics-logging-filter", "Filter metrics logging, <filter> is a list of events separated "
455@@ -233,9 +233,15 @@
456 applicationMonitor->setLoggingFilter(filter);
457 }
458 if (args.isSet(_metricsLogging)) {
459+ UMLogger* logger;
460 QString device = args.value(_metricsLogging);
461- UMLogger* logger = (device.isEmpty() || device == "stdout")
462- ? new UMFileLogger(stdout) : new UMFileLogger(device);
463+ if (device.isEmpty() || device == "stdout") {
464+ logger = new UMFileLogger(stdout);
465+ } else if (device == "lttng") {
466+ logger = new UMLTTNGLogger();
467+ } else {
468+ logger = new UMFileLogger(device);
469+ }
470 if (logger->isOpen()) {
471 applicationMonitor->installLogger(logger);
472 applicationMonitor->setLogging(true);

Subscribers

People subscribed via source and target branches