diff options
author | serxa <serxa@yandex-team.ru> | 2022-02-10 16:49:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:08 +0300 |
commit | d6d7db348c2cc64e71243cab9940ee6778f4317d (patch) | |
tree | bac67f42a02f9368eb4d329f5d79b77d0a6adc18 /library/cpp/lwtrace/example5 | |
parent | 8d57b69dee81198a59c39e64704f7dc9f04b4fbf (diff) | |
download | ydb-d6d7db348c2cc64e71243cab9940ee6778f4317d.tar.gz |
Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/lwtrace/example5')
-rw-r--r-- | library/cpp/lwtrace/example5/example_query.tr | 18 | ||||
-rw-r--r-- | library/cpp/lwtrace/example5/lwtrace_example5.cpp | 46 | ||||
-rwxr-xr-x | library/cpp/lwtrace/example5/start_with_query.sh | 6 | ||||
-rw-r--r-- | library/cpp/lwtrace/example5/ya.make | 24 |
4 files changed, 47 insertions, 47 deletions
diff --git a/library/cpp/lwtrace/example5/example_query.tr b/library/cpp/lwtrace/example5/example_query.tr index 90887d4ddf..34f872d7ee 100644 --- a/library/cpp/lwtrace/example5/example_query.tr +++ b/library/cpp/lwtrace/example5/example_query.tr @@ -1,9 +1,9 @@ -Blocks { - ProbeDesc { - Group: "LWTRACE_EXAMPLE_PROVIDER" - } - Action { - PrintToStderrAction { } - } -} - +Blocks { + ProbeDesc { + Group: "LWTRACE_EXAMPLE_PROVIDER" + } + Action { + PrintToStderrAction { } + } +} + diff --git a/library/cpp/lwtrace/example5/lwtrace_example5.cpp b/library/cpp/lwtrace/example5/lwtrace_example5.cpp index 1c324473c2..3a5e3def30 100644 --- a/library/cpp/lwtrace/example5/lwtrace_example5.cpp +++ b/library/cpp/lwtrace/example5/lwtrace_example5.cpp @@ -1,30 +1,30 @@ #include <library/cpp/lwtrace/all.h> #include <library/cpp/lwtrace/lwprobe.h> - -template <ui64 N> -ui64 Fact() { + +template <ui64 N> +ui64 Fact() { ui64 result = N * Fact<N - 1>(); - + #ifndef LWTRACE_DISABLE - // Note that probe is create on the first pass - // LWTRACE_DECLARE_PROVIDER and LWTRACE_DEFINE_PROVIDER are not needed - // (Provider is created implicitly) - static NLWTrace::TLWProbe<ui64> factProbe( - "LWTRACE_EXAMPLE_PROVIDER", "FactProbe_" + ToString(N), {}, {"result"}); - - LWPROBE_OBJ(factProbe, result); + // Note that probe is create on the first pass + // LWTRACE_DECLARE_PROVIDER and LWTRACE_DEFINE_PROVIDER are not needed + // (Provider is created implicitly) + static NLWTrace::TLWProbe<ui64> factProbe( + "LWTRACE_EXAMPLE_PROVIDER", "FactProbe_" + ToString(N), {}, {"result"}); + + LWPROBE_OBJ(factProbe, result); #endif // LWTRACE_DISABLE - return result; -} - -template <> -ui64 Fact<0>() { - return 1; -} - -int main() { + return result; +} + +template <> +ui64 Fact<0>() { + return 1; +} + +int main() { Fact<6>(); // First run is required to create probes we can use later in trace query - NLWTrace::StartLwtraceFromEnv(); // parse trace query and create trace session + NLWTrace::StartLwtraceFromEnv(); // parse trace query and create trace session Cout << Fact<6>() << Endl; // actually trigger probes - return 0; -} + return 0; +} diff --git a/library/cpp/lwtrace/example5/start_with_query.sh b/library/cpp/lwtrace/example5/start_with_query.sh index 4df5e4e47c..9802100f5b 100755 --- a/library/cpp/lwtrace/example5/start_with_query.sh +++ b/library/cpp/lwtrace/example5/start_with_query.sh @@ -1,3 +1,3 @@ -#!/bin/bash -export LWTRACE="example_query.tr" -./lwtrace-example5 +#!/bin/bash +export LWTRACE="example_query.tr" +./lwtrace-example5 diff --git a/library/cpp/lwtrace/example5/ya.make b/library/cpp/lwtrace/example5/ya.make index 06dd4dc569..04ee4d29f2 100644 --- a/library/cpp/lwtrace/example5/ya.make +++ b/library/cpp/lwtrace/example5/ya.make @@ -1,13 +1,13 @@ -PROGRAM(lwtrace-example5) - -OWNER(serxa) - -SRCS( - lwtrace_example5.cpp -) - -PEERDIR( +PROGRAM(lwtrace-example5) + +OWNER(serxa) + +SRCS( + lwtrace_example5.cpp +) + +PEERDIR( library/cpp/lwtrace -) - -END() +) + +END() |