diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2015-06-24 23:22:53 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2015-06-24 23:22:53 +0200 |
commit | aaf39abb367a24b9fe9ccaa03f643d88075319e9 (patch) | |
tree | dfb1459db0bf852415436e531408475be50ba210 | |
parent | 66daf23401dd96b3fc6097738b7abfa8a43b709a (diff) |
Adding file and line number to cq debug refcount.
-rw-r--r-- | src/core/surface/completion_queue.c | 16 | ||||
-rw-r--r-- | src/core/surface/completion_queue.h | 12 |
2 files changed, 18 insertions, 10 deletions
diff --git a/src/core/surface/completion_queue.c b/src/core/surface/completion_queue.c index bd0fabf9da..030a8b4e6f 100644 --- a/src/core/surface/completion_queue.c +++ b/src/core/surface/completion_queue.c @@ -88,9 +88,11 @@ grpc_completion_queue *grpc_completion_queue_create(void) { } #ifdef GRPC_CQ_REF_COUNT_DEBUG -void grpc_cq_internal_ref(grpc_completion_queue *cc, const char *reason) { - gpr_log(GPR_DEBUG, "CQ:%p ref %d -> %d %s", cc, (int)cc->owning_refs.count, - (int)cc->owning_refs.count + 1, reason); +void grpc_cq_internal_ref(grpc_completion_queue *cc, const char *reason, + const char *file, int line) { + gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, "CQ:%p ref %d -> %d %s", + cc, (int)cc->owning_refs.count, (int)cc->owning_refs.count + 1, + reason); #else void grpc_cq_internal_ref(grpc_completion_queue *cc) { #endif @@ -103,9 +105,11 @@ static void on_pollset_destroy_done(void *arg) { } #ifdef GRPC_CQ_REF_COUNT_DEBUG -void grpc_cq_internal_unref(grpc_completion_queue *cc, const char *reason) { - gpr_log(GPR_DEBUG, "CQ:%p unref %d -> %d %s", cc, (int)cc->owning_refs.count, - (int)cc->owning_refs.count - 1, reason); +void grpc_cq_internal_unref(grpc_completion_queue *cc, const char *reason, + const char *file, int line) { + gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, "CQ:%p unref %d -> %d %s", + cc, (int)cc->owning_refs.count, (int)cc->owning_refs.count - 1, + reason); #else void grpc_cq_internal_unref(grpc_completion_queue *cc) { #endif diff --git a/src/core/surface/completion_queue.h b/src/core/surface/completion_queue.h index e76910c00b..1b9010f462 100644 --- a/src/core/surface/completion_queue.h +++ b/src/core/surface/completion_queue.h @@ -40,10 +40,14 @@ #include <grpc/grpc.h> #ifdef GRPC_CQ_REF_COUNT_DEBUG -void grpc_cq_internal_ref(grpc_completion_queue *cc, const char *reason); -void grpc_cq_internal_unref(grpc_completion_queue *cc, const char *reason); -#define GRPC_CQ_INTERNAL_REF(cc, reason) grpc_cq_internal_ref(cc, reason) -#define GRPC_CQ_INTERNAL_UNREF(cc, reason) grpc_cq_internal_unref(cc, reason) +void grpc_cq_internal_ref(grpc_completion_queue *cc, const char *reason, + const char *file, int line); +void grpc_cq_internal_unref(grpc_completion_queue *cc, const char *reason, + const char *file, int line); +#define GRPC_CQ_INTERNAL_REF(cc, reason) \ + grpc_cq_internal_ref(cc, reason, __FILE__, __LINE__) +#define GRPC_CQ_INTERNAL_UNREF(cc, reason) \ + grpc_cq_internal_unref(cc, reason, __FILE__, __LINE__) #else void grpc_cq_internal_ref(grpc_completion_queue *cc); void grpc_cq_internal_unref(grpc_completion_queue *cc); |