Go to the documentation of this file. 27 #define PHOSPHOR_INTERNAL_UID3(a, b) \ 28 phosphor_internal_ ##a##_##b 30 #define PHOSPHOR_INTERNAL_UID2(a, b) \ 31 PHOSPHOR_INTERNAL_UID3(a, b) 33 #define PHOSPHOR_INTERNAL_UID(prefix) \ 34 PHOSPHOR_INTERNAL_UID2(prefix, __LINE__) 43 #define PHOSPHOR_INTERNAL_CATEGORY_INFO \ 44 static std::atomic<const phosphor::AtomicCategoryStatus*> \ 45 PHOSPHOR_INTERNAL_UID(category_enabled); \ 46 const phosphor::AtomicCategoryStatus* PHOSPHOR_INTERNAL_UID(category_enabled_temp) \ 47 = PHOSPHOR_INTERNAL_UID(category_enabled).load(std::memory_order_acquire); \ 49 #define PHOSPHOR_INTERNAL_INITIALIZE_TPI(tpi_name, category, name, argA, argB) \ 50 constexpr static phosphor::tracepoint_info PHOSPHOR_INTERNAL_UID(tpi_name) = { \ 56 #define PHOSPHOR_INTERNAL_INITIALIZE_TRACEPOINT(category, name, argA, argB) \ 57 PHOSPHOR_INTERNAL_INITIALIZE_TPI(tpi, category, name, argA, argB); \ 58 if (unlikely(!PHOSPHOR_INTERNAL_UID(category_enabled_temp))) { \ 59 PHOSPHOR_INTERNAL_UID(category_enabled_temp) = &PHOSPHOR_INSTANCE.getCategoryStatus(category); \ 60 PHOSPHOR_INTERNAL_UID(category_enabled).store( \ 61 PHOSPHOR_INTERNAL_UID(category_enabled_temp), std::memory_order_release); \ 71 #define PHOSPHOR_INTERNAL_TRACE_EVENT(category, name, argA, argB, type, ...) \ 72 PHOSPHOR_INTERNAL_CATEGORY_INFO \ 73 PHOSPHOR_INTERNAL_INITIALIZE_TRACEPOINT(category, name, argA, argB) \ 74 if (PHOSPHOR_INTERNAL_UID(category_enabled_temp)->load(std::memory_order_acquire) \ 75 != phosphor::CategoryStatus::Disabled) { \ 76 PHOSPHOR_INSTANCE.logEvent(&PHOSPHOR_INTERNAL_UID(tpi), type, __VA_ARGS__); \ 82 #define PHOSPHOR_INTERNAL_TRACE_EVENT0(category, name, type) \ 83 PHOSPHOR_INTERNAL_CATEGORY_INFO \ 84 PHOSPHOR_INTERNAL_INITIALIZE_TRACEPOINT(category, name, "arg1", "arg2") \ 85 if (PHOSPHOR_INTERNAL_UID(category_enabled_temp)->load(std::memory_order_relaxed) \ 86 != phosphor::CategoryStatus::Disabled) { \ 87 PHOSPHOR_INSTANCE.logEvent(&PHOSPHOR_INTERNAL_UID(tpi), type); \ 97 #define PHOSPHOR_INTERNAL_ADDITIONAL_TRACE_EVENT0(tpi_name, category, name, type) \ 98 PHOSPHOR_INTERNAL_INITIALIZE_TPI(tpi_name, category, name, "arg1", "arg2") \ 99 if (PHOSPHOR_INTERNAL_UID(category_enabled_temp)->load(std::memory_order_relaxed) \ 100 != phosphor::CategoryStatus::Disabled) { \ 101 PHOSPHOR_INSTANCE.logEvent(&PHOSPHOR_INTERNAL_UID(tpi_name), type); \