This directory contains the implementation of the gRPC tracing library.
The tracing library provides a mechanism for logging trace messages from different parts of the gRPC stack. This can be useful for debugging and performance analysis. It is designed to be lightweight and should have a minimal impact on performance when it is disabled.
trace_flags.yaml file. The entry should include the name of the trace flag and a brief description of what it does.tools/codegen/core/generate_trace_flags_main.cc script to regenerate the trace_flags.h and trace_flags.cc files.GRPC_TRACE_FLAG_ENABLED macro to check if the trace flag is enabled, and the GRPC_TRACE_LOG, GRPC_TRACE_DLOG, or GRPC_TRACE_VLOG macros to log trace messages.trace.h: The public interface to the tracing library.trace_impl.h: The implementation of the tracing library.trace_flags.yaml: The definition of all of the available trace flags.grpc_core::TraceFlag: Represents a single trace flag.GRPC_TRACE_FLAG_ENABLED(tracer): Checks if a trace flag is enabled. tracer is the name of the trace flag, without the grpc_ prefix.GRPC_TRACE_LOG(tracer, level): Logs a trace message if a trace flag is enabled. This is equivalent to LOG_IF(level, GRPC_TRACE_FLAG_ENABLED(tracer)).GRPC_TRACE_DLOG(tracer, level): Logs a trace message in debug builds if a trace flag is enabled. This is equivalent to DLOG_IF(level, GRPC_TRACE_FLAG_ENABLED(tracer)).GRPC_TRACE_VLOG(tracer, level): Logs a verbose trace message if a trace flag is enabled. This is equivalent to if (GRPC_TRACE_FLAG_ENABLED(tracer)) VLOG(level).GRPC_TRACE environment variable to a comma-separated list of trace flag names. For example, GRPC_TRACE=api,http will enable the api and http trace flags.all can be used to enable all trace flags.- will disable it. For example, GRPC_TRACE=all,-http will enable all trace flags except for http.