From 115034b9ec00b9667bc8d98b48472d73c2b9f8b6 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Wed, 20 Mar 2024 21:55:31 -0400 Subject: [PATCH] Fix the build on RHEL-9. (#98) * Fix the build on RHEL-9. It turns out that in the older version of lttng-ust on RHEL-9, the API to set a marker is spelled _lttng_ust_tracef. Include the correct version header file, and use the correct API called depending on what version we are using. Signed-off-by: Chris Lalancette Co-authored-by: Tomoya Fujita --- test_tracetools/src/mark_process.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test_tracetools/src/mark_process.cpp b/test_tracetools/src/mark_process.cpp index e7f7cb31..a6671428 100644 --- a/test_tracetools/src/mark_process.cpp +++ b/test_tracetools/src/mark_process.cpp @@ -14,6 +14,7 @@ #ifndef TRACETOOLS_DISABLED #include +#include #include "rcpputils/env.hpp" #endif // TRACETOOLS_DISABLED @@ -40,7 +41,11 @@ void mark_trace_test_process() const std::string env_var{trace_test_id_env_var}; const auto test_id = rcpputils::get_env_var(env_var.c_str()); if (!test_id.empty()) { +#if LTTNG_UST_MINOR_VERSION <= 12 + _lttng_ust_tracef("%s=%s", env_var.c_str(), test_id.c_str()); +#else lttng_ust__tracef("%s=%s", env_var.c_str(), test_id.c_str()); +#endif } #endif // TRACETOOLS_DISABLED }