Skip to content

Commit

Permalink
#2187: Update TraceScopedNote to prevent tracing without user event ID
Browse files Browse the repository at this point in the history
  • Loading branch information
thearusable committed Jul 8, 2024
1 parent 8964ad6 commit d948ae2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/vt/trace/trace_user.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ struct TraceScopedNote final {
) : event_(in_event),
note_(in_note)
{
theTrace()->addUserNoteBracketedBeginTime(note_, event_);
if (event_ != no_user_event_id) {
theTrace()->addUserNoteBracketedBeginTime(note_, event_);
}
}

/**
Expand All @@ -270,7 +272,9 @@ struct TraceScopedNote final {
: event_(in_event),
note_("")
{
theTrace()->addUserNoteBracketedBeginTime(note_, event_);
if (event_ != no_user_event_id) {
theTrace()->addUserNoteBracketedBeginTime(note_, event_);
}
}

TraceScopedNote(TraceScopedNote const&) = delete;
Expand Down

0 comments on commit d948ae2

Please sign in to comment.