diff options
author | RunitaiLinden <davep@lindenlab.com> | 2023-05-12 18:09:35 -0500 |
---|---|---|
committer | RunitaiLinden <davep@lindenlab.com> | 2023-05-12 18:09:35 -0500 |
commit | e3f9244375e3ddfb96a38afac007f0a5a68d3b46 (patch) | |
tree | a19222a88574bb8e87945ddd8e502fbaadc158f2 /indra/newview/llperfstats.h | |
parent | 06bdee663433bf5b12eddcbcfcb8785546354c28 (diff) |
SL-19710 Fix for deadlock in LLPerfStats. Move General thread initialization to earlier in session (unrelated).
Diffstat (limited to 'indra/newview/llperfstats.h')
-rw-r--r-- | indra/newview/llperfstats.h | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/indra/newview/llperfstats.h b/indra/newview/llperfstats.h index bb5677f237..33777abdbf 100644 --- a/indra/newview/llperfstats.h +++ b/indra/newview/llperfstats.h @@ -162,12 +162,7 @@ namespace LLPerfStats extern Tunables tunables; class StatsRecorder{ - using Queue = LLThreadSafeQueue<StatsRecord>; public: - - // called once per main loop iteration on General thread - static void update(); - static inline StatsRecorder& getInstance() { static StatsRecorder instance; @@ -176,9 +171,24 @@ namespace LLPerfStats static inline void setFocusAv(const LLUUID& avID){focusAv = avID;}; static inline const LLUUID& getFocusAv(){return focusAv;}; static inline void setAutotuneInit(){autotuneInit = true;}; - static inline void send(StatsRecord && upd){StatsRecorder::getInstance().q.pushFront(std::move(upd));}; - static void endFrame(){StatsRecorder::getInstance().q.pushFront(StatsRecord{StatType_t::RENDER_DONE, ObjType_t::OT_GENERAL, LLUUID::null, LLUUID::null, 0});}; - static void clearStats(){StatsRecorder::getInstance().q.pushFront(StatsRecord{StatType_t::RENDER_DONE, ObjType_t::OT_GENERAL, LLUUID::null, LLUUID::null, 1});}; + + static inline void send(StatsRecord && upd) + { + LL_PROFILE_ZONE_SCOPED_CATEGORY_STATS; + StatsRecorder::getInstance().processUpdate(upd); + } + + static void endFrame() + { + LL_PROFILE_ZONE_SCOPED_CATEGORY_STATS; + StatsRecorder::getInstance().processUpdate(StatsRecord{StatType_t::RENDER_DONE, ObjType_t::OT_GENERAL, LLUUID::null, LLUUID::null, 0}); + } + + static void clearStats() + { + LL_PROFILE_ZONE_SCOPED_CATEGORY_STATS; + StatsRecorder::getInstance().processUpdate(StatsRecord{StatType_t::RENDER_DONE, ObjType_t::OT_GENERAL, LLUUID::null, LLUUID::null, 1}); + } static inline void setEnabled(bool on_or_off){collectionEnabled=on_or_off;}; static inline void enable() { collectionEnabled=true; }; @@ -284,8 +294,6 @@ namespace LLPerfStats static void toggleBuffer(); static void clearStatsBuffers(); - Queue q; - ~StatsRecorder() = default; StatsRecorder(const StatsRecorder&) = delete; StatsRecorder& operator=(const StatsRecorder&) = delete; @@ -307,7 +315,7 @@ namespace LLPerfStats start{LLTrace::BlockTimer::getCPUClockCount64()}, stat{type, ObjTypeDiscriminator, std::move(av), std::move(id), 0, isRiggedAtt, isHUDAtt} { - //LL_PROFILE_ZONE_COLOR(tracy::Color::Orange); + LL_PROFILE_ZONE_SCOPED_CATEGORY_STATS; }; template < ObjType_t OD = ObjTypeDiscriminator, @@ -324,8 +332,6 @@ namespace LLPerfStats return; } - //LL_PROFILE_ZONE_COLOR(tracy::Color::Red); - stat.time = LLTrace::BlockTimer::getCPUClockCount64() - start; StatsRecorder::send(std::move(stat)); }; |