Module: kamailio
Branch: master
Commit: cf085a870e33bcdef5dad91a3de92f25e159e669
URL:
https://github.com/kamailio/kamailio/commit/cf085a870e33bcdef5dad91a3de92f2…
Author: Alex Hermann <alex(a)speakup.nl>
Committer: Alex Hermann <alex(a)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/cf085a870e33bcdef5dad91a3de92f2…
Patch:
https://github.com/kamailio/kamailio/commit/cf085a870e33bcdef5dad91a3de92f2…
---
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: