easy_profiler: Profiler GUI says 'Cannot read profiled blocks'

Hi All, I don’t know what I’m doing wrong. I’m having an application that statically links some libs and I’m trying to profile some code inside these libs. I followed the guide, and enabled the profiler like this in my main function:

int main(int argc, char** argv)
{
EASY_FUNCTION(profiler::colors::Magenta);
EASY_PROFILER_ENABLE;
profiler::startListen();

Then over in my render thread (which is a statically linked lib) I added following code:

void renderer::thread::run() noexcept {
    EASY_MAIN_THREAD;
    EASY_FUNCTION(profiler::colors::Green);

And in the render loop I added this code:

    while (_active.load()) {
        EASY_BLOCK("Render loop");

Then I start the application (compiled in release mode) and atttach the profiler GUI to the running process (Clicking ‘connect’ button). After a while I’m stopping the capture by closing the ‘Capturing frames…’ dialog. Right after this, a dialog pops up, telling me ‘Cannot read profiled blocks’. snap

Can anyone tell me what I did wrong? My aim is to measure the timing of the render loop. Many thanks in advance for help.

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 1
  • Comments: 15

Most upvoted comments

@cas4ey Yes, your are right, such blocks have no use, but the problem is that the error message is completely uninformative for that situation. I was just blindly putting a block into every function, and it took me some time to figure out what was the reason 😃