aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/lwtrace/example4
diff options
context:
space:
mode:
authorCthulhu <cthulhu@yandex-team.ru>2022-02-10 16:47:44 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:44 +0300
commitbcb3e9d0eb2a8188a6a9fe0907a8949ce4881a4e (patch)
tree09f7d6526ac5428ea224cd3cf7bd79809d8e6a07 /library/cpp/lwtrace/example4
parent7b82c914c2f468dd50a208ff6a00d38ee7f0018f (diff)
downloadydb-bcb3e9d0eb2a8188a6a9fe0907a8949ce4881a4e.tar.gz
Restoring authorship annotation for Cthulhu <cthulhu@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/lwtrace/example4')
-rw-r--r--library/cpp/lwtrace/example4/example_query.tr18
-rw-r--r--library/cpp/lwtrace/example4/lwtrace_example4.cpp66
-rwxr-xr-xlibrary/cpp/lwtrace/example4/start_with_query.sh4
-rw-r--r--library/cpp/lwtrace/example4/ya.make18
4 files changed, 53 insertions, 53 deletions
diff --git a/library/cpp/lwtrace/example4/example_query.tr b/library/cpp/lwtrace/example4/example_query.tr
index 46cd25ce91a..73f28b71233 100644
--- a/library/cpp/lwtrace/example4/example_query.tr
+++ b/library/cpp/lwtrace/example4/example_query.tr
@@ -1,10 +1,10 @@
-Blocks {
- ProbeDesc {
+Blocks {
+ ProbeDesc {
Name: "BackTrack"
- Provider: "LWTRACE_EXAMPLE_PROVIDER"
- }
- Action {
- PrintToStderrAction { }
- }
-}
-
+ Provider: "LWTRACE_EXAMPLE_PROVIDER"
+ }
+ Action {
+ PrintToStderrAction { }
+ }
+}
+
diff --git a/library/cpp/lwtrace/example4/lwtrace_example4.cpp b/library/cpp/lwtrace/example4/lwtrace_example4.cpp
index 7b55a07c75d..b2b23b10966 100644
--- a/library/cpp/lwtrace/example4/lwtrace_example4.cpp
+++ b/library/cpp/lwtrace/example4/lwtrace_example4.cpp
@@ -1,49 +1,49 @@
#include <library/cpp/lwtrace/all.h>
-
+
#define LWTRACE_EXAMPLE_PROVIDER(PROBE, EVENT, GROUPS, TYPES, NAMES) \
PROBE(BackTrack, GROUPS(), TYPES(NLWTrace::TSymbol), NAMES("frame")) \
- /**/
-
-LWTRACE_DECLARE_PROVIDER(LWTRACE_EXAMPLE_PROVIDER)
-LWTRACE_DEFINE_PROVIDER(LWTRACE_EXAMPLE_PROVIDER)
-
+ /**/
+
+LWTRACE_DECLARE_PROVIDER(LWTRACE_EXAMPLE_PROVIDER)
+LWTRACE_DEFINE_PROVIDER(LWTRACE_EXAMPLE_PROVIDER)
+
LWTRACE_USING(LWTRACE_EXAMPLE_PROVIDER);
#define MY_BACKTRACK() LWPROBE(BackTrack, LWTRACE_LOCATION_SYMBOL)
-void InitLWTrace() {
- NLWTrace::StartLwtraceFromEnv();
-}
-
+void InitLWTrace() {
+ NLWTrace::StartLwtraceFromEnv();
+}
+
long double Fact(int n) {
MY_BACKTRACK();
- if (n < 0) {
+ if (n < 0) {
MY_BACKTRACK();
- ythrow yexception() << "N! is undefined for negative N (" << n << ")";
- }
- double result = 1;
- for (; n > 1; --n) {
+ ythrow yexception() << "N! is undefined for negative N (" << n << ")";
+ }
+ double result = 1;
+ for (; n > 1; --n) {
MY_BACKTRACK();
- result *= n;
- }
+ result *= n;
+ }
MY_BACKTRACK();
- return result;
-}
-
-void FactorialCalculator() {
+ return result;
+}
+
+void FactorialCalculator() {
MY_BACKTRACK();
- i32 n;
- Cout << "Enter a number: ";
+ i32 n;
+ Cout << "Enter a number: ";
TString str;
- Cin >> n;
- double factN = Fact(n);
- Cout << n << "! = " << factN << Endl << Endl;
-}
-
-int main() {
- InitLWTrace();
+ Cin >> n;
+ double factN = Fact(n);
+ Cout << n << "! = " << factN << Endl << Endl;
+}
+
+int main() {
+ InitLWTrace();
MY_BACKTRACK();
- FactorialCalculator();
+ FactorialCalculator();
MY_BACKTRACK();
- return 0;
-}
+ return 0;
+}
diff --git a/library/cpp/lwtrace/example4/start_with_query.sh b/library/cpp/lwtrace/example4/start_with_query.sh
index 5bc195c1ae7..09079b0a31a 100755
--- a/library/cpp/lwtrace/example4/start_with_query.sh
+++ b/library/cpp/lwtrace/example4/start_with_query.sh
@@ -1,3 +1,3 @@
-#!/bin/bash
-export LWTRACE="example_query.tr"
+#!/bin/bash
+export LWTRACE="example_query.tr"
./lwtrace-example4
diff --git a/library/cpp/lwtrace/example4/ya.make b/library/cpp/lwtrace/example4/ya.make
index a3004340a89..efc9413906d 100644
--- a/library/cpp/lwtrace/example4/ya.make
+++ b/library/cpp/lwtrace/example4/ya.make
@@ -1,13 +1,13 @@
PROGRAM(lwtrace-example4)
-
+
OWNER(serxa)
-
-SRCS(
+
+SRCS(
lwtrace_example4.cpp
-)
-
-PEERDIR(
+)
+
+PEERDIR(
library/cpp/lwtrace
-)
-
-END()
+)
+
+END()