Search Issue Tracker
Fix In Review for 2020.1
Fixed in 2018.4, 2019.4, 2020.2
[Profiler] Hierarchy randomly hides parts of the sample hierarchy if Editor Only Samples are present and set to be Collapsed
How to reproduce:
1. Open any Unity Project
2. Open the Profiler Window (Ctrl/Cmd +7)
3. Load in the Attached profiler data file
4. Got to frame 1, Select the CPU Usage Profiler Module and set it to Hierarchy view
5. Sort the samples in the Hierarchy view by Name
5. Look for this sample (path notation):
PlayerLoop / Update.ScriptRunBehaviourUpdate / BehaviourUpdate / EditorOnlySample.Update() / Update 1057
6. Notice that it doesn't have any child samples, unlike it's similarly named siblings
7. In the far right end of the Hierarchy view's toolbar, click on the three dots kebab-menu (cogwheel pre 2019.3) and toggle off "Collapse EditorOnly Samples"
8. Find the sample again and see that it has child samples now.
The code causing this Profiler data has been attached but basically it 1000 GameObjects spamming Editor Only Samples by triggering the GetComponent NullCheck
Profiler.BeginSample("Update " + (i++));
var nonExisting = GetComponent<RectTransform>();
so each of these samples should have the same kind of child samples.
Expected result: The Profiler shows that all "Update X" have a similar structure of child samples. "Collapse EditorOnly Samples" only affects samples that are then renamed to clarify that they are Editor Only samples, that have been collapsed.
Actual result: The Profiler wrongfuly collapses some non-editor-only "Update X" samples and thereby hides its child samples.
Reproducible with: 2018.4.20f1, 2019.4.16f1, 2020.1.16f1, 2020.2.0b14, 2021.1.0a6
Not reproducible with: 2018.2 (Collapsing Editor Only samples was only introduced in 2018.3), 2021.1.0a7 (was already fixed)
Note: there are several other "Update X" samples affected, e.g. "Update 1074" "Update 1441" "Update 1724"
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- NullReferenceException when selecting a Dropdown Component override in the Prefab Overrides menu for the second time
- USS variables are broken on IOS
- Crash when project is reopened or upgraded
- Hub doesn't install windows 10 sdk properly
- Crash building for iOS after canceling a build