From: Tony Finch Date: Wed, 22 Feb 2023 17:32:47 +0000 (+0000) Subject: Include thread ID in refcount trace output X-Git-Tag: v9.19.11~33^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63cd73d43ee685b12f5f683a6189386ad0ac25e0;p=thirdparty%2Fbind9.git Include thread ID in refcount trace output --- diff --git a/lib/isc/include/isc/refcount.h b/lib/isc/include/isc/refcount.h index 6b1f7cdecef..ac2702b8858 100644 --- a/lib/isc/include/isc/refcount.h +++ b/lib/isc/include/isc/refcount.h @@ -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) \