bombomby / optick

C++ Profiler For Games

Home Page:https://optick.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Optick cant connect to my app

nirgivon opened this issue · comments

I'm sure it's not a BUG/Issue but a user issue.

However, I was not able to get the information from the documentation.,,

I am trying to use Optick to profile my application running on OpenFramworks.

I included the src files in my project.
I went thru the ConsoleApp example.

I added:
OPTICK_SET_MEMORY_ALLOCATOR( [](size_t size) -> void* { return operator new(size); }, [](void* p) { operator delete(p); }, []() { /* Do some TLS initialization here if needed */ } );
To Main.

I added:
OPTICK_FRAME("MainThread");
before the ofApp runs.

finally, I added some
` OPTICK_EVENT();'
calles within my code.

When I run Opcick and click on the "start profiling" button, the GUI displays "Connecting .... " with my computers IP.
And that's it.
What am I missing to have Optick "see" my app?

Have you tried to launch one ConsoleApp sample and verify that it works on your machine?

Yes, the console app works great.
The problem is when I try to embed Opcick within my project

Does your application have "Frames" or you want to measure the whole duration of the application?
If you have "Frames", you need to call OPTICK_FRAME("MainThread"); inside your main loop - this function is responsible for opening a socket and waiting for connection from the GUI.

If you don't have frames and want to profile the whole application - check out OPTICK_APP("App Name"); macro: https://github.com/bombomby/optick/wiki/Optick-API#optick_appapp_name

Thanks!
I was missing OPTICK_FRAME in the main loop.