diff --git a/bin/pt-summary b/bin/pt-summary index 0b355764..99719b54 100755 --- a/bin/pt-summary +++ b/bin/pt-summary @@ -1443,6 +1443,7 @@ parse_free_minus_b () { local PTFUNCNAME=parse_free_minus_b; name_val "Total" $(shorten $(awk '/Mem:/{print $2}' "${file}") 1) name_val "Free" $(shorten $(awk '/Mem:/{print $4}' "${file}") 1) name_val "Used" "physical = $(shorten ${physical} 1), swap allocated = $(shorten ${swap_alloc} 1), swap used = $(shorten ${swap_used} 1), virtual = ${virtual}" + name_val "Shared" $(shorten $(awk '/Mem:/{print $5}' "${file}") 1) name_val "Buffers" $(shorten $(awk '/Mem:/{print $6}' "${file}") 1) name_val "Caches" $(shorten $(awk '/Mem:/{print $7}' "${file}") 1) name_val "Dirty" "$(awk '/Dirty:/ {print $2, $3}' "${file}")" diff --git a/t/pt-summary/pt-summary.t b/t/pt-summary/pt-summary.t index ecd5ba6c..00e93baa 100644 --- a/t/pt-summary/pt-summary.t +++ b/t/pt-summary/pt-summary.t @@ -17,12 +17,11 @@ my ($tool) = $PROGRAM_NAME =~ m/([\w-]+)\.t$/; use Test::More tests => 2; for my $i (2..3) { - ok( no_diff( sub { print `$trunk/bin/pt-summary --read-samples "$trunk/t/pt-summary/samples/Linux/00$i/" | tail -n+3` }, "t/pt-summary/samples/Linux/output_00$i.txt"), - "--read-samples samples/Linux/00$i works" + "--read-samples samples/Linux/00$i works", ); } diff --git a/t/pt-summary/samples/Linux/003/memory b/t/pt-summary/samples/Linux/003/memory index 3c5302d5..480dea54 100644 --- a/t/pt-summary/samples/Linux/003/memory +++ b/t/pt-summary/samples/Linux/003/memory @@ -1,5 +1,5 @@ total used free shared buffers cached -Mem: 1059586048 236732416 822853632 0 51183616 127881216 +Mem: 1059586048 236732416 822853632 1357284 51183616 127881216 -/+ buffers/cache: 57667584 1001918464 Swap: 2147475456 0 2147475456 MemTotal: 1034752 kB diff --git a/t/pt-summary/samples/Linux/output_002.txt b/t/pt-summary/samples/Linux/output_002.txt index 55c34910..c6742942 100644 --- a/t/pt-summary/samples/Linux/output_002.txt +++ b/t/pt-summary/samples/Linux/output_002.txt @@ -17,6 +17,7 @@ Architecture | CPU = 32-bit, OS = 32-bit Total | 1010.5M Free | 784.4M Used | physical = 226.1M, swap allocated = 2.0G, swap used = 0.0, virtual = 226.1M + Shared | 0.0 Buffers | 48.8M Caches | 122.2M Dirty | 152 kB diff --git a/t/pt-summary/samples/Linux/output_003.txt b/t/pt-summary/samples/Linux/output_003.txt index 9c927b67..9bcbaf48 100644 --- a/t/pt-summary/samples/Linux/output_003.txt +++ b/t/pt-summary/samples/Linux/output_003.txt @@ -17,6 +17,7 @@ Architecture | CPU = 32-bit, OS = 32-bit Total | 1010.5M Free | 784.7M Used | physical = 225.8M, swap allocated = 2.0G, swap used = 0.0, virtual = 225.8M + Shared | 1.3M Buffers | 48.8M Caches | 122.0M Dirty | 80 kB