summaryrefslogtreecommitdiffstats
path: root/crypto/engine
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2018-12-13 01:42:46 +0100
committerRichard Levitte <levitte@openssl.org>2019-03-06 11:15:14 +0100
commitf518e3e802d8dcad283be6cb4913dd7cfc6f11fd (patch)
tree01905857cb72901d88ccb918eb87599917c518c8 /crypto/engine
parentf272be676b5462db641897057a4feaa9e8f35c1d (diff)
Adapt ENGINE_REF_COUNT_DEBUG to the new generic trace API
Co-authored-by: Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8198)
Diffstat (limited to 'crypto/engine')
-rw-r--r--crypto/engine/eng_int.h33
1 files changed, 13 insertions, 20 deletions
diff --git a/crypto/engine/eng_int.h b/crypto/engine/eng_int.h
index 7bb1d73680..d45617567c 100644
--- a/crypto/engine/eng_int.h
+++ b/crypto/engine/eng_int.h
@@ -20,27 +20,20 @@
extern CRYPTO_RWLOCK *global_engine_lock;
/*
- * If we compile with this symbol defined, then both reference counts in the
- * ENGINE structure will be monitored with a line of output on stderr for
- * each change. This prints the engine's pointer address (truncated to
- * unsigned int), "struct" or "funct" to indicate the reference type, the
- * before and after reference count, and the file:line-number pair. The
- * "engine_ref_debug" statements must come *after* the change.
+ * This prints the engine's pointer address (truncated to unsigned int),
+ * "struct" or "funct" to indicate the reference type, the before and after
+ * reference count, and the file:line-number pair. The "engine_ref_debug"
+ * statements must come *after* the change.
*/
-# ifdef ENGINE_REF_COUNT_DEBUG
-
-# define engine_ref_debug(e, isfunct, diff) \
- fprintf(stderr, "engine: %08x %s from %d to %d (%s:%d)\n", \
- (unsigned int)(e), (isfunct ? "funct" : "struct"), \
- ((isfunct) ? ((e)->funct_ref - (diff)) : ((e)->struct_ref - (diff))), \
- ((isfunct) ? (e)->funct_ref : (e)->struct_ref), \
- (OPENSSL_FILE), (OPENSSL_LINE))
-
-# else
-
-# define engine_ref_debug(e, isfunct, diff)
-
-# endif
+# define engine_ref_debug(e, isfunct, diff) \
+ OSSL_TRACE6(ENGINE_REF_COUNT, \
+ "engine: %p %s from %d to %d (%s:%d)\n", \
+ (void *)(e), (isfunct ? "funct" : "struct"), \
+ ((isfunct) \
+ ? ((e)->funct_ref - (diff)) \
+ : ((e)->struct_ref - (diff))), \
+ ((isfunct) ? (e)->funct_ref : (e)->struct_ref), \
+ (OPENSSL_FILE), (OPENSSL_LINE))
/*
* Any code that will need cleanup operations should use these functions to