[sr-dev] git:master:cf085a87: core: Enable SIGUSR1 for child processes

Alex Hermann alex at speakup.nl
Tue Aug 30 13:51:39 CEST 2016


Module: kamailio
Branch: master
Commit: cf085a870e33bcdef5dad91a3de92f25e159e669
URL: https://github.com/kamailio/kamailio/commit/cf085a870e33bcdef5dad91a3de92f25e159e669

Author: Alex Hermann <alex at speakup.nl>
Committer: Alex Hermann <alex at speakup.nl>
Date: 2016-08-02T12:46:37+02:00

core: Enable SIGUSR1 for child processes

Allow dumping of memory statistics during runtime

---

Modified: main.c

---

Diff:  https://github.com/kamailio/kamailio/commit/cf085a870e33bcdef5dad91a3de92f25e159e669.diff
Patch: https://github.com/kamailio/kamailio/commit/cf085a870e33bcdef5dad91a3de92f25e159e669.patch

---

diff --git a/main.c b/main.c
index 7993590..887a58a 100644
--- a/main.c
+++ b/main.c
@@ -833,7 +833,20 @@ void sig_usr(int signo)
 					_exit(0);
 					break;
 			case SIGUSR1:
-				/* statistics, do nothing, printed only from the main proc */
+#ifdef PKG_MALLOC
+					cfg_update_no_cbs();
+					memlog=cfg_get(core, core_cfg, memlog);
+					if (memlog <= cfg_get(core, core_cfg, debug)){
+						if (cfg_get(core, core_cfg, mem_summary) & 1) {
+							LOG(memlog, "Memory status (pkg):\n");
+							pkg_status();
+						}
+						if (cfg_get(core, core_cfg, mem_summary) & 2) {
+							LOG(memlog, "Memory still-in-use summary (pkg):\n");
+							pkg_sums();
+						}
+					}
+#endif
 					break;
 				/* ignored*/
 			case SIGUSR2:




More information about the sr-dev mailing list