Profiler: Invalid blocks order for per-thread data detected

I’m using Unity 2018.4.4f1 to build and profile a Win64 Player (project attached Case 1108597).

While profiling, Unity outputs (I guess every frame) the following warning to the Console window:

What is the warning telling me and how can I fix it?

Furthermore, sometimes Unity outputs this warning while profiling:

How can I fix this?

Hi Peter!

The warning is generally a result of too much data is being transferred through the connection between player and editor. When a connection is not capable to handle all generated data by profiler we drop data and that might cause both warnings. You can fix it by making sure the connection can handle 50MB/s or dumping data to file.

However I recall “There might be missing profiler data - invalid blocks order for per-thread data detected.” warning was also occurring in when profiling a project with high JobSystem activity and enabling/disabling profiler quickly - this was a bug which we fixed in 2019 afaik. If this case sounds similar when we need to backport the fix.

1 Like

Hi Alexey, thanks for your help!

How would I go to make sure the connection can handle 50MB/s? I’m running the Player and Editor on the same PC, it’s not like I’m connected to a device over WIFI or so.

It also did work without these warnings in earlier Unity versions. For example, I didn’t see this warning in Unity 2017.

I don’t have any JobSystem related user code in the project and I also didn’t toggle the profiler quickly. Perhaps it’s a different issue.

Loopback connection should be enough to maintain much higher transfer rater. I assume the problem is different then, more likely Editor is just not processing the data fast enough.In this case the workaround would be still to dump data to the file. I’ll try to reproduce the issue with the project you’ve provided.

This is strange - we’ve changed profiler backend in Unity 2017.3. There were no major changes since then.

1 Like

Cool, thank you!

If you test this in 2018.4.4, you’ll also encounter another Profiler issue, where it claims Profiler.Begin/End calls do not match. This is caused in ManagedUpdate.cs by this code:

#if WPROFILE
    _UpdateSampler.Begin(current as UnityEngine.Object);
#endif

    current.ManagedUpdate();

#if WPROFILE
    _UpdateSampler.End();
#endif

Removing the current as UnityEngine.Object argument gets rid of the error.

I had the project a long time on 2017.4 and really didn’t see this issue afair. I’ve updated to 2018.4 recently and then it started to occur.

Thank you for the report! We are backporting the fix to 2018.4

1 Like