debug logging fix

pull/6379/head
Yuchen Zeng 9 years ago
parent 90b4a87d3b
commit fad045004d
  1. 2
      src/core/ext/lb_policy/round_robin/round_robin.c
  2. 3
      src/core/ext/transport/chttp2/transport/chttp2_transport.c
  3. 4
      src/core/ext/transport/chttp2/transport/hpack_encoder.c
  4. 2
      src/core/ext/transport/chttp2/transport/hpack_table.c

@ -306,8 +306,10 @@ static void start_picking(grpc_exec_ctx *exec_ctx, round_robin_lb_policy *p) {
size_t i; size_t i;
p->started_picking = 1; p->started_picking = 1;
if (grpc_lb_round_robin_trace) {
gpr_log(GPR_DEBUG, "LB_POLICY: p=%p num_subchannels=%d", p, gpr_log(GPR_DEBUG, "LB_POLICY: p=%p num_subchannels=%d", p,
p->num_subchannels); p->num_subchannels);
}
for (i = 0; i < p->num_subchannels; i++) { for (i = 0; i < p->num_subchannels; i++) {
subchannel_data *sd = p->subchannels[i]; subchannel_data *sd = p->subchannels[i];

@ -776,7 +776,8 @@ void grpc_chttp2_add_incoming_goaway(
grpc_exec_ctx *exec_ctx, grpc_chttp2_transport_global *transport_global, grpc_exec_ctx *exec_ctx, grpc_chttp2_transport_global *transport_global,
uint32_t goaway_error, gpr_slice goaway_text) { uint32_t goaway_error, gpr_slice goaway_text) {
char *msg = gpr_dump_slice(goaway_text, GPR_DUMP_HEX | GPR_DUMP_ASCII); char *msg = gpr_dump_slice(goaway_text, GPR_DUMP_HEX | GPR_DUMP_ASCII);
gpr_log(GPR_DEBUG, "got goaway [%d]: %s", goaway_error, msg); GRPC_CHTTP2_IF_TRACING(gpr_log(
GPR_DEBUG, "got goaway [%d]: %s", goaway_error, msg));
gpr_free(msg); gpr_free(msg);
gpr_slice_unref(goaway_text); gpr_slice_unref(goaway_text);
transport_global->seen_goaway = 1; transport_global->seen_goaway = 1;

@ -63,6 +63,8 @@
/* don't consider adding anything bigger than this to the hpack table */ /* don't consider adding anything bigger than this to the hpack table */
#define MAX_DECODER_SPACE_USAGE 512 #define MAX_DECODER_SPACE_USAGE 512
extern int grpc_http_trace;
typedef struct { typedef struct {
int is_first_frame; int is_first_frame;
/* number of bytes in 'output' when we started the frame - used to calculate /* number of bytes in 'output' when we started the frame - used to calculate
@ -532,8 +534,10 @@ void grpc_chttp2_hpack_compressor_set_max_table_size(
} }
} }
c->advertise_table_size_change = 1; c->advertise_table_size_change = 1;
if (grpc_http_trace) {
gpr_log(GPR_DEBUG, "set max table size from encoder to %d", max_table_size); gpr_log(GPR_DEBUG, "set max table size from encoder to %d", max_table_size);
} }
}
void grpc_chttp2_encode_header(grpc_chttp2_hpack_compressor *c, void grpc_chttp2_encode_header(grpc_chttp2_hpack_compressor *c,
uint32_t stream_id, uint32_t stream_id,

@ -253,7 +253,9 @@ void grpc_chttp2_hptbl_set_max_bytes(grpc_chttp2_hptbl *tbl,
if (tbl->max_bytes == max_bytes) { if (tbl->max_bytes == max_bytes) {
return; return;
} }
if (grpc_http_trace) {
gpr_log(GPR_DEBUG, "Update hpack parser max size to %d", max_bytes); gpr_log(GPR_DEBUG, "Update hpack parser max size to %d", max_bytes);
}
while (tbl->mem_used > max_bytes) { while (tbl->mem_used > max_bytes) {
evict1(tbl); evict1(tbl);
} }

Loading…
Cancel
Save