Mir

Merge lp:~andreas-pokorny/mir/move-input-report into lp:mir

Proposed by Andreas Pokorny
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 2440
Proposed branch: lp:~andreas-pokorny/mir/move-input-report
Merge into: lp:mir
Prerequisite: lp:~andreas-pokorny/mir/stub-input-platform
Diff against target: 194 lines (+85/-17)
8 files modified
include/platform/mir/input/input_report.h (+7/-4)
src/server/report/logging/input_report.cpp (+22/-0)
src/server/report/logging/input_report.h (+9/-7)
src/server/report/lttng/input_report.cpp (+10/-0)
src/server/report/lttng/input_report.h (+2/-0)
src/server/report/lttng/input_report_tp.h (+20/-0)
src/server/report/null/input_report.cpp (+6/-0)
src/server/report/null/input_report.h (+9/-6)
To merge this branch: bzr merge lp:~andreas-pokorny/mir/move-input-report
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Alan Griffiths Approve
Alexandros Frantzis (community) Approve
Kevin DuBois (community) Approve
Review via email: mp+253207@code.launchpad.net

Commit message

Move InputReport interface from server to mir platform and LGPL

Description of the change

Moves Input Report to a location accessible by platforms, and changes licensing to LGPL

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

lgtm,
nit:
79 + void open_input_device(char const* device_name, char const* input_platform) override;
80 + void failure_opening_input_device(char const* device_name, char const* input_platform) override;

opened_input_device(...), failed_to_open_input_device(...)
make it clearer that we are reporting something that happened in the past, as opposed to trying to open an input device from the function.

review: Approve
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Looks good.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

OK

review: Approve
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

