Skip to content

Instantly share code, notes, and snippets.

@dqminh
Created October 23, 2019 12:40
Show Gist options
  • Save dqminh/b64099d775d72e584a141a0d20c38a00 to your computer and use it in GitHub Desktop.
Save dqminh/b64099d775d72e584a141a0d20c38a00 to your computer and use it in GitHub Desktop.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3c1a689..7603e6e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,7 +25,8 @@ option(JAEGERTRACING_WARNINGS_AS_ERRORS "Treat compiler warnings as errors" OFF)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- set(cxx_flags -Wall -pedantic)
+ set(cxx_flags -Wall -pedantic -static-libasan -fsanitize=address -fno-omit-frame-pointer)
+ set(link_flags -static-libasan -fsanitize=address)
if(JAEGERTRACING_WARNINGS_AS_ERRORS)
list(APPEND cxx_flags -Werror)
endif()
diff --git a/examples/App.cpp b/examples/App.cpp
index f7df8a2..714aa47 100644
--- a/examples/App.cpp
+++ b/examples/App.cpp
@@ -32,12 +32,15 @@ void tracedFunction()
int main(int argc, char* argv[])
{
- if (argc < 2) {
- std::cerr << "usage: " << argv[0] << " <config-yaml-path>\n";
+ if (argc < 3) {
+ std::cerr << "usage: " << argv[0] << " <config-yaml-path> <number>\n";
return 1;
}
setUpTracer(argv[1]);
- tracedFunction();
+ auto loop = std::stoi(argv[2]);
+ for (int i = 0; i < loop; i++) {
+ tracedFunction();
+ }
// Not stricly necessary to close tracer, but might flush any buffered
// spans. See more details in opentracing::Tracer::Close() documentation.
opentracing::Tracer::Global()->Close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment