diff options
author | Rich Salz <rsalz@akamai.com> | 2021-05-19 11:09:49 -0400 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2021-05-28 10:04:31 +0200 |
commit | a935791d54078f43209ffbc1886ac5e68772ce34 (patch) | |
tree | 3f130fe3e12b6671584ff421984542579d5268a8 /include/internal | |
parent | 6bf3692d311ad15d3667e7015bbe1a8f849f3c7b (diff) |
Rework and make DEBUG macros consistent.
Remove unused -DCONF_DEBUG and -DBN_CTX_DEBUG.
Rename REF_PRINT to REF_DEBUG for consistency, and add a new
tracing category and use it for printing reference counts.
Rename -DDEBUG_UNUSED to -DUNUSED_RESULT_DEBUG
Fix BN_DEBUG_RAND so it compiles and, when set, force DEBUG_RAND to
be set also.
Rename engine_debug_ref to be ENGINE_REF_PRINT also for consistency.
Fixes #15357
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15353)
Diffstat (limited to 'include/internal')
-rw-r--r-- | include/internal/refcount.h | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/include/internal/refcount.h b/include/internal/refcount.h index ee506e592d..7412d62f56 100644 --- a/include/internal/refcount.h +++ b/include/internal/refcount.h @@ -11,13 +11,7 @@ # pragma once # include <openssl/e_os2.h> - -/* Used to checking reference counts, most while doing perl5 stuff :-) */ -# if defined(OPENSSL_NO_STDIO) -# if defined(REF_PRINT) -# error "REF_PRINT requires stdio" -# endif -# endif +# include <openssl/trace.h> # ifndef OPENSSL_DEV_NO_ATOMICS # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \ @@ -176,11 +170,9 @@ typedef int CRYPTO_REF_COUNT; # define REF_ASSERT_ISNT(i) # endif -# ifdef REF_PRINT -# define REF_PRINT_COUNT(a, b) \ - fprintf(stderr, "%p:%4d:%s\n", (void*)b, b->references, a) -# else -# define REF_PRINT_COUNT(a, b) -# endif +# define REF_PRINT_EX(text, count, object) \ + OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text)); +# define REF_PRINT_COUNT(text, object) \ + REF_PRINT_EX(text, object->references, (void *)object) #endif |