From 66088c03882072a7733a9cdba6b64f79bece059f Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Wed, 20 Mar 2024 19:14:00 +0000 Subject: [PATCH 1/2] 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 --- 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..069b9a8e 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 } From 7e426a132edbfaa96a1c862bee2373dc69cb7ad8 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Wed, 20 Mar 2024 15:36:53 -0400 Subject: [PATCH 2/2] Update test_tracetools/src/mark_process.cpp Co-authored-by: Tomoya Fujita Signed-off-by: Chris Lalancette --- test_tracetools/src/mark_process.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_tracetools/src/mark_process.cpp b/test_tracetools/src/mark_process.cpp index 069b9a8e..a6671428 100644 --- a/test_tracetools/src/mark_process.cpp +++ b/test_tracetools/src/mark_process.cpp @@ -41,7 +41,7 @@ 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 +#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());