19 #ifndef GRPC_CORE_LIB_DEBUG_TRACE_H 20 #define GRPC_CORE_LIB_DEBUG_TRACE_H 38 #if defined(__has_feature) 39 #if __has_feature(thread_sanitizer) 40 #define GRPC_THREADSAFE_TRACER 49 static bool Set(
const char* name,
bool enabled);
53 static void LogAllTracers();
68 const char*
name()
const {
return name_; }
78 #define GRPC_USE_TRACERS // tracers on by default in OSS 79 #if defined(GRPC_USE_TRACERS) || !defined(NDEBUG) 81 #ifdef GRPC_THREADSAFE_TRACER 85 #endif // GRPC_THREADSAFE_TRACER 88 bool enabled() {
return false; }
95 void set_enabled(
bool enabled) {
96 #ifdef GRPC_THREADSAFE_TRACER 104 const char*
const name_;
105 #ifdef GRPC_THREADSAFE_TRACER 112 #define GRPC_TRACE_FLAG_ENABLED(f) GPR_UNLIKELY((f).enabled()) 121 constexpr
bool enabled()
const {
return false; }
122 constexpr
const char*
name()
const {
return "DebugOnlyTraceFlag"; }
125 void set_enabled(
bool ) {}
#define gpr_atm_no_barrier_load(p)
Definition: atm_gcc_atomic.h:51
bool enabled()
Definition: trace.h:80
TraceFlag(bool default_enabled, const char *name)
Definition: trace.cc:86
const char * name() const
Definition: trace.h:68
#define gpr_atm_no_barrier_store(p, value)
Definition: atm_gcc_atomic.h:54
GPR_GLOBAL_CONFIG_DECLARE_STRING(grpc_trace)
Round Robin Policy.
Definition: backend_metric.cc:24
void grpc_tracer_shutdown(void)
Definition: trace.cc:150
void grpc_tracer_enable_flag(grpc_core::TraceFlag *flag)
intptr_t gpr_atm
Definition: atm_gcc_atomic.h:30
void grpc_tracer_init(const char *env_var_name)
Definition: trace.cc:140
static bool Set(const char *name, bool enabled)
Definition: trace.cc:41
static void Add(TraceFlag *flag)
Definition: trace.cc:72
TraceFlag DebugOnlyTraceFlag
Definition: trace.h:115