Module: sip-router
Branch: master
Commit: 1006878b21494d11c9f5ac241b79abea92e9f34f
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1006878…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Apr 8 15:31:19 2014 +0200
corex: rpc commands to dump shm status and summary to syslog
---
modules/corex/corex_rpc.c | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/modules/corex/corex_rpc.c b/modules/corex/corex_rpc.c
index 660b80b..969ff31 100644
--- a/modules/corex/corex_rpc.c
+++ b/modules/corex/corex_rpc.c
@@ -28,6 +28,7 @@
#include "../../ut.h"
#include "../../socket_info.h"
#include "../../name_alias.h"
+#include "../../mem/shm_mem.h"
#include "../../rpc.h"
#include "../../rpc_lookup.h"
@@ -145,12 +146,41 @@ static void corex_rpc_list_aliases(rpc_t* rpc, void* ctx)
return;
}
+static const char* corex_rpc_shm_status_doc[2] = {
+ "Trigger shm status dump to syslog",
+ 0
+};
+
+/*
+ * RPC command to dump shm status to syslog
+ */
+static void corex_rpc_shm_status(rpc_t* rpc, void* ctx)
+{
+ shm_status();
+}
+
+static const char* corex_rpc_shm_summary_doc[2] = {
+ "Trigger shm summary dump to syslog",
+ 0
+};
+
+/*
+ * RPC command to dump shm summary to syslog
+ */
+static void corex_rpc_shm_summary(rpc_t* rpc, void* ctx)
+{
+ shm_sums();
+}
rpc_export_t corex_rpc_cmds[] = {
{"corex.list_sockets", corex_rpc_list_sockets,
corex_rpc_list_sockets_doc, 0},
{"corex.list_aliases", corex_rpc_list_aliases,
corex_rpc_list_aliases_doc, 0},
+ {"corex.shm_status", corex_rpc_shm_status,
+ corex_rpc_shm_status_doc, 0},
+ {"corex.shm_summary", corex_rpc_shm_summary,
+ corex_rpc_shm_summary_doc, 0},
{0, 0, 0, 0}
};