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 | 4d8b546b89b5afc08cf3667e176271c7ba935f33 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/lfalloc/alloc_profiler/profiler.h | |
parent | 4e4b78bd7b67e2533da4dbb9696374a6d6068e32 (diff) | |
download | ydb-4d8b546b89b5afc08cf3667e176271c7ba935f33.tar.gz |
Restoring authorship annotation for <vskipin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/lfalloc/alloc_profiler/profiler.h')
-rw-r--r-- | library/cpp/lfalloc/alloc_profiler/profiler.h | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/library/cpp/lfalloc/alloc_profiler/profiler.h b/library/cpp/lfalloc/alloc_profiler/profiler.h index 0cd816fa03..4ea49b9dcc 100644 --- a/library/cpp/lfalloc/alloc_profiler/profiler.h +++ b/library/cpp/lfalloc/alloc_profiler/profiler.h @@ -1,45 +1,45 @@ -#pragma once - +#pragma once + #include "stackcollect.h" - + #include <library/cpp/lfalloc/dbg_info/dbg_info.h> - -#include <util/generic/noncopyable.h> + +#include <util/generic/noncopyable.h> #include <util/stream/output.h> - + namespace NAllocProfiler { - -//////////////////////////////////////////////////////////////////////////////// - -inline int SetCurrentScopeTag(int value) -{ - return NAllocDbg::SetThreadAllocTag(value); -} - -inline bool SetProfileCurrentThread(bool value) -{ - return NAllocDbg::SetProfileCurrentThread(value); -} - + +//////////////////////////////////////////////////////////////////////////////// + +inline int SetCurrentScopeTag(int value) +{ + return NAllocDbg::SetThreadAllocTag(value); +} + +inline bool SetProfileCurrentThread(bool value) +{ + return NAllocDbg::SetProfileCurrentThread(value); +} + bool StartAllocationSampling(bool profileAllThreads = false); bool StopAllocationSampling(IAllocationStatsDumper& out, int count = 100); bool StopAllocationSampling(IOutputStream& out, int count = 100); - -//////////////////////////////////////////////////////////////////////////////// - -class TProfilingScope: private TNonCopyable { -private: - const int Prev; - -public: - explicit TProfilingScope(int value) - : Prev(SetCurrentScopeTag(value)) - {} - - ~TProfilingScope() - { - SetCurrentScopeTag(Prev); - } -}; - + +//////////////////////////////////////////////////////////////////////////////// + +class TProfilingScope: private TNonCopyable { +private: + const int Prev; + +public: + explicit TProfilingScope(int value) + : Prev(SetCurrentScopeTag(value)) + {} + + ~TProfilingScope() + { + SetCurrentScopeTag(Prev); + } +}; + } // namespace NAllocProfiler |