From f667f1b3e876c5d59786d40c6d3f6d22be2db5ac Mon Sep 17 00:00:00 2001
From: David Garcia Quintas <dgq@google.com>
Date: Mon, 4 May 2015 13:15:46 -0700
Subject: [PATCH] Added missing profiling tags.

---
 src/core/iomgr/tcp_posix.c            | 4 ++--
 src/core/profiling/timers.h           | 5 +++++
 src/core/surface/call.c               | 4 ++--
 src/core/transport/chttp2_transport.c | 6 +++---
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/core/iomgr/tcp_posix.c b/src/core/iomgr/tcp_posix.c
index 6b21bcf6a9..06725fbc89 100644
--- a/src/core/iomgr/tcp_posix.c
+++ b/src/core/iomgr/tcp_posix.c
@@ -343,11 +343,11 @@ static void grpc_tcp_continue_read(grpc_tcp *tcp) {
   msg.msg_controllen = 0;
   msg.msg_flags = 0;
 
-  GRPC_TIMER_MARK(RECVMSG_BEGIN, 0);
+  GRPC_TIMER_BEGIN(GRPC_PTAG_RECVMSG, 0);
   do {
     read_bytes = recvmsg(tcp->fd, &msg, 0);
   } while (read_bytes < 0 && errno == EINTR);
-  GRPC_TIMER_MARK(RECVMSG_END, 0);
+  GRPC_TIMER_END(GRPC_PTAG_RECVMSG, 0);
 
   if (read_bytes < allocated_bytes) {
     /* TODO(klempner): Consider a second read first, in hopes of getting a
diff --git a/src/core/profiling/timers.h b/src/core/profiling/timers.h
index ccde6acd58..0b0f7152e7 100644
--- a/src/core/profiling/timers.h
+++ b/src/core/profiling/timers.h
@@ -60,11 +60,16 @@ enum grpc_profiling_tags {
   GRPC_PTAG_POLL_FINISHED = 203 + GRPC_PTAG_IGNORE_THRESHOLD,
   GRPC_PTAG_TCP_CB_WRITE = 204 + GRPC_PTAG_IGNORE_THRESHOLD,
   GRPC_PTAG_TCP_WRITE = 205 + GRPC_PTAG_IGNORE_THRESHOLD,
+  GRPC_PTAG_CALL_ON_DONE_RECV = 206 + GRPC_PTAG_IGNORE_THRESHOLD,
 
   /* C++ */
   GRPC_PTAG_CPP_CALL_CREATED = 300 + GRPC_PTAG_IGNORE_THRESHOLD,
   GRPC_PTAG_CPP_PERFORM_OPS = 301 + GRPC_PTAG_IGNORE_THRESHOLD,
 
+  /* Transports */
+  GRPC_PTAG_HTTP2_UNLOCK = 401 + GRPC_PTAG_IGNORE_THRESHOLD,
+  GRPC_PTAG_HTTP2_UNLOCK_CLEANUP = 402 + GRPC_PTAG_IGNORE_THRESHOLD,
+
   /* > 1024 Unassigned reserved. For any miscellaneous use.
   * Use addition to generate tags from this base or take advantage of the 10
   * zero'd bits for OR-ing. */
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index 070be1b25a..fc3e840452 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -686,7 +686,7 @@ static int add_slice_to_message(grpc_call *call, gpr_slice slice) {
 static void call_on_done_recv(void *pc, int success) {
   grpc_call *call = pc;
   size_t i;
-  GRPC_TIMER_MARK(CALL_ON_DONE_RECV_BEGIN, 0);
+  GRPC_TIMER_BEGIN(GRPC_PTAG_CALL_ON_DONE_RECV, 0);
   lock(call);
   call->receiving = 0;
   if (success) {
@@ -731,7 +731,7 @@ static void call_on_done_recv(void *pc, int success) {
   unlock(call);
 
   GRPC_CALL_INTERNAL_UNREF(call, "receiving", 0);
-  GRPC_TIMER_MARK(CALL_ON_DONE_RECV_END, 0);
+  GRPC_TIMER_BEGIN(GRPC_PTAG_CALL_ON_DONE_RECV, 0);
 }
 
 static grpc_mdelem_list chain_metadata_from_app(grpc_call *call, size_t count,
diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c
index 46bed36ac4..86e18f853e 100644
--- a/src/core/transport/chttp2_transport.c
+++ b/src/core/transport/chttp2_transport.c
@@ -799,7 +799,7 @@ static void unlock(transport *t) {
   grpc_stream_op_buffer nuke_now;
   const grpc_transport_callbacks *cb = t->cb;
 
-  GRPC_TIMER_MARK(HTTP2_UNLOCK_BEGIN, 0);
+  GRPC_TIMER_BEGIN(GRPC_PTAG_HTTP2_UNLOCK, 0);
 
   grpc_sopb_init(&nuke_now);
   if (t->nuke_later_sopb.nops) {
@@ -849,7 +849,7 @@ static void unlock(transport *t) {
   /* finally unlock */
   gpr_mu_unlock(&t->mu);
 
-  GRPC_TIMER_MARK(HTTP2_UNLOCK_CLEANUP, 0);
+  GRPC_TIMER_MARK(GRPC_PTAG_HTTP2_UNLOCK_CLEANUP, 0);
 
   /* perform some callbacks if necessary */
   for (i = 0; i < num_goaways; i++) {
@@ -882,7 +882,7 @@ static void unlock(transport *t) {
 
   gpr_free(goaways);
 
-  GRPC_TIMER_MARK(HTTP2_UNLOCK_END, 0);
+  GRPC_TIMER_END(GRPC_PTAG_HTTP2_UNLOCK, 0);
 }
 
 /*
-- 
GitLab