LP #993436: pt-summary Memory: Total reports M instead of G

Description

**Reported in Launchpad by Michael Coburn last update 19-06-2012 20:04:12

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

  1. 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

  1. 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

  2. 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

  3. 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
    ========= ======== ================= ============= ============= ===========

  4. 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

  5. Disk Schedulers And Queue Size #############################
    sda | [cfq] 128
    sr0 | [cfq] 128

  6. 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

  7. Kernel Inode State #########################################
    dentry-state | 17856 10199 45 0 0 0
    file-nr | 5344 0 101176
    inode-nr | 23866 11653

  8. LVM Volumes ################################################
    Unable to collect information

  9. LVM Volume Groups ##########################################
    Unable to collect information

  10. RAID Controller ############################################
    Controller | No RAID controller detected

  11. Network Config #############################################
    Controller | Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
    FIN Timeout | 60
    Port Range | 61000

  12. 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

  13. Network Connections ########################################
    Connections from remote IP addresses
    Connections to local IP addresses
    Connections to top 10 local ports
    States of connections
    LISTEN 3

  14. 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

  15. Notable Processes ##########################################
    PID OOM COMMAND
    ? ? sshd doesn't appear to be running

  16. 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

  17. The End ####################################################

Environment

None

Smart Checklist

Activity

lpjirasync January 24, 2018 at 3:34 PM

**Comment from Launchpad by: Daniel Nichter on: 07-05-2012 23:42:04

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

lpjirasync January 24, 2018 at 3:34 PM

**Comment from Launchpad by: Daniel Nichter on: 07-05-2012 23:37:50

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

  1. < Checkpoint Age | 0.00

  2. > 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.

lpjirasync January 24, 2018 at 3:34 PM

**Comment from Launchpad by: Daniel Nichter on: 07-05-2012 23:34:25

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

lpjirasync January 24, 2018 at 3:34 PM

**Comment from Launchpad by: Daniel Nichter on: 07-05-2012 23:28:42

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.

lpjirasync January 24, 2018 at 3:34 PM

**Comment from Launchpad by: Daniel Nichter on: 07-05-2012 23:10:47

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.

Done

Details

Assignee

Reporter

Priority

Smart Checklist

Created January 24, 2018 at 3:34 PM
Updated January 24, 2018 at 3:34 PM
Resolved January 24, 2018 at 3:34 PM