yse / easy_profiler

Lightweight profiler library for c++
MIT License
2.15k stars 184 forks source link

After stopping profiling in GUI, no data is received #119

Open BrodyHiggerson opened 6 years ago

BrodyHiggerson commented 6 years ago

Hey there!

I just built easy_profiler for the first time with Qt 5.11.1 and VS 2017 in Win64 after copying the .dlls to the bin folder of the gui app manually. But after I hit the 'Connect' button to profile one of the samples, clicking it again to stop the connection - or the app stopping (as the samples do when they're finished) - just displays "Connection was lost" and then no data. I've had closing the dialog box work for capturing data one time, but then after waiting almost 10 minutes it still showed no data from ~20 seconds of profiling.

Just curious if there's anything I'm missing! Would love to get this working :)

DsoTsin commented 6 years ago

I have the same problem...

cas4ey commented 5 years ago

Doesn't it related to #115 ?

alprist commented 5 years ago

By my opinion it can be connected with the #142 because of it has some problem with the SocketListener::listenCapture method in the profiler_gui/main_window.cpp

qlibp commented 1 year ago

encounter the same issue on my ubuntu 16.04, using develop commit.

File dump works fine and the dumped file can be loaded by gui. But the network stream can't work properly. It keep showing capturing frame, but no graph/data shown in gui(actually, the FPS window keep updating(but the data seems not meaningful, it's just a straight line)

image

test code snippet

#include <easy/profiler.h>
#include <iostream>

void foo(const char* loopName) {
    EASY_BLOCK(loopName, profiler::ON_WITHOUT_CHILDREN, profiler::colors::Amber700); // B
    int a = 0;
    for (int i = 0; i < 10000; ++i) {
        EASY_BLOCK("Loop body");
        a += i;
        EASY_END_BLOCK;
    }
    EASY_END_BLOCK; 
}

int main() {
    EASY_PROFILER_ENABLE;
    profiler::startListen();
    /* do work */
    for(int i=0; i<50000; i++)
    {
    foo("abc");
    }
    // while(1)
    // {
    // foo("abc");
    // }
    // auto block_num = profiler::dumpBlocksToFile("test_profile.prof");
    // std::cout << "block_num=" << block_num;
    return 1;
}

Just curious if I compile easy_profiler correctly