Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log input devices #3417

Merged
merged 14 commits into from
Jun 20, 2024
Merged

Log input devices #3417

merged 14 commits into from
Jun 20, 2024

Conversation

AlanGriffiths
Copy link
Contributor

@AlanGriffiths AlanGriffiths commented Jun 6, 2024

Drops some unused code from the "Input Report", and replaces the optional logging with direct logging.

This now includes logging the actual configuration of the device

@AlanGriffiths AlanGriffiths changed the title log-input-devices Log input devices Jun 6, 2024
Copy link

codecov bot commented Jun 6, 2024

Codecov Report

Attention: Patch coverage is 50.70423% with 70 lines in your changes missing coverage. Please review.

Project coverage is 77.23%. Comparing base (1398638) to head (7966439).
Report is 15 commits behind head on main.

Current head 7966439 differs from pull request most recent head a65965e

Please upload reports for the commit a65965e to get more accurate results.

Files Patch % Lines
src/server/input/default_input_device_hub.cpp 48.85% 67 Missing ⚠️
src/platforms/evdev/platform.cpp 60.00% 2 Missing ⚠️
src/miral/input_device_config.cpp 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3417      +/-   ##
==========================================
- Coverage   77.31%   77.23%   -0.09%     
==========================================
  Files        1068     1071       +3     
  Lines       68284    68460     +176     
==========================================
+ Hits        52797    52878      +81     
- Misses      15487    15582      +95     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AlanGriffiths AlanGriffiths marked this pull request as ready for review June 14, 2024 15:14
@AlanGriffiths AlanGriffiths requested a review from a team as a code owner June 14, 2024 15:14
Copy link
Collaborator

@Saviq Saviq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of nits, but feel free to merge if you don't think worth it.


While here, should we unify the logging categories?

#define MIR_LOG_COMPONENT "Input"

Could be input-hub instead?

 <information> evdev-input: Opened device: /dev/input/event9 [0000:0006] Video Bus
 <information> Input: Device configuration: Lid Switch, capabilities={}
 <information> evdev-input: Opened device: /dev/input/event0 [0000:0005] Lid Switch
 <information> Input: Device configuration: Power Button, capabilities={keyboard}
 <information> evdev-input: Opened device: /dev/input/event1 [0000:0001] Power Button
#  …

vs.

 <information> evdev-input: Opened device: /dev/input/event9 [0000:0006] Video Bus
 <information> input-hub: Device configuration: Lid Switch, capabilities={}
 <information> evdev-input: Opened device: /dev/input/event0 [0000:0005] Lid Switch
 <information> input-hub: Device configuration: Power Button, capabilities={keyboard}
 <information> evdev-input: Opened device: /dev/input/event1 [0000:0001] Power Button
#  …

Looks like an opportunity to introduce std::formatter<>s for the different types?

@AlanGriffiths
Copy link
Contributor Author

Looks like an opportunity to introduce std::formatter<>s for the different types?

Oh! Yeah, I still have to get used to having this stuff available.

@AlanGriffiths AlanGriffiths marked this pull request as draft June 17, 2024 15:29
@AlanGriffiths AlanGriffiths marked this pull request as ready for review June 17, 2024 22:09
Copy link
Collaborator

@Saviq Saviq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we align the command line options with what's logged?

--mouse-acceleration vs. capabilities={pointer}…, pointer_config={acceleration=…}

Underscores vs. hyphens, too?

AlanGriffiths and others added 2 commits June 18, 2024 12:39
Co-authored-by: Michał Sawicz <michal.sawicz@canonical.com>
Copy link
Collaborator

@Saviq Saviq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still no…

$ ubuntu-frame --mouse-acceleration=none --mouse-cursor-acceleration-bias=1.00 2>&1 | grep -e input-hub -e evdev-input
[2024-06-19 08:09:21.795207] <information> mirserver: Selected input driver: mir:evdev-input (version: 2.18.0)
[2024-06-19 08:09:25.329572] <information> evdev-input: Opened device: /dev/input/event3 [0000:0001] Power Button
[2024-06-19 08:09:25.351274] <information> evdev-input: Opened device: /dev/input/event7 [0000:0006] Video Bus
[2024-06-19 08:09:25.373068] <information> evdev-input: Opened device: /dev/input/event1 [0000:0001] Power Button
[2024-06-19 08:09:25.373404] <information> evdev-input: Opened device: /dev/input/event0 [0000:0005] Lid Switch
[2024-06-19 08:09:25.395651] <information> evdev-input: Opened device: /dev/input/event2 [0000:0003] Sleep Button
[2024-06-19 08:09:25.417728] <information> evdev-input: Opened device: /dev/input/event5 [05ac:024a] Apple Inc. Apple Internal Keyboard / Trackpad
[2024-06-19 08:09:25.419174] <information> evdev-input: Opened device: /dev/input/event8 [05ac:024a] bcm5974
[2024-06-19 08:09:25.419356] <information> input-hub: Device configuration: Power Button, capabilities={keyboard}
[2024-06-19 08:09:25.419481] <information> input-hub: Device configuration: Video Bus, capabilities={keyboard}
[2024-06-19 08:09:25.419586] <information> input-hub: Device configuration: Power Button, capabilities={keyboard}
[2024-06-19 08:09:25.419687] <information> input-hub: Device configuration: Lid Switch, capabilities={}
[2024-06-19 08:09:25.419787] <information> input-hub: Device configuration: Sleep Button, capabilities={keyboard}
[2024-06-19 08:09:25.432277] <information> input-hub: Device configuration: Apple Inc. Apple Internal Keyboard / Trackpad, capabilities={keyboard|alpha_numeric}
[2024-06-19 08:09:25.432513] <information> input-hub: Device configuration: bcm5974, capabilities={pointer|touchpad}, pointer_config={handedness=right,acceleration=adaptive,acceleration_bias=0.00,hscale=1.00,vscale=1.00}, touchpad_config={click_mode=finger_count|scroll_mode=two_finger|disable_while_typing}

