Skip to content

Commit

Permalink
debug logging fix
Browse files Browse the repository at this point in the history
  • Loading branch information
y-zeng committed Apr 29, 2016
1 parent 90b4a87 commit fad0450
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/core/ext/lb_policy/round_robin/round_robin.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,10 @@ static void start_picking(grpc_exec_ctx *exec_ctx, round_robin_lb_policy *p) {
size_t i;
p->started_picking = 1;

gpr_log(GPR_DEBUG, "LB_POLICY: p=%p num_subchannels=%d", p,
p->num_subchannels);
if (grpc_lb_round_robin_trace) {
gpr_log(GPR_DEBUG, "LB_POLICY: p=%p num_subchannels=%d", p,
p->num_subchannels);
}

for (i = 0; i < p->num_subchannels; i++) {
subchannel_data *sd = p->subchannels[i];
Expand Down
3 changes: 2 additions & 1 deletion src/core/ext/transport/chttp2/transport/chttp2_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,8 @@ void grpc_chttp2_add_incoming_goaway(
grpc_exec_ctx *exec_ctx, grpc_chttp2_transport_global *transport_global,
uint32_t goaway_error, gpr_slice goaway_text) {
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_slice_unref(goaway_text);
transport_global->seen_goaway = 1;
Expand Down
6 changes: 5 additions & 1 deletion src/core/ext/transport/chttp2/transport/hpack_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
/* don't consider adding anything bigger than this to the hpack table */
#define MAX_DECODER_SPACE_USAGE 512

extern int grpc_http_trace;

typedef struct {
int is_first_frame;
/* number of bytes in 'output' when we started the frame - used to calculate
Expand Down Expand Up @@ -532,7 +534,9 @@ void grpc_chttp2_hpack_compressor_set_max_table_size(
}
}
c->advertise_table_size_change = 1;
gpr_log(GPR_DEBUG, "set max table size from encoder to %d", max_table_size);
if (grpc_http_trace) {
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,
Expand Down
4 changes: 3 additions & 1 deletion src/core/ext/transport/chttp2/transport/hpack_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ void grpc_chttp2_hptbl_set_max_bytes(grpc_chttp2_hptbl *tbl,
if (tbl->max_bytes == max_bytes) {
return;
}
gpr_log(GPR_DEBUG, "Update hpack parser max size to %d", max_bytes);
if (grpc_http_trace) {
gpr_log(GPR_DEBUG, "Update hpack parser max size to %d", max_bytes);
}
while (tbl->mem_used > max_bytes) {
evict1(tbl);
}
Expand Down

0 comments on commit fad0450

Please sign in to comment.