Commit b922ac98 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Add MGT.child_{start|exit|stop|died|dump|panic} counters

parent eeef8c2b
......@@ -401,6 +401,7 @@ mgt_launch_child(struct cli *cli)
}
assert(pid > 1);
REPORT(LOG_NOTICE, "child (%jd) Started", (intmax_t)pid);
VSC_C_mgt->child_start = ++static_VSC_C_mgt.child_start;
/* Close stuff the child got */
closex(&heritage.std_fd);
......@@ -511,15 +512,21 @@ mgt_reap_child(void)
if (WIFEXITED(status) && WEXITSTATUS(status)) {
VSB_printf(vsb, " status=%d", WEXITSTATUS(status));
exit_status |= 0x20;
if (WEXITSTATUS(status) == 1)
VSC_C_mgt->child_exit = ++static_VSC_C_mgt.child_exit;
else
VSC_C_mgt->child_stop = ++static_VSC_C_mgt.child_stop;
}
if (WIFSIGNALED(status)) {
VSB_printf(vsb, " signal=%d", WTERMSIG(status));
exit_status |= 0x40;
VSC_C_mgt->child_died = ++static_VSC_C_mgt.child_died;
}
#ifdef WCOREDUMP
if (WCOREDUMP(status)) {
VSB_printf(vsb, " (core dumped)");
exit_status |= 0x80;
VSC_C_mgt->child_dump = ++static_VSC_C_mgt.child_dump;
}
#endif
AZ(VSB_finish(vsb));
......@@ -530,6 +537,7 @@ mgt_reap_child(void)
if (heritage.panic_str[0] != '\0') {
mgt_panic_record(r);
mgt_SHM_Destroy(1);
VSC_C_mgt->child_panic = ++static_VSC_C_mgt.child_panic;
} else {
mgt_SHM_Destroy(0);
}
......
......@@ -65,6 +65,31 @@ VSC_F(uptime, uint64_t, 0, 'c',
"Management process uptime",
"Uptime in seconds of the management process"
)
VSC_F(child_start, uint64_t, 0, 'c',
"Child process started",
"Number of times the child process has been started"
)
VSC_F(child_exit, uint64_t, 0, 'c',
"Child process normal exit",
"Number of times the child process has been cleanly stopped"
)
VSC_F(child_stop, uint64_t, 0, 'c',
"Child process unexpected exit",
"Number of times the child process has exited with an unexpected"
" return code"
)
VSC_F(child_died, uint64_t, 0, 'c',
"Child process died (signal)",
"Number of times the child process has died due to signals"
)
VSC_F(child_dump, uint64_t, 0, 'c',
"Child process core dumped",
"Number of times the child process has produced core dumps"
)
VSC_F(child_panic, uint64_t, 0, 'c',
"Child process panic",
"Number of times the management process has caught a child panic"
)
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment