PT-2340 - Support MySQL 8.4

- Moved data collection for THP from lib/bash/report_system_info.sh to lib/bash/collect_system_info.sh, so pt-summary reports THP status on the machine where samples were collected, not on the machine where an engineer examines samples.
This commit is contained in:
Sveta Smirnova
2024-09-06 13:08:45 +03:00
parent c3f327d53b
commit ea6bd77501
46 changed files with 8470 additions and 32 deletions

View File

@@ -906,6 +906,8 @@ collect_system_data () { local PTFUNCNAME=collect_system_data;
fio_status_minus_a "$data_dir/fusion-io_card"
cat /sys/kernel/mm/transparent_hugepage/enabled >"$data_dir/transparent_hugepage" 2>/dev/null
for file in $data_dir/*; do
[ "$file" = "vmstat" ] && continue
[ ! -s "$file" ] && rm "$file"
@@ -2338,23 +2340,21 @@ report_system_summary () { local PTFUNCNAME=report_system_summary;
"$platform"
section "Memory management"
report_transparent_huge_pages
report_transparent_huge_pages "$data_dir/transparent_hugepage"
section "The End"
}
report_transparent_huge_pages () {
local file="$1"
if [ -f /sys/kernel/mm/transparent_hugepage/enabled ]; then
CONTENT_TRANSHP=$(</sys/kernel/mm/transparent_hugepage/enabled)
STATUS_THP_SYSTEM=$(echo $CONTENT_TRANSHP | grep -cv '\[never\]')
fi
if [ $STATUS_THP_SYSTEM = 0 ]; then
echo "Transparent huge pages are currently disabled on the system."
else
echo "Transparent huge pages are enabled."
fi
[ -e "$file" ] || return
if [ $(grep -cv '\[never\]' $file) = 0 ]; then
echo "Transparent huge pages are currently disabled on the system."
else
echo "Transparent huge pages are enabled."
fi
}
# ###########################################################################