|
| 1 | +# Rude Window Manager tracing |
| 2 | + |
| 3 | +Rude Window Manager issues can be extremely subtle and difficult to reproduce. |
| 4 | +To help investigate these issues, it is often useful to instrument the system |
| 5 | +and [record][] detailed [traces][]. |
| 6 | + |
| 7 | +The idea behind tracing is to record every event - including window management |
| 8 | +events - that is occurring on the machine in an extreme level of detail, and |
| 9 | +gather it all into a single trace file that can be [analysed][] later, not |
| 10 | +necessarily on the same machine, and not necessarily by the same person. |
| 11 | +The trace file will hopefully provide enough information to determine the root |
| 12 | +cause of the issue. |
| 13 | + |
| 14 | +## How to gather a trace |
| 15 | + |
| 16 | +1. Using the Task Manager or equivalent, terminate any running |
| 17 | + RudeWindowFixer process. |
| 18 | + |
| 19 | +2. Download the latest [release][WindowInvestigatorReleases] of |
| 20 | + [WindowInvestigator][]. Extract it and get ready to run |
| 21 | + `WindowInvestigator_WindowMonitor.exe`. Do not run it yet. |
| 22 | + |
| 23 | +3. Make sure you have the latest [release][RudeWindowFixerReleases] of |
| 24 | + RudeWindowFixer. Be prepared to start it, but do not do it yet. |
| 25 | + |
| 26 | +5. Open the [Windows Performance Recorder][record]: hit Win+R (Run) and enter |
| 27 | + `wprui`. |
| 28 | + |
| 29 | +6. If not done previously, add the following 3 profiles (use "Save As..." to |
| 30 | + download them): |
| 31 | + - [RudeWindowFixer profile][] |
| 32 | + - [WindowInvestigator profile][] |
| 33 | + - [WindowManagementLogging profile][] |
| 34 | + |
| 35 | +7. Make sure the only selected profiles are "First level triage" and the 3 |
| 36 | + aforementioned profiles. |
| 37 | + |
| 38 | +8. On the right hand side, make sure "Performance Scenario" is set to "General", |
| 39 | + "Detail Level" is set to "Verbose" and "Logging mode" is set to "Memory". |
| 40 | + |
| 41 | +9. At this point the WPR window should look like this: |
| 42 | + |
| 43 | +  |
| 44 | + |
| 45 | +10. Close as many windows as you can (aside from the windows used in this |
| 46 | + procedure of course) and in general try to make your system as "idle" as |
| 47 | + possible. |
| 48 | + |
| 49 | +11. Hit "Start" and wait for the "Time:" to start counting. |
| 50 | + |
| 51 | +12. Immediately start WindowMonitor (preferably as Administrator) and keep it |
| 52 | + running. |
| 53 | + |
| 54 | +13. Immediately after WindowMonitor has started, start RudeWindowFixer. |
| 55 | + |
| 56 | +14. Try to reproduce the problem as quickly as you can. |
| 57 | + - The reason why speed is important is because traces get *very* large, |
| 58 | + *very* quickly - they grow at a rate of about 10 MB/s, so you can easily |
| 59 | + end up with a multi-gigabyte trace after just a few minutes. This makes |
| 60 | + traces harder to share and analyse. |
| 61 | + - If you can't reproduce the problem on demand, then you'll have no choice |
| 62 | + but to keep tracing until it occurs. Thankfully, the trace will "wrap |
| 63 | + around" after it hits a certain size limit, at which point new events |
| 64 | + overwrite old ones. The trace size stays constant after that point. Your |
| 65 | + computer might run slightly slower while tracing is taking place. |
| 66 | + |
| 67 | +15. As soon as you notice the problem occurring, *immediately* hit |
| 68 | + Ctrl+Alt+Win+X, then immediately hit Enter - do not waste time entering a |
| 69 | + label. |
| 70 | + - This will add a marker event to help figure out when the issue occurred |
| 71 | + while analysing the trace. Investigation will be made easier if the marker |
| 72 | + is as close as possible to the time the problem occurs. |
| 73 | + |
| 74 | +16. In the Windows Performance Recorder, click "Save", then "Save" again. Wait |
| 75 | + for the save operation to complete. Meanwhile, you can close WindowMonitor. |
| 76 | + - Note that saving the trace can take some time and typically stays at 100% |
| 77 | + for a while. The save is only complete when you see the following screen: |
| 78 | + |
| 79 | +  |
| 80 | + |
| 81 | +17. Click "Open Folder". |
| 82 | + |
| 83 | +18. Using any compression tool (e.g. 7-Zip), compress the resulting `.etl` file |
| 84 | + and associated `.etl.NGENPDB` folder. |
| 85 | + - Trace files are very large, but thankfully they are extremely |
| 86 | + compressible; a ~20x compression ratio is typical. |
| 87 | + |
| 88 | +19. Send the resulting archive to the person in charge of analysis. You might |
| 89 | + want to use a file sharing service. |
| 90 | + - **Be aware that traces capture almost everything that's going on in your |
| 91 | + entire system, including potentially private information such as file |
| 92 | + paths and window titles. Do NOT share the trace publicly (e.g. do NOT |
| 93 | + attach it to a GitHub comment) - only share it with someone you trust.** |
| 94 | + - Along with the trace, it's a good idea to describe what you were doing |
| 95 | + when the problem occurred, in as much detail as possible. |
| 96 | + |
| 97 | +[analysed]: https://docs.microsoft.com/en-us/windows-hardware/test/wpt/windows-performance-analyzer |
| 98 | +[record]: https://docs.microsoft.com/en-us/windows-hardware/test/wpt/windows-performance-recorder |
| 99 | +[RudeWindowFixer profile]: https://raw.githubusercontent.com/dechamps/RudeWindowFixer/master/RudeWindowFixer.wprp |
| 100 | +[RudeWindowFixerReleases]: https://github.com/dechamps/RudeWindowFixer/releases |
| 101 | +[WindowInvestigator profile]: https://raw.githubusercontent.com/dechamps/WindowInvestigator/master/WindowInvestigator.wprp |
| 102 | +[WindowManagementLogging profile]: https://raw.githubusercontent.com/dechamps/WindowInvestigator/master/WindowManagementLogging.wprp |
| 103 | +[traces]: https://docs.microsoft.com/en-us/windows/win32/etw/about-event-tracing |
| 104 | +[WindowInvestigator]: https://github.com/dechamps/WindowInvestigator |
| 105 | +[WindowInvestigatorReleases]: https://github.com/dechamps/WindowInvestigator/releases |
0 commit comments