diff options
author | vskipin <vskipin@yandex-team.ru> | 2022-02-10 16:46:00 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:00 +0300 |
commit | 4e4b78bd7b67e2533da4dbb9696374a6d6068e32 (patch) | |
tree | a7a5543d815c451256ece74081d960b4e1d70ec2 /library/cpp/actors | |
parent | 5b00ed04a5137a452fa6d3423cb0c9b54ac27408 (diff) | |
download | ydb-4e4b78bd7b67e2533da4dbb9696374a6d6068e32.tar.gz |
Restoring authorship annotation for <vskipin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/actors')
-rw-r--r-- | library/cpp/actors/core/executor_thread.cpp | 8 | ||||
-rw-r--r-- | library/cpp/actors/core/log.cpp | 78 | ||||
-rw-r--r-- | library/cpp/actors/core/log.h | 12 | ||||
-rw-r--r-- | library/cpp/actors/core/mon.h | 24 | ||||
-rw-r--r-- | library/cpp/actors/core/ya.make | 8 | ||||
-rw-r--r-- | library/cpp/actors/interconnect/events_local.h | 2 | ||||
-rw-r--r-- | library/cpp/actors/interconnect/poller_tcp_unit.cpp | 6 | ||||
-rw-r--r-- | library/cpp/actors/interconnect/ut/lib/node.h | 20 | ||||
-rw-r--r-- | library/cpp/actors/interconnect/ya.make | 8 | ||||
-rw-r--r-- | library/cpp/actors/prof/tag.cpp | 150 | ||||
-rw-r--r-- | library/cpp/actors/prof/tag.h | 26 | ||||
-rw-r--r-- | library/cpp/actors/prof/ya.make | 10 | ||||
-rw-r--r-- | library/cpp/actors/util/funnel_queue.h | 10 | ||||
-rw-r--r-- | library/cpp/actors/wilson/wilson_event.h | 16 |
14 files changed, 189 insertions, 189 deletions
diff --git a/library/cpp/actors/core/executor_thread.cpp b/library/cpp/actors/core/executor_thread.cpp index 446b651efd..ebfb8599b3 100644 --- a/library/cpp/actors/core/executor_thread.cpp +++ b/library/cpp/actors/core/executor_thread.cpp @@ -4,12 +4,12 @@ #include "mailbox.h" #include "event.h" #include "events.h" - + #include <library/cpp/actors/prof/tag.h> #include <library/cpp/actors/util/affinity.h> #include <library/cpp/actors/util/datetime.h> #include <library/cpp/actors/util/thread.h> - + #ifdef BALLOC #include <library/cpp/balloc/optional/operators.h> #endif @@ -174,8 +174,8 @@ namespace NActors { if (activityType != prevActivityType) { prevActivityType = activityType; NProfiling::TMemoryTagScope::Reset(ActorSystem->MemProfActivityBase + activityType); - } - + } + actor->Receive(ev, ctx); size_t dyingActorsCnt = DyingActors.size(); diff --git a/library/cpp/actors/core/log.cpp b/library/cpp/actors/core/log.cpp index 5f63b5af58..651c04cc11 100644 --- a/library/cpp/actors/core/log.cpp +++ b/library/cpp/actors/core/log.cpp @@ -171,21 +171,21 @@ namespace NActors { TIntrusivePtr<NMonitoring::TDynamicCounters> counters) : TActor(&TLoggerActor::StateFunc) , Settings(settings) - , LogBackend(logBackend.Release()) + , LogBackend(logBackend.Release()) , Metrics(std::make_unique<TLoggerCounters>(counters)) { - } - - TLoggerActor::TLoggerActor(TIntrusivePtr<NLog::TSettings> settings, - std::shared_ptr<TLogBackend> logBackend, - TIntrusivePtr<NMonitoring::TDynamicCounters> counters) - : TActor(&TLoggerActor::StateFunc) - , Settings(settings) - , LogBackend(logBackend) + } + + TLoggerActor::TLoggerActor(TIntrusivePtr<NLog::TSettings> settings, + std::shared_ptr<TLogBackend> logBackend, + TIntrusivePtr<NMonitoring::TDynamicCounters> counters) + : TActor(&TLoggerActor::StateFunc) + , Settings(settings) + , LogBackend(logBackend) , Metrics(std::make_unique<TLoggerCounters>(counters)) - { - } - + { + } + TLoggerActor::TLoggerActor(TIntrusivePtr<NLog::TSettings> settings, TAutoPtr<TLogBackend> logBackend, std::shared_ptr<NMonitoring::TMetricRegistry> metrics) @@ -193,7 +193,7 @@ namespace NActors { , Settings(settings) , LogBackend(logBackend.Release()) , Metrics(std::make_unique<TLoggerMetrics>(metrics)) - { + { } TLoggerActor::TLoggerActor(TIntrusivePtr<NLog::TSettings> settings, @@ -580,31 +580,31 @@ namespace NActors { char buf[TimeBufSize]; switch (Settings->Format) { - case NActors::NLog::TSettings::PLAIN_FULL_FORMAT: { - TStringBuilder logRecord; - if (Settings->UseLocalTimestamps) { + case NActors::NLog::TSettings::PLAIN_FULL_FORMAT: { + TStringBuilder logRecord; + if (Settings->UseLocalTimestamps) { logRecord << FormatLocalTimestamp(time, buf); - } else { - logRecord << time; - } - logRecord + } else { + logRecord << time; + } + logRecord << Settings->MessagePrefix - << " :" << Settings->ComponentName(component) - << " " << PriorityToString(priority) - << ": " << formatted; - LogBackend->WriteData( - TLogRecord(logPrio, logRecord.data(), logRecord.size())); - } break; - - case NActors::NLog::TSettings::PLAIN_SHORT_FORMAT: { - TStringBuilder logRecord; - logRecord - << Settings->ComponentName(component) - << ": " << formatted; - LogBackend->WriteData( - TLogRecord(logPrio, logRecord.data(), logRecord.size())); - } break; - + << " :" << Settings->ComponentName(component) + << " " << PriorityToString(priority) + << ": " << formatted; + LogBackend->WriteData( + TLogRecord(logPrio, logRecord.data(), logRecord.size())); + } break; + + case NActors::NLog::TSettings::PLAIN_SHORT_FORMAT: { + TStringBuilder logRecord; + logRecord + << Settings->ComponentName(component) + << ": " << formatted; + LogBackend->WriteData( + TLogRecord(logPrio, logRecord.data(), logRecord.size())); + } break; + case NActors::NLog::TSettings::JSON_FORMAT: { NJsonWriter::TBuf json; json.BeginObject() @@ -629,9 +629,9 @@ namespace NActors { .WriteKey("message") .WriteString(formatted) .EndObject(); - auto logRecord = json.Str(); - LogBackend->WriteData( - TLogRecord(logPrio, logRecord.data(), logRecord.size())); + auto logRecord = json.Str(); + LogBackend->WriteData( + TLogRecord(logPrio, logRecord.data(), logRecord.size())); } break; } diff --git a/library/cpp/actors/core/log.h b/library/cpp/actors/core/log.h index c11a7cf3c1..d4047e8164 100644 --- a/library/cpp/actors/core/log.h +++ b/library/cpp/actors/core/log.h @@ -199,9 +199,9 @@ namespace NActors { TLoggerActor(TIntrusivePtr<NLog::TSettings> settings, TAutoPtr<TLogBackend> logBackend, TIntrusivePtr<NMonitoring::TDynamicCounters> counters); - TLoggerActor(TIntrusivePtr<NLog::TSettings> settings, - std::shared_ptr<TLogBackend> logBackend, - TIntrusivePtr<NMonitoring::TDynamicCounters> counters); + TLoggerActor(TIntrusivePtr<NLog::TSettings> settings, + std::shared_ptr<TLogBackend> logBackend, + TIntrusivePtr<NMonitoring::TDynamicCounters> counters); TLoggerActor(TIntrusivePtr<NLog::TSettings> settings, TAutoPtr<TLogBackend> logBackend, std::shared_ptr<NMonitoring::TMetricRegistry> metrics); @@ -236,9 +236,9 @@ namespace NActors { private: TIntrusivePtr<NLog::TSettings> Settings; - std::shared_ptr<TLogBackend> LogBackend; - ui64 IgnoredCount = 0; - ui64 PassedCount = 0; + std::shared_ptr<TLogBackend> LogBackend; + ui64 IgnoredCount = 0; + ui64 PassedCount = 0; static TAtomic IsOverflow; TDuration WakeupInterval{TDuration::Seconds(5)}; std::unique_ptr<ILoggerMetrics> Metrics; diff --git a/library/cpp/actors/core/mon.h b/library/cpp/actors/core/mon.h index c450f2338e..4bf41e8c63 100644 --- a/library/cpp/actors/core/mon.h +++ b/library/cpp/actors/core/mon.h @@ -42,11 +42,11 @@ namespace NActors { // base class for HTTP info response struct IEvHttpInfoRes: public NActors::TEventLocal<IEvHttpInfoRes, HttpInfoRes> { - enum EContentType { - Html, - Custom, - }; - + enum EContentType { + Html, + Custom, + }; + IEvHttpInfoRes() { } @@ -54,7 +54,7 @@ namespace NActors { } virtual void Output(IOutputStream& out) const = 0; - virtual EContentType GetContentType() const = 0; + virtual EContentType GetContentType() const = 0; }; // Ready to output HTML in TString @@ -62,7 +62,7 @@ namespace NActors { TEvHttpInfoRes(const TString& answer, int subReqId = 0, EContentType contentType = Html) : Answer(answer) , SubRequestId(subReqId) - , ContentType(contentType) + , ContentType(contentType) { } @@ -70,13 +70,13 @@ namespace NActors { out << Answer; } - EContentType GetContentType() const override { - return ContentType; - } - + EContentType GetContentType() const override { + return ContentType; + } + const TString Answer; const int SubRequestId; - const EContentType ContentType; + const EContentType ContentType; }; struct TEvRemoteHttpInfo: public NActors::TEventBase<TEvRemoteHttpInfo, RemoteHttpInfo> { diff --git a/library/cpp/actors/core/ya.make b/library/cpp/actors/core/ya.make index 880a9d00db..e534912e7c 100644 --- a/library/cpp/actors/core/ya.make +++ b/library/cpp/actors/core/ya.make @@ -7,10 +7,10 @@ OWNER( NO_WSHADOW() -IF (PROFILE_MEMORY_ALLOCATIONS) - CFLAGS(-DPROFILE_MEMORY_ALLOCATIONS) -ENDIF() - +IF (PROFILE_MEMORY_ALLOCATIONS) + CFLAGS(-DPROFILE_MEMORY_ALLOCATIONS) +ENDIF() + IF (ALLOCATOR == "B" OR ALLOCATOR == "BS" OR ALLOCATOR == "C") CXXFLAGS(-DBALLOC) PEERDIR( diff --git a/library/cpp/actors/interconnect/events_local.h b/library/cpp/actors/interconnect/events_local.h index 8a46ffd535..bf05879b5b 100644 --- a/library/cpp/actors/interconnect/events_local.h +++ b/library/cpp/actors/interconnect/events_local.h @@ -216,7 +216,7 @@ namespace NActors { HANDSHAKE_FAIL_SESSION_MISMATCH, }; - TEvHandshakeFail(EnumHandshakeFail temporary, TString explanation) + TEvHandshakeFail(EnumHandshakeFail temporary, TString explanation) : Temporary(temporary) , Explanation(std::move(explanation)) { diff --git a/library/cpp/actors/interconnect/poller_tcp_unit.cpp b/library/cpp/actors/interconnect/poller_tcp_unit.cpp index 59e7dda810..2ec9339115 100644 --- a/library/cpp/actors/interconnect/poller_tcp_unit.cpp +++ b/library/cpp/actors/interconnect/poller_tcp_unit.cpp @@ -9,7 +9,7 @@ #include <library/cpp/actors/prof/tag.h> #include <library/cpp/actors/util/intrinsics.h> - + #if defined _linux_ #include <pthread.h> #endif @@ -101,7 +101,7 @@ namespace NInterconnect { template <> void TPollerUnit::RunLoop<false>() { - NProfiling::TMemoryTagScope tag("INTERCONNECT_RECEIVED_DATA"); + NProfiling::TMemoryTagScope tag("INTERCONNECT_RECEIVED_DATA"); while (!AtomicLoad(&StopFlag)) ProcessRead(); } @@ -109,7 +109,7 @@ namespace NInterconnect { template <> void TPollerUnit::RunLoop<true>() { - NProfiling::TMemoryTagScope tag("INTERCONNECT_SEND_DATA"); + NProfiling::TMemoryTagScope tag("INTERCONNECT_SEND_DATA"); while (!AtomicLoad(&StopFlag)) ProcessWrite(); } diff --git a/library/cpp/actors/interconnect/ut/lib/node.h b/library/cpp/actors/interconnect/ut/lib/node.h index ff30b1445e..496a54c1c9 100644 --- a/library/cpp/actors/interconnect/ut/lib/node.h +++ b/library/cpp/actors/interconnect/ut/lib/node.h @@ -66,26 +66,26 @@ public: constexpr ui32 LoggerComponentId = 410; // NKikimrServices::LOGGER auto loggerSettings = MakeIntrusive<NLog::TSettings>( - loggerActorId, + loggerActorId, (NLog::EComponent)LoggerComponentId, NLog::PRI_INFO, NLog::PRI_DEBUG, - 0U); - - loggerSettings->Append( - NActorsServices::EServiceCommon_MIN, + 0U); + + loggerSettings->Append( + NActorsServices::EServiceCommon_MIN, NActorsServices::EServiceCommon_MAX, NActorsServices::EServiceCommon_Name ); - + constexpr ui32 WilsonComponentId = 430; // NKikimrServices::WILSON - static const TString WilsonComponentName = "WILSON"; - - loggerSettings->Append( + static const TString WilsonComponentName = "WILSON"; + + loggerSettings->Append( (NLog::EComponent)WilsonComponentId, (NLog::EComponent)WilsonComponentId + 1, [](NLog::EComponent) -> const TString & { return WilsonComponentName; }); - + // register nameserver table auto names = MakeIntrusive<TTableNameserverSetup>(); for (ui32 i = 1; i <= numNodes; ++i) { diff --git a/library/cpp/actors/interconnect/ya.make b/library/cpp/actors/interconnect/ya.make index 60d29b0fc0..80055e4245 100644 --- a/library/cpp/actors/interconnect/ya.make +++ b/library/cpp/actors/interconnect/ya.make @@ -8,10 +8,10 @@ OWNER( NO_WSHADOW() -IF (PROFILE_MEMORY_ALLOCATIONS) - CFLAGS(-DPROFILE_MEMORY_ALLOCATIONS) -ENDIF() - +IF (PROFILE_MEMORY_ALLOCATIONS) + CFLAGS(-DPROFILE_MEMORY_ALLOCATIONS) +ENDIF() + SRCS( channel_scheduler.h event_filter.h diff --git a/library/cpp/actors/prof/tag.cpp b/library/cpp/actors/prof/tag.cpp index 9ccf03e1a9..ff4ea01f3c 100644 --- a/library/cpp/actors/prof/tag.cpp +++ b/library/cpp/actors/prof/tag.cpp @@ -4,108 +4,108 @@ #include <library/cpp/charset/ci_string.h> #include <library/cpp/containers/atomizer/atomizer.h> #include <library/cpp/malloc/api/malloc.h> - -#if defined(PROFILE_MEMORY_ALLOCATIONS) + +#if defined(PROFILE_MEMORY_ALLOCATIONS) #include <library/cpp/lfalloc/dbg_info/dbg_info.h> #include <library/cpp/ytalloc/api/ytalloc.h> -#endif - -#include <util/generic/singleton.h> -#include <util/generic/string.h> -#include <util/generic/vector.h> +#endif + +#include <util/generic/singleton.h> +#include <util/generic/string.h> +#include <util/generic/vector.h> #include <util/system/mutex.h> namespace NProfiling { - class TStringAtoms { - private: + class TStringAtoms { + private: TMutex Mutex; atomizer<ci_hash, ci_equal_to> Tags; - - public: - static TStringAtoms& Instance() { - return *Singleton<TStringAtoms>(); - } - - ui32 MakeTag(const char* s) { - Y_VERIFY(s); - with_lock (Mutex) { - return Tags.string_to_atom(s); - } - } - - ui32 MakeTags(const TVector<const char*>& ss) { - Y_VERIFY(ss); - with_lock (Mutex) { - ui32 baseTag = Tags.string_to_atom(ss[0]); - ui32 nextTag = baseTag + 1; - for (auto i = ss.begin() + 1; i != ss.end(); ++i, ++nextTag) { - Y_VERIFY(*i); - ui32 ctag = Tags.string_to_atom(*i); - Y_VERIFY(ctag == nextTag); - } - return baseTag; - } - } - - const char* GetTag(ui32 tag) const { - with_lock (Mutex) { - return Tags.get_atom_name(tag); - } - } - - size_t GetTagsCount() const { - with_lock (Mutex) { - return Tags.size(); - } - } + + public: + static TStringAtoms& Instance() { + return *Singleton<TStringAtoms>(); + } + + ui32 MakeTag(const char* s) { + Y_VERIFY(s); + with_lock (Mutex) { + return Tags.string_to_atom(s); + } + } + + ui32 MakeTags(const TVector<const char*>& ss) { + Y_VERIFY(ss); + with_lock (Mutex) { + ui32 baseTag = Tags.string_to_atom(ss[0]); + ui32 nextTag = baseTag + 1; + for (auto i = ss.begin() + 1; i != ss.end(); ++i, ++nextTag) { + Y_VERIFY(*i); + ui32 ctag = Tags.string_to_atom(*i); + Y_VERIFY(ctag == nextTag); + } + return baseTag; + } + } + + const char* GetTag(ui32 tag) const { + with_lock (Mutex) { + return Tags.get_atom_name(tag); + } + } + + size_t GetTagsCount() const { + with_lock (Mutex) { + return Tags.size(); + } + } }; ui32 MakeTag(const char* s) { - return TStringAtoms::Instance().MakeTag(s); + return TStringAtoms::Instance().MakeTag(s); } ui32 MakeTags(const TVector<const char*>& ss) { - return TStringAtoms::Instance().MakeTags(ss); + return TStringAtoms::Instance().MakeTags(ss); } const char* GetTag(ui32 tag) { - return TStringAtoms::Instance().GetTag(tag); - } - - size_t GetTagsCount() { - return TStringAtoms::Instance().GetTagsCount(); + return TStringAtoms::Instance().GetTag(tag); } + size_t GetTagsCount() { + return TStringAtoms::Instance().GetTagsCount(); + } + static ui32 SetThreadAllocTag_Default(ui32 tag) { Y_UNUSED(tag); return 0; } -#if defined(PROFILE_MEMORY_ALLOCATIONS) - static ui32 SetThreadAllocTag_YT(ui32 tag) { - auto prev = NYT::NYTAlloc::GetCurrentMemoryTag(); - NYT::NYTAlloc::SetCurrentMemoryTag(tag); - return prev; - } - - static TSetThreadAllocTag* SetThreadAllocTagFn() { - const auto& info = NMalloc::MallocInfo(); - - TStringBuf name(info.Name); - if (name.StartsWith("lf")) { - return (TSetThreadAllocTag*)NAllocDbg::SetThreadAllocTag; - } else if (name.StartsWith("yt")) { - return SetThreadAllocTag_YT; +#if defined(PROFILE_MEMORY_ALLOCATIONS) + static ui32 SetThreadAllocTag_YT(ui32 tag) { + auto prev = NYT::NYTAlloc::GetCurrentMemoryTag(); + NYT::NYTAlloc::SetCurrentMemoryTag(tag); + return prev; + } + + static TSetThreadAllocTag* SetThreadAllocTagFn() { + const auto& info = NMalloc::MallocInfo(); + + TStringBuf name(info.Name); + if (name.StartsWith("lf")) { + return (TSetThreadAllocTag*)NAllocDbg::SetThreadAllocTag; + } else if (name.StartsWith("yt")) { + return SetThreadAllocTag_YT; } else if (name.StartsWith("tc")) { return SetTCMallocThreadAllocTag; - } else { - return SetThreadAllocTag_Default; - } - } + } else { + return SetThreadAllocTag_Default; + } + } #else static TSetThreadAllocTag* SetThreadAllocTagFn() { const auto& info = NMalloc::MallocInfo(); - + TStringBuf name(info.Name); if (name.StartsWith("tc")) { return SetTCMallocThreadAllocTag; @@ -115,5 +115,5 @@ namespace NProfiling { } #endif - TSetThreadAllocTag* SetThreadAllocTag = SetThreadAllocTagFn(); + TSetThreadAllocTag* SetThreadAllocTag = SetThreadAllocTagFn(); } diff --git a/library/cpp/actors/prof/tag.h b/library/cpp/actors/prof/tag.h index 357e264a22..5ef36f588b 100644 --- a/library/cpp/actors/prof/tag.h +++ b/library/cpp/actors/prof/tag.h @@ -1,6 +1,6 @@ #pragma once -#include <util/generic/fwd.h> +#include <util/generic/fwd.h> /* Common registry for tagging memory profiler. @@ -15,21 +15,21 @@ namespace NProfiling { ui32 MakeTags(const TVector<const char*>& ss); const char* GetTag(ui32 tag); - size_t GetTagsCount(); - - using TSetThreadAllocTag = ui32(ui32 tag); - extern TSetThreadAllocTag* SetThreadAllocTag; + size_t GetTagsCount(); + using TSetThreadAllocTag = ui32(ui32 tag); + extern TSetThreadAllocTag* SetThreadAllocTag; + class TMemoryTagScope { public: explicit TMemoryTagScope(ui32 tag) - : RestoreTag(SetThreadAllocTag(tag)) + : RestoreTag(SetThreadAllocTag(tag)) { } - + explicit TMemoryTagScope(const char* tagName) { ui32 newTag = MakeTag(tagName); - RestoreTag = SetThreadAllocTag(newTag); + RestoreTag = SetThreadAllocTag(newTag); } TMemoryTagScope(TMemoryTagScope&& move) @@ -47,20 +47,20 @@ namespace NProfiling { } static void Reset(ui32 tag) { - SetThreadAllocTag(tag); + SetThreadAllocTag(tag); } void Release() { if (!Released) { - SetThreadAllocTag(RestoreTag); + SetThreadAllocTag(RestoreTag); Released = true; } } - ~TMemoryTagScope() { + ~TMemoryTagScope() { if (!Released) { - SetThreadAllocTag(RestoreTag); - } + SetThreadAllocTag(RestoreTag); + } } protected: diff --git a/library/cpp/actors/prof/ya.make b/library/cpp/actors/prof/ya.make index b5e2497563..4d15d4e962 100644 --- a/library/cpp/actors/prof/ya.make +++ b/library/cpp/actors/prof/ya.make @@ -14,15 +14,15 @@ PEERDIR( library/cpp/containers/atomizer ) -IF (PROFILE_MEMORY_ALLOCATIONS) +IF (PROFILE_MEMORY_ALLOCATIONS) CFLAGS(-DPROFILE_MEMORY_ALLOCATIONS) - PEERDIR( + PEERDIR( library/cpp/malloc/api library/cpp/lfalloc/dbg_info library/cpp/ytalloc/api - ) -ENDIF() - + ) +ENDIF() + IF(ALLOCATOR == "TCMALLOC_256K") SRCS(tcmalloc.cpp) PEERDIR(contrib/libs/tcmalloc) diff --git a/library/cpp/actors/util/funnel_queue.h b/library/cpp/actors/util/funnel_queue.h index 0e21e2617c..d91a8a711b 100644 --- a/library/cpp/actors/util/funnel_queue.h +++ b/library/cpp/actors/util/funnel_queue.h @@ -22,7 +22,7 @@ public: Push(ElementType&& element) noexcept { TEntry* const next = NewEntry(static_cast<ElementType&&>(element)); TEntry* const prev = AtomicSwap(&Back, next); - AtomicSet(prev ? prev->Next : Front, next); + AtomicSet(prev ? prev->Next : Front, next); return !prev; } @@ -52,7 +52,7 @@ public: /// Peek top element. Must be used only from one thread. ElementType& Top() const noexcept { - return AtomicGet(Front)->Data; + return AtomicGet(Front)->Data; } bool @@ -191,8 +191,8 @@ private: protected: virtual typename TBase::TEntry* NewEntry(ElementType&& element) noexcept override { - while (const auto top = AtomicGet(Stack)) - if (AtomicCas(&Stack, top->Next, top)) { + while (const auto top = AtomicGet(Stack)) + if (AtomicCas(&Stack, top->Next, top)) { top->Data = static_cast<ElementType&&>(element); AtomicSet(top->Next, nullptr); return top; @@ -206,7 +206,7 @@ protected: const auto next = entry->Next; do AtomicSet(entry->Next, AtomicGet(Stack)); - while (!AtomicCas(&Stack, entry, entry->Next)); + while (!AtomicCas(&Stack, entry, entry->Next)); return next; } }; diff --git a/library/cpp/actors/wilson/wilson_event.h b/library/cpp/actors/wilson/wilson_event.h index 7d89c33b51..527710da13 100644 --- a/library/cpp/actors/wilson/wilson_event.h +++ b/library/cpp/actors/wilson/wilson_event.h @@ -114,7 +114,7 @@ namespace NWilson { // generate wilson event having parent TRACE_ID and span TRACE_ID to become parent of logged event #define WILSON_TRACE(CTX, TRACE_ID, EVENT_NAME, ...) \ - if (::NWilson::TraceEnabled(CTX)) { \ + if (::NWilson::TraceEnabled(CTX)) { \ ::NWilson::TTraceId* __traceId = (TRACE_ID); \ if (__traceId && *__traceId) { \ TInstant now = Now(); \ @@ -123,7 +123,7 @@ namespace NWilson { __UNROLL_PARAMS(__FILL_PARAM, ##__VA_ARGS__) \ ::NWilson::TraceEvent((CTX), __traceId, event, now); \ } \ - } + } inline ui32 GetNodeId(const NActors::TActorSystem& actorSystem) { return actorSystem.NodeId; @@ -133,13 +133,13 @@ namespace NWilson { } constexpr ui32 WilsonComponentId = 430; // kikimrservices: wilson - - template <typename TActorSystem> - bool TraceEnabled(const TActorSystem& ctx) { - const auto* loggerSettings = ctx.LoggerSettings(); + + template <typename TActorSystem> + bool TraceEnabled(const TActorSystem& ctx) { + const auto* loggerSettings = ctx.LoggerSettings(); return loggerSettings && loggerSettings->Satisfies(NActors::NLog::PRI_DEBUG, WilsonComponentId); - } - + } + template <typename TActorSystem, typename TEvent> void TraceEvent(const TActorSystem& actorSystem, TTraceId* traceId, TEvent&& event, TInstant timestamp) { // ensure that we are not using obsolete TraceId |