InputSystem icon indicating copy to clipboard operation
InputSystem copied to clipboard

CHANGE: Improve error logging when event get discarded (ISXB-691)

Open jfreire-unity opened this issue 9 months ago • 4 comments

Description

Improves the error logging for the issue ISXB-691 with the amount of events processed by device.

Changes made

PR adds a way of accumulating the total amount of bytes processed during an update call, per device. Currently, this data will only be present when InputSettings.maxEventBytesPerUpdate is exceeded in an update call. But in the future, it could potentially be used as well to present the average of bytes processed per frame for a device in the Input Debugger Window

This logging of extra data will only affect development builds. It allows developers to identify the devices or other issues causing the error.

Notes

I did not see a performance impact when profiling this with the test CorePerformanceTest.Performance_Update10Gamepads.

To test this the error needs to be raised. Just decrease InputSystem.settings.maxEventBytesPerUpdate to something like 10 bytes. Try to see the difference between development builds and non-development builds.

Checklist

Before review:

  • [x] Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • FogBugz ticket attached, example ([case %number%](https://issuetracker.unity3d.com/issues/...)).
    • FogBugz is marked as "Resolved" with next release version correctly set.
  • [x] Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • [ ] Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • [x] Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

jfreire-unity avatar May 15 '24 14:05 jfreire-unity

Caught a crash when adding a gamepad in order to see what information the error will show. Adding the Editor.log and will try to repro it consistently

Editor.log

Pauliusd01 avatar May 16 '24 12:05 Pauliusd01

Caught a crash when adding a gamepad in order to see what information the error will show. Adding the Editor.log and will try to repro it consistently

Editor.log

Oh interesting. Which Gamepad by the way? Let me know once you manage to reproduce it

jfreire-unity avatar May 16 '24 12:05 jfreire-unity

Caught a crash when adding a gamepad in order to see what information the error will show. Adding the Editor.log and will try to repro it consistently Editor.log

Oh interesting. Which Gamepad by the way? Let me know once you manage to reproduce it

Xbox series x controller (I think that's the name for the latest one 😅)

Pauliusd01 avatar May 16 '24 12:05 Pauliusd01

@Pauliusd01 has detected some inconsistencies in logging with Xbox controllers on Windows, I'll investigate it once I get an Xbox controller

jfreire-unity avatar May 17 '24 08:05 jfreire-unity

@Pauliusd01 you can retest with Xbox controllers on Windows

jfreire-unity avatar May 23 '24 12:05 jfreire-unity

@jfreire-unity It would be great if you could post an example of what gets printed into t his PR, e.g. from your system when breaking the boundary (fine to set low)

ekcoh avatar May 29 '24 12:05 ekcoh

@jfreire-unity It would be great if you could post an example of what gets printed into t his PR, e.g. from your system when breaking the boundary (fine to set low)

Added

jfreire-unity avatar May 30 '24 09:05 jfreire-unity