pt-summary Memory: Total reports M instead of G

Bug #993436 reported by Michael Coburn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
Medium
Daniel Nichter
2.0
Invalid
Undecided
Daniel Nichter
2.1
Fix Released
Medium
Daniel Nichter

Bug Description

It appears that the Memory section of pt-summary is incorrectly reporting total memory. In my case I have an Ubuntu VirtualBox guest with 1024MB RAM so it should say Total 1G but in the Memory section, Total line it reports 1M

# Memory #####################################################
       Total | 1.0M
        Free | 81.3M
        Used | physical = 920.8M, swap allocated = 510.0M, swap used = 41.7M, virtual = 962.5M

root@michael-VirtualBox:~# free
             total used free shared buffers cached
Mem: 1026080 955496 70584 0 146136 500328
-/+ buffers/cache: 309032 717048
Swap: 522236 42392 479844

root@michael-VirtualBox:~# uname -a
Linux michael-VirtualBox 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:50:42 UTC 2011 i686 i686 i386 GNU/Linux
root@michael-VirtualBox:~# tail -1 /etc/apt/sources.list
deb-src http://repo.percona.com/apt oneiric main

root@michael-VirtualBox:~# pt-summary --version
local: 1: 2.1.1: bad variable name
pt-summary

Full command output from pt-summary:

root@michael-VirtualBox:~# PTDEBUG=1; pt-summary
# Percona Toolkit System Summary Report ######################
        Date | 2012-05-02 17:54:59 UTC (local TZ: EDT -0400)
    Hostname | michael-VirtualBox
      Uptime | 5:53, 3 users, load average: 1.31, 1.58, 1.22
      System | innotek GmbH; VirtualBox; v1.2 ()
 Service Tag | 0
    Platform | Linux
     Release | Ubuntu 11.10 (oneiric)
      Kernel | 3.0.0-12-generic
Architecture | CPU = 64-bit, OS = 32-bit
   Threading | NPTL 2.13
     SELinux | No SELinux detected
 Virtualized | VirtualBox
# Processor ##################################################
  Processors | physical = 1, cores = 0, virtual = 1, hyperthreading = no
      Speeds | 1x2240.377
      Models | 1xIntel(R) Core(TM) i3 CPU M 350 @ 2.27GHz
      Caches | 1x6144 KB
# Memory #####################################################
       Total | 1.0M
        Free | 75.2M
        Used | physical = 926.8M, swap allocated = 510.0M, swap used = 44.2M, virtual = 971.0M
     Buffers | 142.6M
      Caches | 481.8M
       Dirty | 116 kB
     UsedRSS | 610.3M
  Swappiness | 60
 DirtyPolicy | 10, 5
 DirtyStatus | 0, 0
  Locator Size Speed Form Factor Type Type Detail
  ========= ======== ================= ============= ============= ===========
# Mounted Filesystems ########################################
  Filesystem Size Used Type Opts Mountpoint
  /dev/sda1 7.4G 52% ext4 rw,errors=remount-ro,commit=0 /
  Downloads 75G 58% vboxsf rw downloads
  none 502M 1% tmpfs rw,noexec,nosuid,nodev,size=5242880 /run/shm
  none 502M 1% tmpfs rw,nosuid,nodev /run/shm
  none 502M 1% debugfs rw /run/shm
  none 502M 1% securityfs rw /run/shm
  none 5.0M 0% tmpfs rw,noexec,nosuid,nodev,size=5242880 /run/lock
  none 5.0M 0% tmpfs rw,nosuid,nodev /run/lock
  none 5.0M 0% debugfs rw /run/lock
  none 5.0M 0% securityfs rw /run/lock
  tmpfs 201M 1% tmpfs rw,noexec,nosuid,size=10%,mode=0755 /run
  udev 495M 1% devtmpfs rw,mode=0755 /dev
# Disk Schedulers And Queue Size #############################
         sda | [cfq] 128
         sr0 | [cfq] 128
# Disk Partioning ############################################
Device Type Start End Size
============ ==== ========== ========== ==================
/dev/sda Disk 8589934592
/dev/sda1 Part 2048 15728639 8052014592
/dev/sda2 Part 15730686 16775167 534774272
/dev/sda5 Part 15730688 16775167 534773248
/dev/sr0 Disk 50776064
# Kernel Inode State #########################################
dentry-state | 17856 10199 45 0 0 0
     file-nr | 5344 0 101176
    inode-nr | 23866 11653
# LVM Volumes ################################################
Unable to collect information
# LVM Volume Groups ##########################################
Unable to collect information
# RAID Controller ############################################
  Controller | No RAID controller detected
# Network Config #############################################
  Controller | Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
 FIN Timeout | 60
  Port Range | 61000
# Interface Statistics #######################################
  interface rx_bytes rx_packets rx_errors tx_bytes tx_packets tx_errors
  ========= ========= ========== ========== ========== ========== ==========
  lo 0 0 0 0 0 0
  eth0 100000000 125000 0 4000000 70000 0
# Network Connections ########################################
  Connections from remote IP addresses
  Connections to local IP addresses
  Connections to top 10 local ports
  States of connections
    LISTEN 3
# Top Processes ##############################################
  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
11165 mysql 20 0 301m 94m 5912 S 9.8 9.5 8:13.34 mysqld
  199 root 20 0 0 0 0 S 3.9 0.0 3:49.19 jbd2/sda1-8
11346 root 20 0 14504 8844 2880 S 3.9 0.9 5:37.23 perl
22824 root 20 0 0 0 0 S 3.9 0.0 0:00.02 kworker/0:1
    1 root 20 0 3320 1628 1264 S 0.0 0.2 0:00.61 init
    2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
    3 root 20 0 0 0 0 S 0.0 0.0 0:01.34 ksoftirqd/0
    5 root 20 0 0 0 0 S 0.0 0.0 0:00.42 kworker/u:0
    6 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
# Notable Processes ##########################################
  PID OOM COMMAND
    ? ? sshd doesn't appear to be running
# Simplified and fuzzy rounded vmstat (wait please) ##########
  procs ---swap-- -----io---- ---system---- --------cpu--------
   r b si so bi bo ir cs us sy il wa st
   1 0 2 4 20 900 350 700 3 5 69 23
   0 0 25 0 25 1500 800 2500 33 27 12 28
   0 0 0 0 0 1000 500 1000 4 5 59 32
   0 0 0 0 0 1000 450 1000 5 5 60 30
   1 0 0 0 0 900 450 900 4 8 26 62
# The End ####################################################

Related branches

tags: added: pt-summary wrong-output
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Invalid in 2.0 (I mistakenly thought pt-summary was redesigned in 2.0).

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

I will backport the 2.1 version of shorten() into 2.0 tools so they have a good shoten() too. Since the tools were rewritten from 2.0 to 2.1, the backport is just copying the shorten() func and nothing else.

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Actually, I'll backport lib/bash/report_formatting.sh and use it entirely in pt-summary and pt-mysql-summary since it's already tested and easy enough to backport.

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

For the record: 2.0.4 doesn't have this bug; it prints 1010.50M.

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

The backport didn't turn out to be so easy because there's little differences like:

# < Checkpoint Age | 0.00
# > Checkpoint Age | 0k

Same value, different representation. Given that this bug isn't actually present in 2.0.4, I'll not fix what isn't broken.

summary: - Memory: Total reports M when it should say G
+ pt-summary Memory: Total reports M instead of G
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Bug 937793 ("pt-mysql-summary : bad size of transaction logs") is related.

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-524

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.