aboutsummaryrefslogtreecommitdiffstats
path: root/util/system
diff options
context:
space:
mode:
authorhalin-george <halin-george@yandex-team.ru>2022-02-10 16:50:07 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:07 +0300
commit7c7a0655bcf00449b1fcacc2c658cc4d5c3aca7b (patch)
tree41c83fd863c44839297aff8b2c301ec6b1853244 /util/system
parent811ece47d06924d20a94f89d1b0f5cd37254a49c (diff)
downloadydb-7c7a0655bcf00449b1fcacc2c658cc4d5c3aca7b.tar.gz
Restoring authorship annotation for <halin-george@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system')
-rw-r--r--util/system/context.cpp2
-rw-r--r--util/system/context.h2
-rw-r--r--util/system/sanitizers.cpp56
-rw-r--r--util/system/sanitizers.h10
4 files changed, 35 insertions, 35 deletions
diff --git a/util/system/context.cpp b/util/system/context.cpp
index ad99309088..4326e5cd6b 100644
--- a/util/system/context.cpp
+++ b/util/system/context.cpp
@@ -140,7 +140,7 @@ TContMachineContext::TSan::TSan() noexcept
}
TContMachineContext::TSan::TSan(const TContClosure& c) noexcept
- : NSan::TFiberContext(c.Stack.data(), c.Stack.size(), c.ContName)
+ : NSan::TFiberContext(c.Stack.data(), c.Stack.size(), c.ContName)
, TL(c.TrampoLine)
{
}
diff --git a/util/system/context.h b/util/system/context.h
index d2a349bfc5..6f52a42e0b 100644
--- a/util/system/context.h
+++ b/util/system/context.h
@@ -54,7 +54,7 @@ struct ITrampoLine {
struct TContClosure {
ITrampoLine* TrampoLine;
TArrayRef<char> Stack;
- const char* ContName = nullptr;
+ const char* ContName = nullptr;
};
#if defined(USE_UCONTEXT_CONT)
diff --git a/util/system/sanitizers.cpp b/util/system/sanitizers.cpp
index bb799a9e2e..5fa80de4f1 100644
--- a/util/system/sanitizers.cpp
+++ b/util/system/sanitizers.cpp
@@ -8,17 +8,17 @@ extern "C" {
}
#endif
-#if defined(_tsan_enabled_)
+#if defined(_tsan_enabled_)
#if defined(__clang_major__) && (__clang_major__ >= 9)
-extern "C" {
+extern "C" {
void* __tsan_get_current_fiber(void);
void* __tsan_create_fiber(unsigned flags);
void __tsan_destroy_fiber(void* fiber);
void __tsan_switch_to_fiber(void* fiber, unsigned flags);
void __tsan_set_fiber_name(void* fiber, const char* name);
-}
+}
#else
-namespace {
+namespace {
void* __tsan_get_current_fiber(void) {
return nullptr;
}
@@ -31,43 +31,43 @@ namespace {
}
void __tsan_set_fiber_name(void*, const char*) {
}
-}
+}
#endif
-#endif
-
+#endif
+
using namespace NSan;
TFiberContext::TFiberContext() noexcept
: Token_(nullptr)
, IsMainFiber_(true)
-#if defined(_tsan_enabled_)
- , CurrentTSanFiberContext_(__tsan_get_current_fiber())
-#endif
+#if defined(_tsan_enabled_)
+ , CurrentTSanFiberContext_(__tsan_get_current_fiber())
+#endif
{
TCurrentThreadLimits sl;
Stack_ = sl.StackBegin;
Len_ = sl.StackLength;
-
-#if defined(_tsan_enabled_)
- static constexpr char MainFiberName[] = "main_fiber";
- __tsan_set_fiber_name(CurrentTSanFiberContext_, MainFiberName);
-#endif
+
+#if defined(_tsan_enabled_)
+ static constexpr char MainFiberName[] = "main_fiber";
+ __tsan_set_fiber_name(CurrentTSanFiberContext_, MainFiberName);
+#endif
}
-TFiberContext::TFiberContext(const void* stack, size_t len, const char* contName) noexcept
+TFiberContext::TFiberContext(const void* stack, size_t len, const char* contName) noexcept
: Token_(nullptr)
, Stack_(stack)
, Len_(len)
, IsMainFiber_(false)
-#if defined(_tsan_enabled_)
+#if defined(_tsan_enabled_)
, CurrentTSanFiberContext_(__tsan_create_fiber(/*flags =*/0))
-#endif
+#endif
{
- (void)contName;
-#if defined(_tsan_enabled_)
- __tsan_set_fiber_name(CurrentTSanFiberContext_, contName);
-#endif
+ (void)contName;
+#if defined(_tsan_enabled_)
+ __tsan_set_fiber_name(CurrentTSanFiberContext_, contName);
+#endif
}
TFiberContext::~TFiberContext() noexcept {
@@ -84,10 +84,10 @@ TFiberContext::~TFiberContext() noexcept {
__sanitizer_finish_switch_fiber(activeFakeStack, nullptr, nullptr);
}
#endif
-#if defined(_tsan_enabled_)
- __tsan_destroy_fiber(CurrentTSanFiberContext_);
+#if defined(_tsan_enabled_)
+ __tsan_destroy_fiber(CurrentTSanFiberContext_);
#endif
- }
+ }
}
void TFiberContext::BeforeFinish() noexcept {
@@ -106,10 +106,10 @@ void TFiberContext::BeforeSwitch(TFiberContext* old) noexcept {
#else
(void)old;
#endif
-
-#if defined(_tsan_enabled_)
+
+#if defined(_tsan_enabled_)
__tsan_switch_to_fiber(CurrentTSanFiberContext_, /*flags =*/0);
-#endif
+#endif
}
void TFiberContext::AfterSwitch() noexcept {
diff --git a/util/system/sanitizers.h b/util/system/sanitizers.h
index 965e5c751e..315d461bc2 100644
--- a/util/system/sanitizers.h
+++ b/util/system/sanitizers.h
@@ -20,7 +20,7 @@ namespace NSan {
class TFiberContext {
public:
TFiberContext() noexcept;
- TFiberContext(const void* stack, size_t len, const char* contName) noexcept;
+ TFiberContext(const void* stack, size_t len, const char* contName) noexcept;
~TFiberContext() noexcept;
@@ -34,11 +34,11 @@ namespace NSan {
void* Token_;
const void* Stack_;
size_t Len_;
-
+
const bool IsMainFiber_;
-#if defined(_tsan_enabled_)
- void* const CurrentTSanFiberContext_;
-#endif
+#if defined(_tsan_enabled_)
+ void* const CurrentTSanFiberContext_;
+#endif
};
// Returns plain if no sanitizer enabled or sanitized otherwise