aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/lwtrace
diff options
context:
space:
mode:
authornga <nga@yandex-team.ru>2022-02-10 16:48:09 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:09 +0300
commit1f553f46fb4f3c5eec631352cdd900a0709016af (patch)
treea231fba2c03b440becaea6c86a2702d0bfb0336e /library/cpp/lwtrace
parentc4de7efdedc25b49cbea74bd589eecb61b55b60a (diff)
downloadydb-1f553f46fb4f3c5eec631352cdd900a0709016af.tar.gz
Restoring authorship annotation for <nga@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/lwtrace')
-rw-r--r--library/cpp/lwtrace/all.h2
-rw-r--r--library/cpp/lwtrace/kill_action.cpp32
-rw-r--r--library/cpp/lwtrace/kill_action.h10
-rw-r--r--library/cpp/lwtrace/preprocessor.h14
-rw-r--r--library/cpp/lwtrace/protos/lwtrace.proto6
-rw-r--r--library/cpp/lwtrace/protos/ya.make2
-rw-r--r--library/cpp/lwtrace/start.cpp36
-rw-r--r--library/cpp/lwtrace/start.h12
-rw-r--r--library/cpp/lwtrace/stderr_writer.cpp20
-rw-r--r--library/cpp/lwtrace/stderr_writer.h16
-rw-r--r--library/cpp/lwtrace/ya.make2
11 files changed, 76 insertions, 76 deletions
diff --git a/library/cpp/lwtrace/all.h b/library/cpp/lwtrace/all.h
index d7aa57c49d..0b286ceb95 100644
--- a/library/cpp/lwtrace/all.h
+++ b/library/cpp/lwtrace/all.h
@@ -4,7 +4,7 @@
#include "event.h"
#include "preprocessor.h"
#include "probe.h"
-#include "start.h"
+#include "start.h"
//
// Full documentation: https://wiki.yandex-team.ru/development/poisk/arcadia/library/lwtrace/
diff --git a/library/cpp/lwtrace/kill_action.cpp b/library/cpp/lwtrace/kill_action.cpp
index 2b74dc4587..cd3316e90d 100644
--- a/library/cpp/lwtrace/kill_action.cpp
+++ b/library/cpp/lwtrace/kill_action.cpp
@@ -1,21 +1,21 @@
#include "kill_action.h"
-
-#ifndef _win_
-#include <sys/types.h>
-#include <signal.h>
-#endif
-
+
+#ifndef _win_
+#include <sys/types.h>
+#include <signal.h>
+#endif
+
#include <stdlib.h>
-
-using namespace NLWTrace;
-using namespace NLWTrace::NPrivate;
-
+
+using namespace NLWTrace;
+using namespace NLWTrace::NPrivate;
+
bool TKillActionExecutor::DoExecute(TOrbit&, const TParams&) {
-#ifdef _win_
- abort();
-#else
- int r = kill(getpid(), SIGABRT);
+#ifdef _win_
+ abort();
+#else
+ int r = kill(getpid(), SIGABRT);
Y_VERIFY(r == 0, "kill failed");
return true;
-#endif
-}
+#endif
+}
diff --git a/library/cpp/lwtrace/kill_action.h b/library/cpp/lwtrace/kill_action.h
index 14da9ffd50..16cc6b1a76 100644
--- a/library/cpp/lwtrace/kill_action.h
+++ b/library/cpp/lwtrace/kill_action.h
@@ -1,7 +1,7 @@
-#pragma once
-
-#include "probe.h"
-
+#pragma once
+
+#include "probe.h"
+
namespace NLWTrace {
namespace NPrivate {
class TKillActionExecutor: public IExecutor {
@@ -10,6 +10,6 @@ namespace NLWTrace {
}
bool DoExecute(TOrbit& orbit, const TParams& params) override;
};
-
+
}
}
diff --git a/library/cpp/lwtrace/preprocessor.h b/library/cpp/lwtrace/preprocessor.h
index 40865467b2..ca6559aac8 100644
--- a/library/cpp/lwtrace/preprocessor.h
+++ b/library/cpp/lwtrace/preprocessor.h
@@ -3,18 +3,18 @@
#include "check.h"
#include "perf.h"
#include "symbol.h"
-
+
#include <util/generic/hide_ptr.h>
#include <util/system/platform.h>
#include <stddef.h> //size_t
-#ifdef _win_
-#ifndef LWTRACE_DISABLE
-#define LWTRACE_DISABLE
-#endif // LWTRACE_DISABLE
-#endif // _win_
-
+#ifdef _win_
+#ifndef LWTRACE_DISABLE
+#define LWTRACE_DISABLE
+#endif // LWTRACE_DISABLE
+#endif // _win_
+
// Maximum number of executors that can be attached to a probe
#define LWTRACE_MAX_ACTIONS 100
diff --git a/library/cpp/lwtrace/protos/lwtrace.proto b/library/cpp/lwtrace/protos/lwtrace.proto
index 0051095719..74890b1952 100644
--- a/library/cpp/lwtrace/protos/lwtrace.proto
+++ b/library/cpp/lwtrace/protos/lwtrace.proto
@@ -44,9 +44,9 @@ message TLogAction {
uint32 MaxRecords = 4; // Do not write more than MaxRecords records to the log (count from the trace beginning, not start)
}
-message TPrintToStderrAction {
-}
-
+message TPrintToStderrAction {
+}
+
message TKillAction {
}
diff --git a/library/cpp/lwtrace/protos/ya.make b/library/cpp/lwtrace/protos/ya.make
index 503d5e515f..1b9fd06c75 100644
--- a/library/cpp/lwtrace/protos/ya.make
+++ b/library/cpp/lwtrace/protos/ya.make
@@ -5,7 +5,7 @@ OWNER(serxa)
INCLUDE_TAGS(GO_PROTO)
SRCS(
- lwtrace.proto
+ lwtrace.proto
)
END()
diff --git a/library/cpp/lwtrace/start.cpp b/library/cpp/lwtrace/start.cpp
index 121d5472b6..1dd231ccea 100644
--- a/library/cpp/lwtrace/start.cpp
+++ b/library/cpp/lwtrace/start.cpp
@@ -1,19 +1,19 @@
#include "start.h"
-
+
#include "all.h"
#include <google/protobuf/text_format.h>
-
-#include <util/generic/singleton.h>
-#include <util/stream/file.h>
+
+#include <util/generic/singleton.h>
+#include <util/stream/file.h>
#include <util/stream/output.h>
#include <util/system/env.h>
-
+
#include <stdlib.h>
-
-using namespace NLWTrace;
-
-namespace {
+
+using namespace NLWTrace;
+
+namespace {
struct TTraceManagerHolder {
TManager TraceManager;
TTraceManagerHolder()
@@ -42,16 +42,16 @@ void NLWTrace::StartLwtraceFromEnv() {
TString path = GetEnv("LWTRACE");
if (!path) {
- return;
- }
-
- try {
+ return;
+ }
+
+ try {
TraceFromEnv(path);
- } catch (...) {
- Cerr << "failed to load lwtrace script: " << CurrentExceptionMessage() << "\n";
- abort();
- }
-}
+ } catch (...) {
+ Cerr << "failed to load lwtrace script: " << CurrentExceptionMessage() << "\n";
+ abort();
+ }
+}
void NLWTrace::StartLwtraceFromEnv(std::function<void(TManager&)> prepare) {
TString path = GetEnv("LWTRACE");
diff --git a/library/cpp/lwtrace/start.h b/library/cpp/lwtrace/start.h
index 2755212bff..4c360f4625 100644
--- a/library/cpp/lwtrace/start.h
+++ b/library/cpp/lwtrace/start.h
@@ -1,11 +1,11 @@
-#pragma once
-
+#pragma once
+
#include <functional>
-namespace NLWTrace {
+namespace NLWTrace {
class TManager;
-
+
void StartLwtraceFromEnv();
void StartLwtraceFromEnv(std::function<void(TManager&)> prepare);
-
-}
+
+}
diff --git a/library/cpp/lwtrace/stderr_writer.cpp b/library/cpp/lwtrace/stderr_writer.cpp
index 6e5654c338..8d635d42f6 100644
--- a/library/cpp/lwtrace/stderr_writer.cpp
+++ b/library/cpp/lwtrace/stderr_writer.cpp
@@ -1,19 +1,19 @@
-#include "stderr_writer.h"
+#include "stderr_writer.h"
#include <util/stream/str.h>
-
-using namespace NLWTrace;
-
+
+using namespace NLWTrace;
+
bool TStderrActionExecutor::DoExecute(TOrbit&, const TParams& params) {
TString ParamValues[LWTRACE_MAX_PARAMS];
- Probe->Event.Signature.SerializeParams(params, ParamValues);
-
+ Probe->Event.Signature.SerializeParams(params, ParamValues);
+
TStringStream ss;
ss << Probe->Event.GetProvider() << "." << Probe->Event.Name;
- for (ui32 i = 0; i < Probe->Event.Signature.ParamCount; ++i) {
+ for (ui32 i = 0; i < Probe->Event.Signature.ParamCount; ++i) {
ss << " " << Probe->Event.Signature.ParamNames[i] << "=" << ParamValues[i];
- }
+ }
ss << "\n";
Cerr << ss.Str();
- return true;
-}
+ return true;
+}
diff --git a/library/cpp/lwtrace/stderr_writer.h b/library/cpp/lwtrace/stderr_writer.h
index b17fc3136e..b1375cbd27 100644
--- a/library/cpp/lwtrace/stderr_writer.h
+++ b/library/cpp/lwtrace/stderr_writer.h
@@ -1,19 +1,19 @@
-#pragma once
-
-#include "probe.h"
-
-namespace NLWTrace {
+#pragma once
+
+#include "probe.h"
+
+namespace NLWTrace {
class TStderrActionExecutor: public IExecutor {
private:
TProbe* const Probe;
-
+
public:
explicit TStderrActionExecutor(TProbe* probe)
: Probe(probe)
{
}
-
+
bool DoExecute(TOrbit& orbit, const TParams& params) override;
};
-}
+}
diff --git a/library/cpp/lwtrace/ya.make b/library/cpp/lwtrace/ya.make
index d9accb3006..fb7b59629b 100644
--- a/library/cpp/lwtrace/ya.make
+++ b/library/cpp/lwtrace/ya.make
@@ -10,7 +10,7 @@ SRCS(
check.cpp
control.cpp
custom_action.cpp
- kill_action.cpp
+ kill_action.cpp
log_shuttle.cpp
perf.cpp
probes.cpp