Skip to content
Snippets Groups Projects
Commit aaf39abb authored by Nicolas "Pixel" Noble's avatar Nicolas "Pixel" Noble
Browse files

Adding file and line number to cq debug refcount.

parent 66daf234
No related branches found
No related tags found
No related merge requests found
...@@ -88,9 +88,11 @@ grpc_completion_queue *grpc_completion_queue_create(void) { ...@@ -88,9 +88,11 @@ grpc_completion_queue *grpc_completion_queue_create(void) {
} }
#ifdef GRPC_CQ_REF_COUNT_DEBUG #ifdef GRPC_CQ_REF_COUNT_DEBUG
void grpc_cq_internal_ref(grpc_completion_queue *cc, const char *reason) { 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, const char *file, int line) {
(int)cc->owning_refs.count + 1, reason); 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 #else
void grpc_cq_internal_ref(grpc_completion_queue *cc) { void grpc_cq_internal_ref(grpc_completion_queue *cc) {
#endif #endif
...@@ -103,9 +105,11 @@ static void on_pollset_destroy_done(void *arg) { ...@@ -103,9 +105,11 @@ static void on_pollset_destroy_done(void *arg) {
} }
#ifdef GRPC_CQ_REF_COUNT_DEBUG #ifdef GRPC_CQ_REF_COUNT_DEBUG
void grpc_cq_internal_unref(grpc_completion_queue *cc, const char *reason) { 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, const char *file, int line) {
(int)cc->owning_refs.count - 1, reason); 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 #else
void grpc_cq_internal_unref(grpc_completion_queue *cc) { void grpc_cq_internal_unref(grpc_completion_queue *cc) {
#endif #endif
......
...@@ -40,10 +40,14 @@ ...@@ -40,10 +40,14 @@
#include <grpc/grpc.h> #include <grpc/grpc.h>
#ifdef GRPC_CQ_REF_COUNT_DEBUG #ifdef GRPC_CQ_REF_COUNT_DEBUG
void grpc_cq_internal_ref(grpc_completion_queue *cc, const char *reason); void grpc_cq_internal_ref(grpc_completion_queue *cc, const char *reason,
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) void grpc_cq_internal_unref(grpc_completion_queue *cc, const char *reason,
#define GRPC_CQ_INTERNAL_UNREF(cc, reason) grpc_cq_internal_unref(cc, 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 #else
void grpc_cq_internal_ref(grpc_completion_queue *cc); void grpc_cq_internal_ref(grpc_completion_queue *cc);
void grpc_cq_internal_unref(grpc_completion_queue *cc); void grpc_cq_internal_unref(grpc_completion_queue *cc);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment