[sr-dev] git:4.4:cda757b6: core: fix mem_summary comparation when SIGUSR1 is received

Victor Seva linuxmaniac at torreviejawireless.org
Wed May 24 11:52:55 CEST 2017


Module: kamailio
Branch: 4.4
Commit: cda757b682e0a61a9e9c9e6e9f83be4f899aa364
URL: https://github.com/kamailio/kamailio/commit/cda757b682e0a61a9e9c9e6e9f83be4f899aa364

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2017-05-24T11:51:58+02:00

core: fix mem_summary comparation when SIGUSR1 is received

>From http://www.kamailio.org/wiki/cookbooks/4.4.x/core#mem_summary
 1 - dump all the pkg used blocks (status)
 2 - dump all the shm used blocks (status)
 4 - summary of pkg used blocks
 8 - summary of shm used blocks

(cherry picked from commit b8750364571beeca6612b31a2948d62bddedc805)

---

Modified: main.c

---

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

---

diff --git a/main.c b/main.c
index 8b2e8e8af9..b6f68df1a4 100644
--- a/main.c
+++ b/main.c
@@ -709,7 +709,7 @@ void handle_sigs(void)
 				LOG(memlog, "Memory status (pkg):\n");
 				pkg_status();
 			}
-			if (cfg_get(core, core_cfg, mem_summary) & 2) {
+			if (cfg_get(core, core_cfg, mem_summary) & 4) {
 				LOG(memlog, "Memory still-in-use summary (pkg):\n");
 				pkg_sums();
 			}
@@ -717,11 +717,11 @@ void handle_sigs(void)
 #endif
 #ifdef SHM_MEM
 		if (memlog <= cfg_get(core, core_cfg, debug)){
-			if (cfg_get(core, core_cfg, mem_summary) & 1) {
+			if (cfg_get(core, core_cfg, mem_summary) & 2) {
 				LOG(memlog, "Memory status (shm):\n");
 				shm_status();
 			}
-			if (cfg_get(core, core_cfg, mem_summary) & 2) {
+			if (cfg_get(core, core_cfg, mem_summary) & 8) {
 				LOG(memlog, "Memory still-in-use summary (shm):\n");
 				shm_sums();
 			}
@@ -821,7 +821,7 @@ void sig_usr(int signo)
 							LOG(memlog, "Memory status (pkg):\n");
 							pkg_status();
 						}
-						if (cfg_get(core, core_cfg, mem_summary) & 2) {
+						if (cfg_get(core, core_cfg, mem_summary) & 4) {
 							LOG(memlog, "Memory still-in-use summary (pkg):"
 									"\n");
 							pkg_sums();
@@ -840,7 +840,7 @@ void sig_usr(int signo)
 							LOG(memlog, "Memory status (pkg):\n");
 							pkg_status();
 						}
-						if (cfg_get(core, core_cfg, mem_summary) & 2) {
+						if (cfg_get(core, core_cfg, mem_summary) & 4) {
 							LOG(memlog, "Memory still-in-use summary (pkg):\n");
 							pkg_sums();
 						}




More information about the sr-dev mailing list