mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-04-29 11:14:36 +00:00
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)
This commit is contained in:
parent
f272be676b
commit
f518e3e802
@ -20,28 +20,21 @@
|
|||||||
extern CRYPTO_RWLOCK *global_engine_lock;
|
extern CRYPTO_RWLOCK *global_engine_lock;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we compile with this symbol defined, then both reference counts in the
|
* This prints the engine's pointer address (truncated to unsigned int),
|
||||||
* ENGINE structure will be monitored with a line of output on stderr for
|
* "struct" or "funct" to indicate the reference type, the before and after
|
||||||
* each change. This prints the engine's pointer address (truncated to
|
* reference count, and the file:line-number pair. The "engine_ref_debug"
|
||||||
* unsigned int), "struct" or "funct" to indicate the reference type, the
|
* statements must come *after* the change.
|
||||||
* 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) \
|
# define engine_ref_debug(e, isfunct, diff) \
|
||||||
fprintf(stderr, "engine: %08x %s from %d to %d (%s:%d)\n", \
|
OSSL_TRACE6(ENGINE_REF_COUNT, \
|
||||||
(unsigned int)(e), (isfunct ? "funct" : "struct"), \
|
"engine: %p %s from %d to %d (%s:%d)\n", \
|
||||||
((isfunct) ? ((e)->funct_ref - (diff)) : ((e)->struct_ref - (diff))), \
|
(void *)(e), (isfunct ? "funct" : "struct"), \
|
||||||
|
((isfunct) \
|
||||||
|
? ((e)->funct_ref - (diff)) \
|
||||||
|
: ((e)->struct_ref - (diff))), \
|
||||||
((isfunct) ? (e)->funct_ref : (e)->struct_ref), \
|
((isfunct) ? (e)->funct_ref : (e)->struct_ref), \
|
||||||
(OPENSSL_FILE), (OPENSSL_LINE))
|
(OPENSSL_FILE), (OPENSSL_LINE))
|
||||||
|
|
||||||
# else
|
|
||||||
|
|
||||||
# define engine_ref_debug(e, isfunct, diff)
|
|
||||||
|
|
||||||
# endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Any code that will need cleanup operations should use these functions to
|
* Any code that will need cleanup operations should use these functions to
|
||||||
* register callbacks. engine_cleanup_int() will call all registered
|
* register callbacks. engine_cleanup_int() will call all registered
|
||||||
|
@ -125,6 +125,7 @@ static const struct trace_category_st trace_categories[] = {
|
|||||||
TRACE_CATEGORY_(TLS_CIPHER),
|
TRACE_CATEGORY_(TLS_CIPHER),
|
||||||
TRACE_CATEGORY_(ENGINE_CONF),
|
TRACE_CATEGORY_(ENGINE_CONF),
|
||||||
TRACE_CATEGORY_(ENGINE_TABLE),
|
TRACE_CATEGORY_(ENGINE_TABLE),
|
||||||
|
TRACE_CATEGORY_(ENGINE_REF_COUNT),
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *OSSL_trace_get_category_name(int num)
|
const char *OSSL_trace_get_category_name(int num)
|
||||||
|
@ -38,7 +38,8 @@ extern "C" {
|
|||||||
# define OSSL_TRACE_CATEGORY_TLS_CIPHER 3
|
# define OSSL_TRACE_CATEGORY_TLS_CIPHER 3
|
||||||
# define OSSL_TRACE_CATEGORY_ENGINE_CONF 4
|
# define OSSL_TRACE_CATEGORY_ENGINE_CONF 4
|
||||||
# define OSSL_TRACE_CATEGORY_ENGINE_TABLE 5
|
# define OSSL_TRACE_CATEGORY_ENGINE_TABLE 5
|
||||||
# define OSSL_TRACE_CATEGORY_NUM 6
|
# define OSSL_TRACE_CATEGORY_ENGINE_REF_COUNT 6
|
||||||
|
# define OSSL_TRACE_CATEGORY_NUM 7
|
||||||
|
|
||||||
/* Returns the trace category number for the given |name| */
|
/* Returns the trace category number for the given |name| */
|
||||||
int OSSL_trace_get_category_num(const char *name);
|
int OSSL_trace_get_category_num(const char *name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user