./pt-summary: line 2262: STATUS_THP_SYSTEM: unbound variable

Bug #1654668 reported by Marcelo Altmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Committed
Medium
Carlos Salguero

Bug Description

pt-summary will report unbound variable on RHEL type of systems:

./pt-summary: line 2262: STATUS_THP_SYSTEM: unbound variable

report_transparent_huge_pages () {

  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

}

Above function will test if /sys/kernel/mm/transparent_hugepage/enabled exists. If it does, it will initiate CONTENT_TRANSHP and STATUS_THP_SYSTEM, then outside the if it will test it. On RHEL, THP is reported as /sys/kernel/mm/redhat_transparent_hugepage/enabled

Changed in percona-toolkit:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Carlos Salguero (carlos-salguero)
milestone: none → 2.2.21
Revision history for this message
Marcelo Altmann (marcelo.altmann) wrote :
Changed in percona-toolkit:
status: Triaged → In Progress
Revision history for this message
Carlos Salguero (carlos-salguero) wrote :

Thanks for the fix. It is already merged in the 2.2 branch

Changed in percona-toolkit:
status: In Progress → Fix Committed
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-724

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.