summaryrefslogtreecommitdiff
path: root/lib/debug.h
diff options
context:
space:
mode:
authorJafar Al-Gharaibeh <jafar@atcorp.com>2024-08-29 11:51:53 -0400
committerGitHub <noreply@github.com>2024-08-29 11:51:53 -0400
commit77e1a26faa3c153abf6a8abb858f435914b62625 (patch)
tree1dd71e3d2cdb29b7c406b6a21351b2e89cb50831 /lib/debug.h
parentf1e4ef461d5bd39a9ad96c4116c2c869e4f37737 (diff)
parent830972cab211a2f7ad82d7635ad9111afac8f47b (diff)
Merge pull request #16664 from mjstapp/igor_debug_simplify
*: simplify frrlib debug
Diffstat (limited to 'lib/debug.h')
-rw-r--r--lib/debug.h49
1 files changed, 14 insertions, 35 deletions
diff --git a/lib/debug.h b/lib/debug.h
index e9d8a31abd..eee314cff5 100644
--- a/lib/debug.h
+++ b/lib/debug.h
@@ -34,6 +34,7 @@ extern "C" {
#define DEBUG_OPT_NONE 0x00000000
+PREDECL_LIST(debug_list);
/*
* Debugging record.
*
@@ -63,37 +64,18 @@ extern "C" {
* manipulate the flags field in a multithreaded environment results in
* undefined behavior.
*
+ * conf
+ * The configuration string that will be written to the config file.
+ *
* desc
* Human-readable description of this debugging record.
*/
struct debug {
atomic_uint_fast32_t flags;
+ const char *conf;
const char *desc;
-};
-PREDECL_LIST(debug_cb_list);
-/*
- * Callback set for debugging code.
- *
- * debug_set_all
- * Function pointer to call when the user requests that all debugs have a
- * mode set.
- */
-struct debug_callbacks {
- /*
- * Linked list of Callbacks to call
- */
- struct debug_cb_list_item item;
-
- /*
- * flags
- * flags to set on debug flag fields
- *
- * set
- * true: set flags
- * false: unset flags
- */
- void (*debug_set_all)(uint32_t flags, bool set);
+ struct debug_list_item item;
};
/*
@@ -217,22 +199,19 @@ struct debug_callbacks {
#define DEBUGN(name, fmt, ...) DEBUG(notice, name, fmt, ##__VA_ARGS__)
#define DEBUGD(name, fmt, ...) DEBUG(debug, name, fmt, ##__VA_ARGS__)
+/* Show current debugging status. */
+void debug_status_write(struct vty *vty);
+
/*
- * Optional initializer for debugging. Highly recommended.
- *
- * This function installs common debugging commands and allows the caller to
- * specify callbacks to take when these commands are issued, allowing the
- * caller to respond to events such as a request to turn off all debugs.
- *
- * MT-Safe
+ * Register a debug item.
*/
-void debug_init(struct debug_callbacks *cb);
+void debug_install(struct debug *debug);
/*
- * Turn on the cli to turn on/off debugs.
- * Should only be called by libfrr
+ * Initialize debugging.
+ * Should only be called by libfrr.
*/
-void debug_init_cli(void);
+void debug_init(void);
#ifdef __cplusplus
}