devstack/lib/dstat
Ihar Hrachyshka 2b4735f1b3 Added list of mlock-using processes to peakmem_tracker output
The change makes peakmem_tracker list processes that lock memory pages
from swapping to disk. It may be helpful when debugging oom-killer job
failures in gate in case when dstat shows that swap is not fully used
when oom-killer is triggered.

The peakmem_tracker service was renamed into memory_tracker to reflect
its new broader scope.

Needed-By: I5862d92478397eac2e61b8a61ce3437b698678be
Change-Id: I1dca120448ee87930fe903fd81277b58efaefc92
2017-03-05 15:50:59 +00:00

44 lines
1.1 KiB
Bash

#!/bin/bash
#
# lib/dstat
# Functions to start and stop dstat
# Dependencies:
#
# - ``functions`` file
# ``stack.sh`` calls the entry points in this order:
#
# - start_dstat
# - stop_dstat
# Save trace setting
_XTRACE_DSTAT=$(set +o | grep xtrace)
set +o xtrace
# start_dstat() - Start running processes, including screen
function start_dstat {
# A better kind of sysstat, with the top process per time slice
run_process dstat "$TOP_DIR/tools/dstat.sh $LOGDIR"
# To enable memory_tracker add:
# enable_service memory_tracker
# to your localrc
run_process memory_tracker "$TOP_DIR/tools/memory_tracker.sh"
# remove support for the old name when it's no longer used (sometime in Queens)
if is_service_enabled peakmem_tracker; then
deprecated "Use of peakmem_tracker in devstack is deprecated, use memory_tracker instead"
run_process peakmem_tracker "$TOP_DIR/tools/memory_tracker.sh"
fi
}
# stop_dstat() stop dstat process
function stop_dstat {
stop_process dstat
stop_process memory_tracker
}
# Restore xtrace
$_XTRACE_DSTAT