diff --git a/xpti/include/xpti/xpti_trace_framework.hpp b/xpti/include/xpti/xpti_trace_framework.hpp index faf668984b2dc..d72e86e16703e 100644 --- a/xpti/include/xpti/xpti_trace_framework.hpp +++ b/xpti/include/xpti/xpti_trace_framework.hpp @@ -353,6 +353,8 @@ class SpinLock { struct finally { std::function MFunc; + finally(const finally &) = delete; + finally &operator=(const finally &) = delete; ~finally() { if (xptiTraceEnabled()) MFunc(); @@ -663,6 +665,11 @@ class stash_tuple { (xptiStashTuple(key, value) == xpti::result_t::XPTI_RESULT_SUCCESS); } + // Copy and copy assignment are deleted since we dont want to stash the same + // key-value pair multiple times + stash_tuple(const stash_tuple &) = delete; + stash_tuple &operator=(const stash_tuple &) = delete; + /// @brief Destroys the stash_tuple object and unstashes the key-value pair if /// it was stashed successfully earlier. /// @@ -734,6 +741,8 @@ class uid_object_t { MUId.instance = 0; }; + ~uid_object_t() = default; + /// @brief Copy constructor for creating a uid_object_t object as a copy of /// another. /// @@ -1613,6 +1622,10 @@ class tracepoint_t { } } } + + tracepoint_t(const tracepoint_t &) = delete; + tracepoint_t &operator=(const tracepoint_t &) = delete; + ~tracepoint_t() { // If tracing is not enabled, don't do anything if (!xptiTraceEnabled()) @@ -1779,4 +1792,4 @@ class tracepoint_t { /// /// @param self A pointer to the current function. /// -#define XPTI_USE_TRACE_SCOPE() xpti::framework::tracepoint_scope_t TP(true); \ No newline at end of file +#define XPTI_USE_TRACE_SCOPE() xpti::framework::tracepoint_scope_t TP(true);