aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/lwtrace
diff options
context:
space:
mode:
authorilnurkh <ilnurkh@yandex-team.com>2023-10-09 23:39:40 +0300
committerilnurkh <ilnurkh@yandex-team.com>2023-10-09 23:57:14 +0300
commite601ca03f859335d57ecff2e5aa6af234b6052ed (patch)
treede519a847e58a1b3993fcbfe05ff44cc946a3e24 /library/cpp/lwtrace
parentbbf2b6878af3854815a2c0ecb07a687071787639 (diff)
downloadydb-e601ca03f859335d57ecff2e5aa6af234b6052ed.tar.gz
Y_VERIFY->Y_ABORT_UNLESS at ^l
https://clubs.at.yandex-team.ru/arcadia/29404
Diffstat (limited to 'library/cpp/lwtrace')
-rw-r--r--library/cpp/lwtrace/example3/my_action.h2
-rw-r--r--library/cpp/lwtrace/kill_action.cpp2
-rw-r--r--library/cpp/lwtrace/lwprobe.h12
-rw-r--r--library/cpp/lwtrace/mon/analytics/data.h8
-rw-r--r--library/cpp/lwtrace/shuttle.h2
-rw-r--r--library/cpp/lwtrace/start.cpp2
-rw-r--r--library/cpp/lwtrace/trace.cpp2
7 files changed, 15 insertions, 15 deletions
diff --git a/library/cpp/lwtrace/example3/my_action.h b/library/cpp/lwtrace/example3/my_action.h
index 9a04293ba2..a8185ab9da 100644
--- a/library/cpp/lwtrace/example3/my_action.h
+++ b/library/cpp/lwtrace/example3/my_action.h
@@ -33,7 +33,7 @@ public:
// Outputs a line to opened file
// Can be called from DoExecute() and must be thread-safe
void Output(const TString& line) {
- Y_VERIFY(File);
+ Y_ABORT_UNLESS(File);
TGuard<TMutex> g(Mutex); // Because DoExecute() call can come from any thread
*File << line << Endl;
}
diff --git a/library/cpp/lwtrace/kill_action.cpp b/library/cpp/lwtrace/kill_action.cpp
index 2b74dc4587..124cc5f15a 100644
--- a/library/cpp/lwtrace/kill_action.cpp
+++ b/library/cpp/lwtrace/kill_action.cpp
@@ -15,7 +15,7 @@ bool TKillActionExecutor::DoExecute(TOrbit&, const TParams&) {
abort();
#else
int r = kill(getpid(), SIGABRT);
- Y_VERIFY(r == 0, "kill failed");
+ Y_ABORT_UNLESS(r == 0, "kill failed");
return true;
#endif
}
diff --git a/library/cpp/lwtrace/lwprobe.h b/library/cpp/lwtrace/lwprobe.h
index 801fc3861b..ca6e4eaf39 100644
--- a/library/cpp/lwtrace/lwprobe.h
+++ b/library/cpp/lwtrace/lwprobe.h
@@ -33,28 +33,28 @@ namespace NLWTrace {
probe.Init();
// initialize TEvent
- Y_VERIFY(IsCppIdentifier(Name), "probe '%s' is not C++ identifier", Name.data());
- Y_VERIFY(IsCppIdentifier(Provider), "provider '%s' is not C++ identifier in probe %s", Provider.data(), Name.data());
+ Y_ABORT_UNLESS(IsCppIdentifier(Name), "probe '%s' is not C++ identifier", Name.data());
+ Y_ABORT_UNLESS(IsCppIdentifier(Provider), "provider '%s' is not C++ identifier in probe %s", Provider.data(), Name.data());
probe.Event.Name = Name.c_str();
Zero(probe.Event.Groups);
probe.Event.Groups[0] = Provider.c_str();
auto i = Groups.begin(), ie = Groups.end();
- Y_VERIFY(Groups.size() < LWTRACE_MAX_GROUPS, "too many groups in probe %s", Name.data());
+ Y_ABORT_UNLESS(Groups.size() < LWTRACE_MAX_GROUPS, "too many groups in probe %s", Name.data());
for (size_t n = 1; n < LWTRACE_MAX_GROUPS && i != ie; n++, ++i) {
- Y_VERIFY(IsCppIdentifier(*i), "group '%s' is not C++ identifier in probe %s", i->data(), Name.data());
+ Y_ABORT_UNLESS(IsCppIdentifier(*i), "group '%s' is not C++ identifier in probe %s", i->data(), Name.data());
probe.Event.Groups[n] = i->c_str();
}
// initialize TSignature
using TUsrSign = TUserSignature<LWTRACE_TEMPLATE_ARGS>;
- Y_VERIFY(TUsrSign::ParamCount == (int)Params.size(), "param count mismatch in probe %s: %d != %d",
+ Y_ABORT_UNLESS(TUsrSign::ParamCount == (int)Params.size(), "param count mismatch in probe %s: %d != %d",
Name.data(), int(Params.size()), TUsrSign::ParamCount);
TSignature& signature = probe.Event.Signature;
signature.ParamTypes = TUsrSign::ParamTypes;
Zero(signature.ParamNames);
auto j = Params.begin(), je = Params.end();
for (size_t n = 0; n < LWTRACE_MAX_PARAMS && j != je; n++, ++j) {
- Y_VERIFY(IsCppIdentifier(*j), "param '%s' is not C++ identifier in probe %s", j->data(), Name.data());
+ Y_ABORT_UNLESS(IsCppIdentifier(*j), "param '%s' is not C++ identifier in probe %s", j->data(), Name.data());
signature.ParamNames[n] = j->c_str();
}
signature.ParamCount = TUsrSign::ParamCount;
diff --git a/library/cpp/lwtrace/mon/analytics/data.h b/library/cpp/lwtrace/mon/analytics/data.h
index 4b643fe20b..281b246d34 100644
--- a/library/cpp/lwtrace/mon/analytics/data.h
+++ b/library/cpp/lwtrace/mon/analytics/data.h
@@ -83,15 +83,15 @@ struct TMatrix : public TVector<double> {
double& Cell(size_t row, size_t col)
{
- Y_VERIFY(row < Rows);
- Y_VERIFY(col < Cols);
+ Y_ABORT_UNLESS(row < Rows);
+ Y_ABORT_UNLESS(col < Cols);
return operator[](row * Cols + col);
}
double Cell(size_t row, size_t col) const
{
- Y_VERIFY(row < Rows);
- Y_VERIFY(col < Cols);
+ Y_ABORT_UNLESS(row < Rows);
+ Y_ABORT_UNLESS(col < Cols);
return operator[](row * Cols + col);
}
diff --git a/library/cpp/lwtrace/shuttle.h b/library/cpp/lwtrace/shuttle.h
index d8e0987c35..c3e31a8223 100644
--- a/library/cpp/lwtrace/shuttle.h
+++ b/library/cpp/lwtrace/shuttle.h
@@ -205,7 +205,7 @@ namespace NLWTrace {
void AddShuttle(const TShuttlePtr& shuttle) {
NotConcurrent([&] (TShuttlePtr& head) {
- Y_VERIFY(!shuttle->GetNext());
+ Y_ABORT_UNLESS(!shuttle->GetNext());
shuttle->SetNext(head);
head = shuttle;
});
diff --git a/library/cpp/lwtrace/start.cpp b/library/cpp/lwtrace/start.cpp
index 121d5472b6..e4bb6e13c8 100644
--- a/library/cpp/lwtrace/start.cpp
+++ b/library/cpp/lwtrace/start.cpp
@@ -26,7 +26,7 @@ namespace {
TString script = TUnbufferedFileInput(path).ReadAll();
TQuery query;
bool ok = google::protobuf::TextFormat::ParseFromString(script, &query);
- Y_VERIFY(ok, "failed to parse protobuf");
+ Y_ABORT_UNLESS(ok, "failed to parse protobuf");
Singleton<TTraceManagerHolder>()->TraceManager.New("env", query);
}
diff --git a/library/cpp/lwtrace/trace.cpp b/library/cpp/lwtrace/trace.cpp
index 3c974c85a0..76e64a3025 100644
--- a/library/cpp/lwtrace/trace.cpp
+++ b/library/cpp/lwtrace/trace.cpp
@@ -50,7 +50,7 @@ namespace NLWTrace {
return; // silently skip probe double registration
}
TIds::key_type key(probe->Event.GetProvider(), probe->Event.Name);
- Y_VERIFY(Ids.count(key) == 0, "duplicate provider:probe pair %s:%s", key.first.data(), key.second.data());
+ Y_ABORT_UNLESS(Ids.count(key) == 0, "duplicate provider:probe pair %s:%s", key.first.data(), key.second.data());
Probes.emplace(probe, box);
Ids.insert(key);
}