Module: kamailio Branch: master Commit: b8750364571beeca6612b31a2948d62bddedc805 URL: https://github.com/kamailio/kamailio/commit/b8750364571beeca6612b31a2948d62b...
Author: Victor Seva linuxmaniac@torreviejawireless.org Committer: Victor Seva linuxmaniac@torreviejawireless.org Date: 2017-05-23T18:14:56+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
---
Modified: src/main.c
---
Diff: https://github.com/kamailio/kamailio/commit/b8750364571beeca6612b31a2948d62b... Patch: https://github.com/kamailio/kamailio/commit/b8750364571beeca6612b31a2948d62b...
---
diff --git a/src/main.c b/src/main.c index 3fdf070054..0aff706ffb 100644 --- a/src/main.c +++ b/src/main.c @@ -710,7 +710,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(); } @@ -718,11 +718,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(); } @@ -834,7 +834,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(); @@ -853,7 +853,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(); }
On 05/23/2017 06:16 PM, Victor Seva wrote:
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
There were several messages in the ML about SIGUSR1 and memlog not working when I tried myself I notice it wasn't. I dug a bit and found out the values of mem_summary comparation were wrong.
I will backport this fix to 4.4 and 5.0 tomorrow if no one objects