debug: Remove thread-related code from debug.c
authorVolker Lendecke <vl@samba.org>
Wed, 30 Jul 2014 10:19:58 +0000 (10:19 +0000)
committerVolker Lendecke <vl@samba.org>
Thu, 31 Jul 2014 14:20:53 +0000 (16:20 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jul 31 16:20:53 CEST 2014 on sn-devel-104

lib/util/debug.c
lib/util/debug.h

index 80a3460e7a0c71dd6e70e4d6b8ae80130cb4e79b..77d485f62a455215676f29ccdcd780c6f5bbfa13 100644 (file)
@@ -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;
-}
index f7ebfc026959f053a918ee9b0ce35ba0ab4840f1..f393f1b695d91b8c0722cd19c67f32f7b9d07fcc 100644 (file)
@@ -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