diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util/debug.c | 54 | ||||
-rw-r--r-- | lib/util/debug.h | 34 |
2 files changed, 0 insertions, 88 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c index 80a3460e7a0..77d485f62a4 100644 --- a/lib/util/debug.c +++ b/lib/util/debug.c @@ -1063,57 +1063,3 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func) SAFE_FREE(msgbuf); return ret; } - - -/* the registered mutex handlers */ -static struct { - const char *name; - struct debug_ops ops; -} debug_handlers; - -/** - log suspicious usage - print comments and backtrace -*/ -_PUBLIC_ void log_suspicious_usage(const char *from, const char *info) -{ - if (!debug_handlers.ops.log_suspicious_usage) return; - - debug_handlers.ops.log_suspicious_usage(from, info); -} - - -/** - print suspicious usage - print comments and backtrace -*/ -_PUBLIC_ void print_suspicious_usage(const char* from, const char* info) -{ - if (!debug_handlers.ops.print_suspicious_usage) return; - - debug_handlers.ops.print_suspicious_usage(from, info); -} - -_PUBLIC_ uint32_t get_task_id(void) -{ - if (debug_handlers.ops.get_task_id) { - return debug_handlers.ops.get_task_id(); - } - return getpid(); -} - -_PUBLIC_ void log_task_id(void) -{ - if (!debug_handlers.ops.log_task_id) return; - - if (!reopen_logs_internal()) return; - - debug_handlers.ops.log_task_id(state.fd); -} - -/** - register a set of debug handlers. -*/ -_PUBLIC_ void register_debug_handlers(const char *name, struct debug_ops *ops) -{ - debug_handlers.name = name; - debug_handlers.ops = *ops; -} diff --git a/lib/util/debug.h b/lib/util/debug.h index f7ebfc02695..f393f1b695d 100644 --- a/lib/util/debug.h +++ b/lib/util/debug.h @@ -250,38 +250,4 @@ typedef void (*debug_callback_fn)(void *private_ptr, int level, const char *msg) */ void debug_set_callback(void *private_ptr, debug_callback_fn fn); -/** - log suspicious usage - print comments and backtrace -*/ -_PUBLIC_ void log_suspicious_usage(const char *from, const char *info); - -/** - print suspicious usage - print comments and backtrace -*/ -_PUBLIC_ void print_suspicious_usage(const char* from, const char* info); -_PUBLIC_ uint32_t get_task_id(void); -_PUBLIC_ void log_task_id(void); - -/* the debug operations structure - contains function pointers to - various debug implementations of each operation */ -struct debug_ops { - /* function to log (using DEBUG) suspicious usage of data structure */ - void (*log_suspicious_usage)(const char* from, const char* info); - - /* function to log (using printf) suspicious usage of data structure. - * To be used in circumstances when using DEBUG would cause loop. */ - void (*print_suspicious_usage)(const char* from, const char* info); - - /* function to return process/thread id */ - uint32_t (*get_task_id)(void); - - /* function to log process/thread id */ - void (*log_task_id)(int fd); -}; - -/** - register a set of debug handlers. -*/ -_PUBLIC_ void register_debug_handlers(const char *name, struct debug_ops *ops); - #endif |