diff options
author | qkrorlqr <qkrorlqr@yandex-team.ru> | 2022-02-10 16:47:20 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:20 +0300 |
commit | 9b89266638b10d40309e31dcb7caa2fc52b2aefd (patch) | |
tree | aaf0d6ece270940a4f208e4202e4a37a15ce05b7 /library/cpp/lwtrace/log_shuttle.h | |
parent | 47af3b5bf148ddab250833ec454d30d7c4930c31 (diff) | |
download | ydb-9b89266638b10d40309e31dcb7caa2fc52b2aefd.tar.gz |
Restoring authorship annotation for <qkrorlqr@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/lwtrace/log_shuttle.h')
-rw-r--r-- | library/cpp/lwtrace/log_shuttle.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/library/cpp/lwtrace/log_shuttle.h b/library/cpp/lwtrace/log_shuttle.h index 729a38615fe..49d329c0c21 100644 --- a/library/cpp/lwtrace/log_shuttle.h +++ b/library/cpp/lwtrace/log_shuttle.h @@ -5,8 +5,8 @@ #include <library/cpp/lwtrace/protos/lwtrace.pb.h> -#include <util/system/spinlock.h> - +#include <util/system/spinlock.h> + namespace NLWTrace { template <class TDepot> class TRunLogShuttleActionExecutor; @@ -51,7 +51,7 @@ namespace NLWTrace { TExecutor* Executor; bool Ignore = false; size_t MaxTrackLength; - TAdaptiveLock Lock; + TAdaptiveLock Lock; TAtomic ForkFailed = 0; public: @@ -156,21 +156,21 @@ namespace NLWTrace { template <class TDepot> bool TLogShuttle<TDepot>::DoAddProbe(TProbe* probe, const TParams& params, ui64 timestamp) { - with_lock (Lock) { - if (TrackLog.Items.size() >= MaxTrackLength) { - TrackLog.Truncated = true; - return true; - } - TrackLog.Items.emplace_back(); - TTrackLog::TItem* item = &TrackLog.Items.back(); - item->ThreadId = 0; // TODO[serxa]: check if it is fast to run TThread::CurrentThreadId(); - item->Probe = probe; - if ((item->SavedParamsCount = probe->Event.Signature.ParamCount) > 0) { - probe->Event.Signature.CloneParams(item->Params, params); - } + with_lock (Lock) { + if (TrackLog.Items.size() >= MaxTrackLength) { + TrackLog.Truncated = true; + return true; + } + TrackLog.Items.emplace_back(); + TTrackLog::TItem* item = &TrackLog.Items.back(); + item->ThreadId = 0; // TODO[serxa]: check if it is fast to run TThread::CurrentThreadId(); + item->Probe = probe; + if ((item->SavedParamsCount = probe->Event.Signature.ParamCount) > 0) { + probe->Event.Signature.CloneParams(item->Params, params); + } item->TimestampCycles = timestamp ? timestamp : GetCycleCount(); } - + return true; } |