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
=== renamed file 'src/include/server/mir/input/input_report.h' => 'include/platform/mir/input/input_report.h'
--- src/include/server/mir/input/input_report.h 2015-01-21 07:34:50 +0000
+++ include/platform/mir/input/input_report.h 2015-03-26 11:59:41 +0000
@@ -1,16 +1,16 @@
1/*1/*
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013-2015 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Alan Griffiths <alan@octopull.co.uk>16 * Authored by: Alan Griffiths <alan@octopull.co.uk>
@@ -40,6 +40,9 @@
4040
41 virtual void received_event_finished_signal(int src_fd, uint32_t seq_id) = 0;41 virtual void received_event_finished_signal(int src_fd, uint32_t seq_id) = 0;
4242
43 virtual void opened_input_device(char const* device_name, char const* input_platform) = 0;
44 virtual void failed_to_open_input_device(char const* device_name, char const* input_platform) = 0;
45
43protected:46protected:
44 InputReport() = default;47 InputReport() = default;
45 InputReport(InputReport const&) = delete;48 InputReport(InputReport const&) = delete;
4649
=== modified file 'src/server/report/logging/input_report.cpp'
--- src/server/report/logging/input_report.cpp 2015-03-24 16:02:48 +0000
+++ src/server/report/logging/input_report.cpp 2015-03-26 11:59:41 +0000
@@ -154,3 +154,25 @@
154154
155 logger->log(ml::Severity::informational, ss.str(), component());155 logger->log(ml::Severity::informational, ss.str(), component());
156}156}
157
158void mrl::InputReport::opened_input_device(char const* device_name, char const* input_platform)
159{
160 std::stringstream ss;
161
162 ss << "Input device opened "
163 << " name=" << device_name
164 << " platform=" << input_platform;
165
166 logger->log(ml::Severity::informational, ss.str(), component());
167}
168
169void mrl::InputReport::failed_to_open_input_device(char const* device_name, char const* input_platform)
170{
171 std::stringstream ss;
172
173 ss << "Failure opening input device "
174 << " name=" << device_name
175 << " platform=" << input_platform;
176
177 logger->log(ml::Severity::informational, ss.str(), component());
178}
157179
=== modified file 'src/server/report/logging/input_report.h'
--- src/server/report/logging/input_report.h 2014-03-06 06:05:17 +0000
+++ src/server/report/logging/input_report.h 2015-03-26 11:59:41 +0000
@@ -40,13 +40,15 @@
40 InputReport(std::shared_ptr<mir::logging::Logger> const& logger);40 InputReport(std::shared_ptr<mir::logging::Logger> const& logger);
41 virtual ~InputReport() noexcept(true) = default;41 virtual ~InputReport() noexcept(true) = default;
4242
43 void received_event_from_kernel(int64_t when, int type, int code, int value);43 void received_event_from_kernel(int64_t when, int type, int code, int value) override;
4444
45 void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time);45 void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time) override;
46 void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time);46 void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time) override;
4747
48 void received_event_finished_signal(int src_fd, uint32_t seq_id);48 void received_event_finished_signal(int src_fd, uint32_t seq_id) override;
4949
50 void opened_input_device(char const* device_name, char const* input_platform) override;
51 void failed_to_open_input_device(char const* device_name, char const* input_platform) override;
50private:52private:
51 char const* component();53 char const* component();
52 std::shared_ptr<mir::logging::Logger> const logger;54 std::shared_ptr<mir::logging::Logger> const logger;
5355
=== modified file 'src/server/report/lttng/input_report.cpp'
--- src/server/report/lttng/input_report.cpp 2014-03-06 06:05:17 +0000
+++ src/server/report/lttng/input_report.cpp 2015-03-26 11:59:41 +0000
@@ -43,3 +43,13 @@
43{43{
44 mir_tracepoint(mir_server_input, received_event_finished_signal, src_fd, seq_id);44 mir_tracepoint(mir_server_input, received_event_finished_signal, src_fd, seq_id);
45}45}
46
47void mir::report::lttng::InputReport::opened_input_device(char const* name, char const* platform)
48{
49 mir_tracepoint(mir_server_input, opened_input_device, name, platform);
50}
51
52void mir::report::lttng::InputReport::failed_to_open_input_device(char const* name, char const* platform)
53{
54 mir_tracepoint(mir_server_input, failed_to_open_input_device, name, platform);
55}
4656
=== modified file 'src/server/report/lttng/input_report.h'
--- src/server/report/lttng/input_report.h 2014-03-06 06:05:17 +0000
+++ src/server/report/lttng/input_report.h 2015-03-26 11:59:41 +0000
@@ -43,6 +43,8 @@
4343
44 void received_event_finished_signal(int src_fd, uint32_t seq_id) override;44 void received_event_finished_signal(int src_fd, uint32_t seq_id) override;
4545
46 void opened_input_device(char const* device_name, char const* input_platform) override;
47 void failed_to_open_input_device(char const* device_name, char const* input_platform) override;
46private:48private:
47 ServerTracepointProvider tp_provider;49 ServerTracepointProvider tp_provider;
48};50};
4951
=== modified file 'src/server/report/lttng/input_report_tp.h'
--- src/server/report/lttng/input_report_tp.h 2015-01-21 07:34:50 +0000
+++ src/server/report/lttng/input_report_tp.h 2015-03-26 11:59:41 +0000
@@ -71,6 +71,26 @@
71 )71 )
72)72)
7373
74TRACEPOINT_EVENT(
75 mir_server_input,
76 opened_input_device,
77 TP_ARGS(const char*, device, const char*, platform),
78 TP_FIELDS(
79 ctf_string(device, device)
80 ctf_string(platform, platform)
81 )
82)
83
84TRACEPOINT_EVENT(
85 mir_server_input,
86 failed_to_open_input_device,
87 TP_ARGS(const char*, device, const char*, platform),
88 TP_FIELDS(
89 ctf_string(device, device)
90 ctf_string(platform, platform)
91 )
92)
93
74#endif /* MIR_LTTNG_DISPLAY_REPORT_TP_H_ */94#endif /* MIR_LTTNG_DISPLAY_REPORT_TP_H_ */
7595
76#include <lttng/tracepoint-event.h>96#include <lttng/tracepoint-event.h>
7797
=== modified file 'src/server/report/null/input_report.cpp'
--- src/server/report/null/input_report.cpp 2014-03-06 06:05:17 +0000
+++ src/server/report/null/input_report.cpp 2015-03-26 11:59:41 +0000
@@ -36,4 +36,10 @@
36{36{
37}37}
3838
39void mrn::InputReport::opened_input_device(char const* /* name */, char const* /* platform */)
40{
41}
3942
43void mrn::InputReport::failed_to_open_input_device(char const* /* name */, char const* /* platform */)
44{
45}
4046
=== modified file 'src/server/report/null/input_report.h'
--- src/server/report/null/input_report.h 2014-03-06 06:05:17 +0000
+++ src/server/report/null/input_report.h 2015-03-26 11:59:41 +0000
@@ -35,12 +35,15 @@
35 InputReport() = default;35 InputReport() = default;
36 virtual ~InputReport() noexcept(true) = default;36 virtual ~InputReport() noexcept(true) = default;
3737
38 void received_event_from_kernel(int64_t when, int type, int code, int value);38 void received_event_from_kernel(int64_t when, int type, int code, int value) override;
3939
40 void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time);40 void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time) override;
41 void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time);41 void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time) override;
4242
43 void received_event_finished_signal(int src_fd, uint32_t seq_id);43 void received_event_finished_signal(int src_fd, uint32_t seq_id) override;
44
45 void opened_input_device(char const* device_name, char const* input_platform) override;
46 void failed_to_open_input_device(char const* device_name, char const* input_platform) override;
44};47};
4548
46}49}

Subscribers

People subscribed via source and target branches