summaryrefslogtreecommitdiffstats
path: root/ctdb/include
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2009-11-18 12:44:18 +1100
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2009-11-18 12:44:18 +1100
commitbc2675119df5c2fe0943bcfea0178a1926be6fc7 (patch)
tree968753be6eade458bf87405e5b1aead192eea312 /ctdb/include
parent24c593d21f24c79f1a7b24aa1d1642b41e3f4efa (diff)
add an in memory ringbuffer where we store the last 500000 log entries regardless of log level.
add commandt to extract this in memory buffer and to clear it (This used to be ctdb commit 29d2ee8d9c6c6f36b2334480f646d6db209f370e)
Diffstat (limited to 'ctdb/include')
-rw-r--r--ctdb/include/ctdb_private.h20
-rw-r--r--ctdb/include/includes.h2
2 files changed, 21 insertions, 1 deletions
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h
index 3fcfdfa84f..48fb29bd0a 100644
--- a/ctdb/include/ctdb_private.h
+++ b/ctdb/include/ctdb_private.h
@@ -622,6 +622,8 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS = 0,
CTDB_CONTROL_REGISTER_NOTIFY = 114,
CTDB_CONTROL_DEREGISTER_NOTIFY = 115,
CTDB_CONTROL_TRANS2_ACTIVE = 116,
+ CTDB_CONTROL_GET_LOG = 117,
+ CTDB_CONTROL_CLEAR_LOG = 118,
};
/*
@@ -1520,4 +1522,22 @@ int32_t ctdb_control_deregister_notify(struct ctdb_context *ctdb, uint32_t clien
int start_syslog_daemon(struct ctdb_context *ctdb);
+/* Where to send the log messages back to */
+struct ctdb_get_log_addr {
+ uint32_t pnn;
+ uint64_t srvid;
+ int32_t level;
+};
+
+/* wire data for log entries, padded to uint32 */
+struct ctdb_log_entry_wire {
+ int32_t level;
+ struct timeval t;
+ int32_t message_len;
+ char message[1];
+};
+
+int32_t ctdb_control_get_log(struct ctdb_context *ctdb, TDB_DATA addr);
+int32_t ctdb_control_clear_log(struct ctdb_context *ctdb);
+
#endif
diff --git a/ctdb/include/includes.h b/ctdb/include/includes.h
index 744d117a1a..4b4d2428ef 100644
--- a/ctdb/include/includes.h
+++ b/ctdb/include/includes.h
@@ -28,7 +28,7 @@ enum debug_level {
DEBUG_DEBUG = 4,
};
-#define DEBUG(lvl, x) do { if ((lvl) <= LogLevel) { this_log_level = (lvl); do_debug x; }} while (0)
+#define DEBUG(lvl, x) do { this_log_level = (lvl); log_ringbuffer x; if ((lvl) <= LogLevel) { do_debug x; }} while (0)
#define _PUBLIC_