diff --git a/src/vt/trace/trace_user.cc b/src/vt/trace/trace_user.cc index baf10698fd..f6e5299568 100644 --- a/src/vt/trace/trace_user.cc +++ b/src/vt/trace/trace_user.cc @@ -95,26 +95,14 @@ void addUserData([[maybe_unused]] int32_t data) { #endif } -#if vt_check_enabled(trace_enabled) -struct UserNoteHolder final { - static std::unordered_map notes_; -}; - -/*static*/ std::unordered_map UserNoteHolder::notes_ = {}; -#endif - void addUserNotePre( [[maybe_unused]] std::string const& in_note, [[maybe_unused]] TraceEventIDType const in_event ) { #if vt_check_enabled(trace_enabled) - auto iter = UserNoteHolder::notes_.find(in_note); - vtAssertExpr(iter == UserNoteHolder::notes_.end()); - UserNoteHolder::notes_.emplace( - std::piecewise_construct, - std::forward_as_tuple(in_note), - std::forward_as_tuple(in_note, in_event) - ); + if (in_event != no_user_event_id) { + theTrace()->addUserNoteBracketedBeginTime(in_note, in_event); + } #endif } @@ -123,9 +111,9 @@ void addUserNoteEpi( [[maybe_unused]] TraceEventIDType const in_event ) { #if vt_check_enabled(trace_enabled) - auto iter = UserNoteHolder::notes_.find(in_note); - vtAssertExpr(iter != UserNoteHolder::notes_.end()); - UserNoteHolder::notes_.erase(iter); + if (in_event != no_user_event_id) { + theTrace()->addUserNoteBracketedEndTime(in_note, in_event); + } #endif }