diff options
author | Craig Tiller <ctiller@google.com> | 2015-10-09 15:07:02 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-10-09 15:07:02 -0700 |
commit | 1f41b6b5eda983052b31f60dcbe24b8021bc2fc2 (patch) | |
tree | d652190ccf684618da09d685da3d1019e196837b /src/core/transport/chttp2_transport.c | |
parent | 8910ac6a363173b037a209debdc2b4528e9309f6 (diff) |
Simplify adding annotations, annotate more things
Diffstat (limited to 'src/core/transport/chttp2_transport.c')
-rw-r--r-- | src/core/transport/chttp2_transport.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 0a1b3a8176..d39816b011 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -510,6 +510,7 @@ grpc_chttp2_stream_parsing *grpc_chttp2_parsing_accept_stream( static void lock(grpc_chttp2_transport *t) { gpr_mu_lock(&t->mu); } static void unlock(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t) { + GRPC_TIMER_BEGIN("unlock", 0); unlock_check_read_write_state(exec_ctx, t); if (!t->writing_active && !t->closed && grpc_chttp2_unlocking_check_writes(&t->global, &t->writing)) { @@ -520,6 +521,7 @@ static void unlock(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t) { } gpr_mu_unlock(&t->mu); + GRPC_TIMER_END("unlock", 0); } /* @@ -546,7 +548,7 @@ void grpc_chttp2_terminate_writing(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport_writing *transport_writing = transport_writing_ptr; grpc_chttp2_transport *t = TRANSPORT_FROM_WRITING(transport_writing); - GRPC_TIMER_BEGIN(GRPC_PTAG_HTTP2_TERMINATE_WRITING, 0); + GRPC_TIMER_BEGIN("grpc_chttp2_terminate_writing", 0); lock(t); @@ -569,16 +571,16 @@ void grpc_chttp2_terminate_writing(grpc_exec_ctx *exec_ctx, unlock(exec_ctx, t); UNREF_TRANSPORT(exec_ctx, t, "writing"); - - GRPC_TIMER_END(GRPC_PTAG_HTTP2_TERMINATE_WRITING, 0); + + GRPC_TIMER_END("grpc_chttp2_terminate_writing", 0); } static void writing_action(grpc_exec_ctx *exec_ctx, void *gt, int iomgr_success_ignored) { grpc_chttp2_transport *t = gt; - GRPC_TIMER_BEGIN(GRPC_PTAG_HTTP2_WRITING_ACTION, 0); + GRPC_TIMER_BEGIN("writing_action", 0); grpc_chttp2_perform_writes(exec_ctx, &t->writing, t->ep); - GRPC_TIMER_END(GRPC_PTAG_HTTP2_WRITING_ACTION, 0); + GRPC_TIMER_END("writing_action", 0); } void grpc_chttp2_add_incoming_goaway( @@ -648,6 +650,7 @@ static void maybe_start_some_streams( static void perform_stream_op_locked( grpc_exec_ctx *exec_ctx, grpc_chttp2_transport_global *transport_global, grpc_chttp2_stream_global *stream_global, grpc_transport_stream_op *op) { + GRPC_TIMER_BEGIN("perform_stream_op_locked", 0); if (op->cancel_with_status != GRPC_STATUS_OK) { cancel_from_api(transport_global, stream_global, op->cancel_with_status); } @@ -719,6 +722,7 @@ static void perform_stream_op_locked( } grpc_exec_ctx_enqueue(exec_ctx, op->on_consumed, 1); + GRPC_TIMER_END("perform_stream_op_locked", 0); } static void perform_stream_op(grpc_exec_ctx *exec_ctx, grpc_transport *gt, @@ -1109,7 +1113,7 @@ static void recv_data(grpc_exec_ctx *exec_ctx, void *tp, int success) { int keep_reading = 0; grpc_chttp2_transport *t = tp; - GRPC_TIMER_BEGIN(GRPC_PTAG_HTTP2_RECV_DATA, 0); + GRPC_TIMER_BEGIN("recv_data", 0); lock(t); i = 0; @@ -1121,11 +1125,13 @@ static void recv_data(grpc_exec_ctx *exec_ctx, void *tp, int success) { &t->parsing_stream_map); grpc_chttp2_prepare_to_read(&t->global, &t->parsing); gpr_mu_unlock(&t->mu); + GRPC_TIMER_BEGIN("recv_data.parse", 0); for (; i < t->read_buffer.count && grpc_chttp2_perform_read(exec_ctx, &t->parsing, t->read_buffer.slices[i]); i++) ; + GRPC_TIMER_END("recv_data.parse", 0); gpr_mu_lock(&t->mu); if (i != t->read_buffer.count) { drop_connection(exec_ctx, t); @@ -1163,7 +1169,7 @@ static void recv_data(grpc_exec_ctx *exec_ctx, void *tp, int success) { UNREF_TRANSPORT(exec_ctx, t, "recv_data"); } - GRPC_TIMER_END(GRPC_PTAG_HTTP2_RECV_DATA, 0); + GRPC_TIMER_END("recv_data", 0); } /* |