Copy link
Collaborator

@Saviq Saviq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still no…

Gah!

It's good, only now I realized pointer != mouse…

$ ubuntu-frame --mouse-acceleration=none --mouse-cursor-acceleration-bias=1.00 2>&1 | grep -e input-hub -e evdev-input      
[2024-06-19 14:52:17.962644] <information> mirserver: Selected input driver: mir:evdev-input (version: 2.18.0)
[2024-06-19 14:52:23.735914] <information> evdev-input: Opened device: /dev/input/event3 [0000:0001] Power Button
[2024-06-19 14:52:23.758030] <information> evdev-input: Opened device: /dev/input/event7 [0000:0006] Video Bus
[2024-06-19 14:52:23.780154] <information> evdev-input: Opened device: /dev/input/event1 [0000:0001] Power Button
[2024-06-19 14:52:23.780434] <information> evdev-input: Opened device: /dev/input/event0 [0000:0005] Lid Switch
[2024-06-19 14:52:23.802997] <information> evdev-input: Opened device: /dev/input/event2 [0000:0003] Sleep Button
[2024-06-19 14:52:23.825003] <information> evdev-input: Opened device: /dev/input/event5 [05ac:024a] Apple Inc. Apple Internal Keyboard / Trackpad
[2024-06-19 14:52:23.826464] <information> evdev-input: Opened device: /dev/input/event8 [05ac:024a] bcm5974
[2024-06-19 14:52:23.826630] <information> input-hub: Device configuration: Power Button, capabilities={keyboard}
[2024-06-19 14:52:23.826732] <information> input-hub: Device configuration: Video Bus, capabilities={keyboard}
[2024-06-19 14:52:23.826843] <information> input-hub: Device configuration: Power Button, capabilities={keyboard}
[2024-06-19 14:52:23.826942] <information> input-hub: Device configuration: Lid Switch, capabilities={}
[2024-06-19 14:52:23.827042] <information> input-hub: Device configuration: Sleep Button, capabilities={keyboard}
[2024-06-19 14:52:23.839656] <information> input-hub: Device configuration: Apple Inc. Apple Internal Keyboard / Trackpad, capabilities={keyboard|alpha_numeric}
[2024-06-19 14:52:23.840048] <information> input-hub: Device configuration: bcm5974, capabilities={pointer|touchpad}, pointer_config={handedness=right,acceleration=adaptive,acceleration_bias=0.00,hscale=1.00,vscale=1.00}, touchpad_config={click_mode=finger_count|scroll_mode=two_finger|disable_while_typing}
[2024-06-19 14:52:32.119525] <information> evdev-input: Opened device: /dev/input/event6 [046d:4023] Logitech Wireless Keyboard PID:4023
[2024-06-19 14:52:32.119778] <information> evdev-input: Opened device: /dev/input/event12 [046d:4091] Logitech Wireless Mouse
[2024-06-19 14:52:32.126371] <information> input-hub: Device configuration: Logitech Wireless Keyboard PID:4023, capabilities={keyboard|alpha_numeric}
[2024-06-19 14:52:32.126465] <information> input-hub: Device configuration: Logitech Wireless Mouse, capabilities={pointer}, pointer_config={handedness=right,acceleration=none,acceleration_bias=1.00,hscale=1.00,vscale=1.00}
[2024-06-19 14:52:36.732264] <information> evdev-input: Removed device: /dev/input/event6 [046d:4023] Logitech Wireless Keyboard PID:4023
[2024-06-19 14:52:36.944260] <information> evdev-input: Removed device: /dev/input/event12 [046d:4091] Logitech Wireless Mouse

@Saviq Saviq enabled auto-merge June 19, 2024 12:53
@Saviq
Copy link
Collaborator

Saviq commented Jun 19, 2024

(but you will need to fix the tests…)

@Saviq Saviq force-pushed the log-input-devices branch 2 times, most recently from 7966439 to a65965e Compare June 20, 2024 11:09
Copy link
Collaborator

@Saviq Saviq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh well, sid's got a short run…

@Saviq Saviq added this pull request to the merge queue Jun 20, 2024
Merged via the queue into main with commit 720b13c Jun 20, 2024
67 of 72 checks passed
@Saviq Saviq deleted the log-input-devices branch June 20, 2024 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants