Skip to content

Commit

Permalink
core: Enable SIGUSR1 for child processes
Browse files Browse the repository at this point in the history
Allow dumping of memory statistics during runtime

(cherry picked from commit cf085a8)
  • Loading branch information
gaaf authored and miconda committed Sep 8, 2016
1 parent 4c930dc commit 5654760
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion main.c
Expand Up @@ -832,7 +832,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:
Expand Down

0 comments on commit 5654760

Please sign in to comment.