godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
86.58k stars 19.3k forks source link

Profiler silently fails if "Profiler Frame Max Functions" is exceeded #50310

Open nellodotca opened 3 years ago

nellodotca commented 3 years ago

Godot version

3.3.2.stable

System information

5.12.15-arch1-1

Issue description

If you start the Profiler and the number of called functions exceeds the value set in

Editor Settings -> Debugger -> Profiler Frame Max Functions

the Profiler will show all 0s for Time and Call

2021-07-09-074954_1138x223_scrot

Increasing the value to be greater than the number of functions called resolves the issue.

Is it possible to add a warning for when it fails because the maximum is exceeded? There are only two results for "Profiler Frame Max Functions" on Google and I only found it by searching through the source code while troubleshooting the Profiler failure

Steps to reproduce

In a project with a number of function calls navigate to

Editor Settings -> Debugger -> Profiler Frame Max Functions

and change the value to a very small number then run the Profiler

Minimal reproduction project

No response

Calinou commented 2 years ago

The code that handles this is here in the 3.x branch:

https://github.com/godotengine/godot/blob/71e30e3032b37d17baf868be5e38055e1c0b568c/editor/script_editor_debugger.cpp#L1651-L1653

And in the master branch (which uses a different profiler implementation):

https://github.com/godotengine/godot/blob/374ffbe2d2a7294dd9ea1429a3dec1eedfa34b60/editor/debugger/script_editor_debugger.cpp#L943-L944

However, this parameter is sent via the (local) network, which makes it difficult to track down in the source code.