From 7076e7012e2b18fd91c14e958bd98a60a3251fed Mon Sep 17 00:00:00 2001 From: Arkadiusz Szczepkowicz Date: Tue, 13 Aug 2024 12:45:58 +0200 Subject: [PATCH] #2187: Fix order of the parametrs in the method for starting a user note --- src/vt/trace/trace_lite.cc | 2 +- src/vt/trace/trace_lite.h | 6 +++--- src/vt/trace/trace_user.cc | 2 +- src/vt/trace/trace_user.h | 4 ++-- tests/unit/trace/test_trace_user.cc | 16 ++++++++-------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/vt/trace/trace_lite.cc b/src/vt/trace/trace_lite.cc index 87f2a7a5ac..702c484bcf 100644 --- a/src/vt/trace/trace_lite.cc +++ b/src/vt/trace/trace_lite.cc @@ -287,7 +287,7 @@ void TraceLite::addUserEventBracketedEndTime( } void TraceLite::addUserNoteBracketedBeginTime( - std::string const& note, TraceEventIDType const event + TraceEventIDType const event, std::string const& note ) { if (not checkDynamicRuntimeEnabled()) { return; diff --git a/src/vt/trace/trace_lite.h b/src/vt/trace/trace_lite.h index 003fb10f2b..48c9d2683a 100644 --- a/src/vt/trace/trace_lite.h +++ b/src/vt/trace/trace_lite.h @@ -188,11 +188,11 @@ struct TraceLite { * \note See \c TraceScopedNote for a safer scope-based logging mechanism for * bracketed user events with a note. * - * \param[in] note the note to log * \param[in] event the event ID + * \param[in] note the note to log */ void addUserNoteBracketedBeginTime( - std::string const& note, TraceEventIDType const event = no_trace_event + TraceEventIDType const event, std::string const& note ); /** @@ -203,7 +203,7 @@ struct TraceLite { * * \param[in] event the event ID */ - void addUserNoteBracketedEndTime(TraceEventIDType const event = no_trace_event); + void addUserNoteBracketedEndTime(TraceEventIDType const event); /** * \brief Log a user bracketed event with a note diff --git a/src/vt/trace/trace_user.cc b/src/vt/trace/trace_user.cc index 2121e2ccf5..0cb39fd8d5 100644 --- a/src/vt/trace/trace_user.cc +++ b/src/vt/trace/trace_user.cc @@ -101,7 +101,7 @@ void addUserNotePre( ) { #if vt_check_enabled(trace_enabled) if (in_event != no_user_event_id) { - theTrace()->addUserNoteBracketedBeginTime(in_note, in_event); + theTrace()->addUserNoteBracketedBeginTime(in_event, in_note); } #endif } diff --git a/src/vt/trace/trace_user.h b/src/vt/trace/trace_user.h index a43a9881fe..62e57f60ce 100644 --- a/src/vt/trace/trace_user.h +++ b/src/vt/trace/trace_user.h @@ -258,7 +258,7 @@ struct TraceScopedNote final { note_(in_note) { if (event_ != no_trace_event) { - theTrace()->addUserNoteBracketedBeginTime(note_, event_); + theTrace()->addUserNoteBracketedBeginTime(event_, note_); } } @@ -273,7 +273,7 @@ struct TraceScopedNote final { note_("") { if (event_ != no_trace_event) { - theTrace()->addUserNoteBracketedBeginTime(note_, event_); + theTrace()->addUserNoteBracketedBeginTime(event_, note_); } } diff --git a/tests/unit/trace/test_trace_user.cc b/tests/unit/trace/test_trace_user.cc index 1225d8aeb3..2b068881aa 100644 --- a/tests/unit/trace/test_trace_user.cc +++ b/tests/unit/trace/test_trace_user.cc @@ -303,10 +303,10 @@ TEST_F(TestTraceUser, trace_user_note_bracketed) { GTEST_SKIP() << "trace tests require --vt_trace to be set"; } - theTrace()->addUserNoteBracketedBeginTime("OUTER TEST NOTE 10", 10); - theTrace()->addUserNoteBracketedBeginTime("INNER TEST NOTE 10", 10); - theTrace()->addUserNoteBracketedBeginTime("INNER INNER TEST NOTE 10", 10); - theTrace()->addUserNoteBracketedBeginTime("INNER INNER INNER TEST NOTE 12", 12); + theTrace()->addUserNoteBracketedBeginTime(10, "OUTER TEST NOTE 10"); + theTrace()->addUserNoteBracketedBeginTime(10, "INNER TEST NOTE 10"); + theTrace()->addUserNoteBracketedBeginTime(10, "INNER INNER TEST NOTE 10"); + theTrace()->addUserNoteBracketedBeginTime(12, "INNER INNER INNER TEST NOTE 12"); theTrace()->addUserEvent(901); trace::addUserNote("Note 0"); @@ -331,10 +331,10 @@ TEST_F(TestTraceUser, trace_user_note_bracketed_override_note) { GTEST_SKIP() << "trace tests require --vt_trace to be set"; } - theTrace()->addUserNoteBracketedBeginTime("ABC", 10); - theTrace()->addUserNoteBracketedBeginTime("123", 10); - theTrace()->addUserNoteBracketedBeginTime("X", 10); - theTrace()->addUserNoteBracketedBeginTime("", 12); + theTrace()->addUserNoteBracketedBeginTime(10, "ABC"); + theTrace()->addUserNoteBracketedBeginTime(10, "123"); + theTrace()->addUserNoteBracketedBeginTime(10, "X"); + theTrace()->addUserNoteBracketedBeginTime(12, ""); theTrace()->addUserEvent(901); trace::addUserNote("Note 0");