@ -229,30 +229,33 @@ static void send_goaway(grpc_chttp2_transport* t, grpc_error_handle error,
# define GRPC_ARG_SETTINGS_TIMEOUT "grpc.http2.settings_timeout"
# define GRPC_ARG_SETTINGS_TIMEOUT "grpc.http2.settings_timeout"
namespace {
namespace {
grpc_core : : CallTracerInterface * CallTracerIfEnab led ( grpc_chttp2_stream * s ) {
grpc_core : : CallTracerInterface * CallTracerIfSamp led ( grpc_chttp2_stream * s ) {
if ( s - > context = = nullptr | | ! grpc_core : : IsTraceRecordCallopsEnabled ( ) ) {
if ( s - > context = = nullptr | | ! grpc_core : : IsTraceRecordCallopsEnabled ( ) ) {
return nullptr ;
return nullptr ;
}
}
retu rn static_cast < grpc_core : : CallTracerInterface * > (
auto * call_t rac er = static_cast < grpc_core : : CallTracerInterface * > (
static_cast < grpc_call_context_element * > (
static_cast < grpc_call_context_element * > (
s - > context ) [ GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE ]
s - > context ) [ GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE ]
. value ) ;
. value ) ;
if ( call_tracer = = nullptr | | ! call_tracer - > IsSampled ( ) ) {
return nullptr ;
}
return call_tracer ;
}
}
std : : shared_ptr < grpc_core : : TcpTracerInterface > TcpTracerIfEnabled (
std : : shared_ptr < grpc_core : : TcpTracerInterface > TcpTracerIfSamp led (
grpc_chttp2_stream * s ) {
grpc_chttp2_stream * s ) {
if ( s - > context = = nullptr | | ! s - > traced | |
if ( s - > context = = nullptr | | ! grpc_core : : IsTraceRecordCallopsEnabled ( ) ) {
! grpc_core : : IsTraceRecordCallopsEnabled ( ) ) {
return nullptr ;
return nullptr ;
}
}
auto * call_tracer = static_cast < grpc_core : : CallTracerInterface * > (
auto * call_attempt_ tracer = static_cast < grpc_core : : CallTracerInterface * > (
static_cast < grpc_call_context_element * > (
static_cast < grpc_call_context_element * > (
s - > context ) [ GRPC_CONTEXT_CALL_TRACER ]
s - > context ) [ GRPC_CONTEXT_CALL_TRACER ]
. value ) ;
. value ) ;
if ( ! call_tracer ) {
if ( call_attempt_tracer = = nullptr | | ! call_attempt_ tracer - > IsSampled ( ) ) {
return nullptr ;
return nullptr ;
}
}
return call_tracer - > StartNewTcpTrace ( ) ;
return call_attempt_ tracer - > StartNewTcpTrace ( ) ;
}
}
grpc_core : : WriteTimestampsCallback g_write_timestamps_callback = nullptr ;
grpc_core : : WriteTimestampsCallback g_write_timestamps_callback = nullptr ;
@ -1471,8 +1474,8 @@ static void perform_stream_op_locked(void* stream_op,
s - > context = op - > payload - > context ;
s - > context = op - > payload - > context ;
s - > traced = op - > is_traced ;
s - > traced = op - > is_traced ;
s - > call_tracer = CallTracerIfEnab led ( s ) ;
s - > call_tracer = CallTracerIfSamp led ( s ) ;
s - > tcp_tracer = TcpTracerIfEnab led ( s ) ;
s - > tcp_tracer = TcpTracerIfSamp led ( s ) ;
if ( GRPC_TRACE_FLAG_ENABLED ( grpc_http_trace ) ) {
if ( GRPC_TRACE_FLAG_ENABLED ( grpc_http_trace ) ) {
gpr_log ( GPR_INFO ,
gpr_log ( GPR_INFO ,
" perform_stream_op_locked[s=%p; op=%p]: %s; on_complete = %p " , s ,
" perform_stream_op_locked[s=%p; op=%p]: %s; on_complete = %p " , s ,