PT-1627 Improve pt-mysql-summary jemalloc detection (#514)

* PT-1627 Changed jemalloc detection function

* Updated Tests
This commit is contained in:
Carlos Salguero
2021-10-01 09:19:25 -03:00
committed by GitHub
parent 9d6508da5f
commit 0d2c48456f
3 changed files with 8 additions and 20 deletions

View File

@@ -2280,12 +2280,14 @@ report_jemalloc_enabled() {
done
if [ $GENERAL_JEMALLOC_STATUS -eq 1 ]; then
JEMALLOC_LOCATION=$(find /usr/lib64/ /usr/lib/x86_64-linux-gnu /usr/lib -name "libjemalloc.*" 2>/dev/null | head -n 1)
if [ -z "$JEMALLOC_LOCATION" ]; then
echo "Jemalloc library not found"
else
echo "Using jemalloc from $JEMALLOC_LOCATION"
fi
for pid in $(pidof mysqld); do
JEMALLOC_LOCATION=$(strings /proc/${pid}/environ | grep jemalloc)
if [ -z "$JEMALLOC_LOCATION" ]; then
echo "Jemalloc library for process ${pid} not found"
else
echo "Process with PID ${pid} is using jemalloc from $JEMALLOC_LOCATION"
fi
done
fi
}