mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-07 12:58:45 +00:00
PT-1627 Improve pt-mysql-summary jemalloc detection (#514)
* PT-1627 Changed jemalloc detection function * Updated Tests
This commit is contained in:
@@ -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
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user