diff --git a/include/ftl/profiler.hpp b/include/ftl/profiler.hpp index 8b6afbbaa912f10c576313860542bc00b818d659..1e48b0a3a3508367ce10e10a6c98ef8c76cda061 100644 --- a/include/ftl/profiler.hpp +++ b/include/ftl/profiler.hpp @@ -38,3 +38,9 @@ #define FTL_Profile(LABEL, LIMIT) {} #endif + +inline void FTL_PROFILE_LOG(const std::string& message) { +#ifdef TRACY_ENABLE + TracyMessage(message.c_str(), message.size()); +#endif +} \ No newline at end of file diff --git a/src/ctpl_stl.cpp b/src/ctpl_stl.cpp index 7d4e8f98cc50d59ef6858510fce2c8f4d7602c89..b82a72aabc77f43542102b01053791c54bdd5cfb 100644 --- a/src/ctpl_stl.cpp +++ b/src/ctpl_stl.cpp @@ -1,6 +1,7 @@ #ifdef WIN32 #include <Ws2tcpip.h> #include <windows.h> +#include <string> #endif #include <ftl/lib/ctpl_stl.hpp> diff --git a/src/streams/netstream.cpp b/src/streams/netstream.cpp index 36e4470f1a7aaf452f95470797e6bdeacf3c0470..9b0228fbcb2693c3347b8f1aee5835214afceb48 100644 --- a/src/streams/netstream.cpp +++ b/src/streams/netstream.cpp @@ -14,6 +14,7 @@ #include "netstream.hpp" #include <ftl/time.hpp> #include <ftl/counter.hpp> +#include <ftl/profiler.hpp> #include "../uuidMSGPACK.hpp" #include "packetMsgpack.hpp" @@ -327,7 +328,7 @@ void Net::_run() { state->base_pkt_ts_ = raw_ats; cts = 0; } - ats = raw_ats - state->base_pkt_ts_ + buffering_; + ats = raw_ats - state->base_pkt_ts_ + buffering_; } else { // LOG(WARNING) << "No packets to present: " << cts; continue; @@ -366,10 +367,12 @@ void Net::_run() { } ftl::pool.push([ - this, + this, c = std::move(ftl::Counter(&state->active)), c2 = std::move(ftl::Counter(&jobs_)), framePackets](int ix) { + + FTL_PROFILE_SCOPE("ProcessFramePackets"); for (auto buf : framePackets) { StreamPacket *spkt; DataPacket *pkt;