waits for the prereq to be merged...

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Un-TA'd as prerequisite is still in review

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== renamed file 'src/include/server/mir/input/input_report.h' => 'include/platform/mir/input/input_report.h'
2--- src/include/server/mir/input/input_report.h 2015-01-21 07:34:50 +0000
3+++ include/platform/mir/input/input_report.h 2015-03-26 11:59:41 +0000
4@@ -1,16 +1,16 @@
5 /*
6- * Copyright © 2013 Canonical Ltd.
7+ * Copyright © 2013-2015 Canonical Ltd.
8 *
9 * This program is free software: you can redistribute it and/or modify it
10- * under the terms of the GNU General Public License version 3,
11+ * under the terms of the GNU Lesser General Public License version 3,
12 * as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17- * GNU General Public License for more details.
18+ * GNU Lesser General Public License for more details.
19 *
20- * You should have received a copy of the GNU General Public License
21+ * You should have received a copy of the GNU Lesser General Public License
22 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 *
24 * Authored by: Alan Griffiths <alan@octopull.co.uk>
25@@ -40,6 +40,9 @@
26
27 virtual void received_event_finished_signal(int src_fd, uint32_t seq_id) = 0;
28
29+ virtual void opened_input_device(char const* device_name, char const* input_platform) = 0;
30+ virtual void failed_to_open_input_device(char const* device_name, char const* input_platform) = 0;
31+
32 protected:
33 InputReport() = default;
34 InputReport(InputReport const&) = delete;
35
36=== modified file 'src/server/report/logging/input_report.cpp'
37--- src/server/report/logging/input_report.cpp 2015-03-24 16:02:48 +0000
38+++ src/server/report/logging/input_report.cpp 2015-03-26 11:59:41 +0000
39@@ -154,3 +154,25 @@
40
41 logger->log(ml::Severity::informational, ss.str(), component());
42 }
43+
44+void mrl::InputReport::opened_input_device(char const* device_name, char const* input_platform)
45+{
46+ std::stringstream ss;
47+
48+ ss << "Input device opened "
49+ << " name=" << device_name
50+ << " platform=" << input_platform;
51+
52+ logger->log(ml::Severity::informational, ss.str(), component());
53+}
54+
55+void mrl::InputReport::failed_to_open_input_device(char const* device_name, char const* input_platform)
56+{
57+ std::stringstream ss;
58+
59+ ss << "Failure opening input device "
60+ << " name=" << device_name
61+ << " platform=" << input_platform;
62+
63+ logger->log(ml::Severity::informational, ss.str(), component());
64+}
65
66=== modified file 'src/server/report/logging/input_report.h'
67--- src/server/report/logging/input_report.h 2014-03-06 06:05:17 +0000
68+++ src/server/report/logging/input_report.h 2015-03-26 11:59:41 +0000
69@@ -40,13 +40,15 @@
70 InputReport(std::shared_ptr<mir::logging::Logger> const& logger);
71 virtual ~InputReport() noexcept(true) = default;
72
73- void received_event_from_kernel(int64_t when, int type, int code, int value);
74-
75- void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time);
76- void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time);
77-
78- void received_event_finished_signal(int src_fd, uint32_t seq_id);
79-
80+ void received_event_from_kernel(int64_t when, int type, int code, int value) override;
81+
82+ void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time) override;
83+ void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time) override;
84+
85+ void received_event_finished_signal(int src_fd, uint32_t seq_id) override;
86+
87+ void opened_input_device(char const* device_name, char const* input_platform) override;
88+ void failed_to_open_input_device(char const* device_name, char const* input_platform) override;
89 private:
90 char const* component();
91 std::shared_ptr<mir::logging::Logger> const logger;
92
93=== modified file 'src/server/report/lttng/input_report.cpp'
94--- src/server/report/lttng/input_report.cpp 2014-03-06 06:05:17 +0000
95+++ src/server/report/lttng/input_report.cpp 2015-03-26 11:59:41 +0000
96@@ -43,3 +43,13 @@
97 {
98 mir_tracepoint(mir_server_input, received_event_finished_signal, src_fd, seq_id);
99 }
100+
101+void mir::report::lttng::InputReport::opened_input_device(char const* name, char const* platform)
102+{
103+ mir_tracepoint(mir_server_input, opened_input_device, name, platform);
104+}
105+
106+void mir::report::lttng::InputReport::failed_to_open_input_device(char const* name, char const* platform)
107+{
108+ mir_tracepoint(mir_server_input, failed_to_open_input_device, name, platform);
109+}
110
111=== modified file 'src/server/report/lttng/input_report.h'
112--- src/server/report/lttng/input_report.h 2014-03-06 06:05:17 +0000
113+++ src/server/report/lttng/input_report.h 2015-03-26 11:59:41 +0000
114@@ -43,6 +43,8 @@
115
116 void received_event_finished_signal(int src_fd, uint32_t seq_id) override;
117
118+ void opened_input_device(char const* device_name, char const* input_platform) override;
119+ void failed_to_open_input_device(char const* device_name, char const* input_platform) override;
120 private:
121 ServerTracepointProvider tp_provider;
122 };
123
124=== modified file 'src/server/report/lttng/input_report_tp.h'
125--- src/server/report/lttng/input_report_tp.h 2015-01-21 07:34:50 +0000
126+++ src/server/report/lttng/input_report_tp.h 2015-03-26 11:59:41 +0000
127@@ -71,6 +71,26 @@
128 )
129 )
130
131+TRACEPOINT_EVENT(
132+ mir_server_input,
133+ opened_input_device,
134+ TP_ARGS(const char*, device, const char*, platform),
135+ TP_FIELDS(
136+ ctf_string(device, device)
137+ ctf_string(platform, platform)
138+ )
139+)
140+
141+TRACEPOINT_EVENT(
142+ mir_server_input,
143+ failed_to_open_input_device,
144+ TP_ARGS(const char*, device, const char*, platform),
145+ TP_FIELDS(
146+ ctf_string(device, device)
147+ ctf_string(platform, platform)
148+ )
149+)
150+
151 #endif /* MIR_LTTNG_DISPLAY_REPORT_TP_H_ */
152
153 #include <lttng/tracepoint-event.h>
154
155=== modified file 'src/server/report/null/input_report.cpp'
156--- src/server/report/null/input_report.cpp 2014-03-06 06:05:17 +0000
157+++ src/server/report/null/input_report.cpp 2015-03-26 11:59:41 +0000
158@@ -36,4 +36,10 @@
159 {
160 }
161
162+void mrn::InputReport::opened_input_device(char const* /* name */, char const* /* platform */)
163+{
164+}
165
166+void mrn::InputReport::failed_to_open_input_device(char const* /* name */, char const* /* platform */)
167+{
168+}
169
170=== modified file 'src/server/report/null/input_report.h'
171--- src/server/report/null/input_report.h 2014-03-06 06:05:17 +0000
172+++ src/server/report/null/input_report.h 2015-03-26 11:59:41 +0000
173@@ -35,12 +35,15 @@
174 InputReport() = default;
175 virtual ~InputReport() noexcept(true) = default;
176
177- void received_event_from_kernel(int64_t when, int type, int code, int value);
178-
179- void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time);
180- void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time);
181-
182- void received_event_finished_signal(int src_fd, uint32_t seq_id);
183+ void received_event_from_kernel(int64_t when, int type, int code, int value) override;
184+
185+ void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time) override;
186+ void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time) override;
187+
188+ void received_event_finished_signal(int src_fd, uint32_t seq_id) override;
189+
190+ void opened_input_device(char const* device_name, char const* input_platform) override;
191+ void failed_to_open_input_device(char const* device_name, char const* input_platform) override;
192 };
193
194 }

Subscribers

People subscribed via source and target branches