1515
1616#include < rcutils/allocator.h>
1717#include < rcutils/logging.h>
18+ #include < rcutils/macros.h>
1819
1920#include < rcl_logging_interface/rcl_logging_interface.h>
2021
@@ -72,6 +73,7 @@ BENCHMARK_F(LoggingBenchmarkPerformance, log_level_hit)(benchmark::State & st)
7273 reset_heap_counters ();
7374
7475 for (auto _ : st) {
76+ RCUTILS_UNUSED (_);
7577 rcl_logging_external_log (RCUTILS_LOG_SEVERITY_INFO, nullptr , data.c_str ());
7678 }
7779}
@@ -80,6 +82,7 @@ BENCHMARK_F(LoggingBenchmarkPerformance, log_level_miss)(benchmark::State & st)
8082{
8183 setLogLevel (RCUTILS_LOG_SEVERITY_INFO, st);
8284 for (auto _ : st) {
85+ RCUTILS_UNUSED (_);
8386 rcl_logging_external_log (RCUTILS_LOG_SEVERITY_DEBUG, nullptr , data.c_str ());
8487 }
8588}
@@ -95,6 +98,7 @@ BENCHMARK_F(PerformanceTest, logging_reinitialize)(benchmark::State & st)
9598 reset_heap_counters ();
9699
97100 for (auto _ : st) {
101+ RCUTILS_UNUSED (_);
98102 ret = rcl_logging_external_initialize (nullptr , allocator);
99103 if (ret != RCL_LOGGING_RET_OK) {
100104 st.SkipWithError (rcutils_get_error_string ().str );
@@ -111,6 +115,7 @@ BENCHMARK_F(PerformanceTest, logging_initialize_shutdown)(benchmark::State & st)
111115{
112116 rcutils_allocator_t allocator = rcutils_get_default_allocator ();
113117 for (auto _ : st) {
118+ RCUTILS_UNUSED (_);
114119 rcl_logging_ret_t ret = rcl_logging_external_initialize (nullptr , allocator);
115120 if (ret != RCL_LOGGING_RET_OK) {
116121 st.SkipWithError (rcutils_get_error_string ().str );
0 commit comments