]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Include thread ID in refcount trace output
authorTony Finch <fanf@isc.org>
Wed, 22 Feb 2023 17:32:47 +0000 (17:32 +0000)
committerTony Finch <fanf@isc.org>
Thu, 23 Feb 2023 14:28:27 +0000 (14:28 +0000)
lib/isc/include/isc/refcount.h

index 6b1f7cdecef76cadf85244d1d87c69ef7e3f6c94..ac2702b88581b563df440c4b5740230cb3159b47 100644 (file)
@@ -166,8 +166,8 @@ isc_refcount_decrement(isc_refcount_t *target) {
                uint_fast32_t refs =                                          \
                        isc_refcount_increment(&ptr->references) + 1;         \
                fprintf(stderr,                                               \
-                       "%s:%s:%s:%u:%p->references = %" PRIuFAST32 "\n",     \
-                       __func__, func, file, line, ptr, refs);               \
+                       "%s:%s:%s:%u:t%u:%p->references = %" PRIuFAST32 "\n", \
+                       __func__, func, file, line, isc_tid(), ptr, refs);    \
                return (ptr);                                                 \
        }                                                                     \
                                                                               \
@@ -180,8 +180,8 @@ isc_refcount_decrement(isc_refcount_t *target) {
                        destroy(ptr);                                         \
                }                                                             \
                fprintf(stderr,                                               \
-                       "%s:%s:%s:%u:%p->references = %" PRIuFAST32 "\n",     \
-                       __func__, func, file, line, ptr, refs);               \
+                       "%s:%s:%s:%u:t%u:%p->references = %" PRIuFAST32 "\n", \
+                       __func__, func, file, line, isc_tid(), ptr, refs);    \
        }                                                                     \
        void name##__attach(name##_t *ptr, name##_t **ptrp, const char *func, \
                            const char *file, unsigned int line) {            \
@@ -189,8 +189,8 @@ isc_refcount_decrement(isc_refcount_t *target) {
                uint_fast32_t refs =                                          \
                        isc_refcount_increment(&ptr->references) + 1;         \
                fprintf(stderr,                                               \
-                       "%s:%s:%s:%u:%p->references = %" PRIuFAST32 "\n",     \
-                       __func__, func, file, line, ptr, refs);               \
+                       "%s:%s:%s:%u:t%u:%p->references = %" PRIuFAST32 "\n", \
+                       __func__, func, file, line, isc_tid(), ptr, refs);    \
                *ptrp = ptr;                                                  \
        }                                                                     \
                                                                               \
@@ -205,8 +205,8 @@ isc_refcount_decrement(isc_refcount_t *target) {
                        destroy(ptr);                                         \
                }                                                             \
                fprintf(stderr,                                               \
-                       "%s:%s:%s:%u:%p->references = %" PRIuFAST32 "\n",     \
-                       __func__, func, file, line, ptr, refs);               \
+                       "%s:%s:%s:%u:t%u:%p->references = %" PRIuFAST32 "\n", \
+                       __func__, func, file, line, isc_tid(), ptr, refs);    \
        }
 
 #define ISC_REFCOUNT_DECL(name)                                  \