From 55373642db08adec858a497bf375478542d064a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Monteiro?= Date: Thu, 3 Nov 2022 10:57:36 +0000 Subject: [PATCH] util: remove unused enter debug exit loggers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: António Monteiro Reviewed-by: Marek Olšák Part-of: --- src/util/u_debug.c | 41 ----------------------------------------- src/util/u_debug.h | 38 -------------------------------------- 2 files changed, 79 deletions(-) diff --git a/src/util/u_debug.c b/src/util/u_debug.c index 773b03a5679..b0ce238d7df 100644 --- a/src/util/u_debug.c +++ b/src/util/u_debug.c @@ -462,44 +462,3 @@ comma_separated_list_contains(const char *list, const char *s) return false; } - - -#ifdef DEBUG -int fl_indent = 0; -const char* fl_function[1024]; - -int -debug_funclog_enter(const char* f, UNUSED const int line, - UNUSED const char* file) -{ - int i; - - for (i = 0; i < fl_indent; i++) - debug_printf(" "); - debug_printf("%s\n", f); - - assert(fl_indent < 1023); - fl_function[fl_indent++] = f; - - return 0; -} - -void -debug_funclog_exit(const char* f, UNUSED const int line, - UNUSED const char* file) -{ - --fl_indent; - assert(fl_indent >= 0); - assert(fl_function[fl_indent] == f); -} - -void -debug_funclog_enter_exit(const char* f, UNUSED const int line, - UNUSED const char* file) -{ - int i; - for (i = 0; i < fl_indent; i++) - debug_printf(" "); - debug_printf("%s\n", f); -} -#endif diff --git a/src/util/u_debug.h b/src/util/u_debug.h index 43cab29429e..43b2a41e19d 100644 --- a/src/util/u_debug.h +++ b/src/util/u_debug.h @@ -348,44 +348,6 @@ parse_enable_string(const char *debug, bool comma_separated_list_contains(const char *list, const char *s); - -/** - * Function enter exit loggers - */ -#ifdef DEBUG -int debug_funclog_enter(const char* f, const int line, const char* file); -void debug_funclog_exit(const char* f, const int line, const char* file); -void debug_funclog_enter_exit(const char* f, const int line, const char* file); - -#define DEBUG_FUNCLOG_ENTER() \ - int __debug_decleration_work_around = \ - debug_funclog_enter(__FUNCTION__, __LINE__, __FILE__) -#define DEBUG_FUNCLOG_EXIT() \ - do { \ - (void)__debug_decleration_work_around; \ - debug_funclog_exit(__FUNCTION__, __LINE__, __FILE__); \ - return; \ - } while(0) -#define DEBUG_FUNCLOG_EXIT_RET(ret) \ - do { \ - (void)__debug_decleration_work_around; \ - debug_funclog_exit(__FUNCTION__, __LINE__, __FILE__); \ - return ret; \ - } while(0) -#define DEBUG_FUNCLOG_ENTER_EXIT() \ - debug_funclog_enter_exit(__FUNCTION__, __LINE__, __FILE__) - -#else -#define DEBUG_FUNCLOG_ENTER() \ - int __debug_decleration_work_around -#define DEBUG_FUNCLOG_EXIT() \ - do { (void)__debug_decleration_work_around; return; } while(0) -#define DEBUG_FUNCLOG_EXIT_RET(ret) \ - do { (void)__debug_decleration_work_around; return ret; } while(0) -#define DEBUG_FUNCLOG_ENTER_EXIT() -#endif - - /** * Get option. *