Search Issue Tracker
Fixed in 2020.1.X
Fixed in 2018.4.X, 2019.4.X, 2020.2.X
[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.
- Dropdown menu covers the button when there is no space for it from below
- WebCamDevice only returns one rear-facing camera when built on Android
- Reimporting a Scripted Importer Asset when Profiler is recording will make it null
- Created Import Issue Asset doesn't show up in the Project window until the Unity Editor is restarted
- Crash on CachedWriter::Write when building a project that has access to files being denied