diff --git a/meminfo.go b/meminfo.go index db1daea5..73a03e8a 100644 --- a/meminfo.go +++ b/meminfo.go @@ -126,6 +126,7 @@ type Meminfo struct { VmallocUsed *uint64 // largest contiguous block of vmalloc area which is free VmallocChunk *uint64 + Percpu *uint64 HardwareCorrupted *uint64 AnonHugePages *uint64 ShmemHugePages *uint64 @@ -178,6 +179,7 @@ type Meminfo struct { VmallocTotalBytes *uint64 VmallocUsedBytes *uint64 VmallocChunkBytes *uint64 + PercpuBytes *uint64 HardwareCorruptedBytes *uint64 AnonHugePagesBytes *uint64 ShmemHugePagesBytes *uint64 @@ -339,6 +341,9 @@ func parseMemInfo(r io.Reader) (*Meminfo, error) { case "VmallocChunk:": m.VmallocChunk = &val m.VmallocChunkBytes = &valBytes + case "Percpu:": + m.Percpu = &val + m.PercpuBytes = &valBytes case "HardwareCorrupted:": m.HardwareCorrupted = &val m.HardwareCorruptedBytes = &valBytes diff --git a/meminfo_test.go b/meminfo_test.go index 2d2b238e..3d3b4093 100644 --- a/meminfo_test.go +++ b/meminfo_test.go @@ -53,6 +53,7 @@ func TestMeminfo(t *testing.T) { VmallocTotal: newuint64(34359738367), VmallocUsed: newuint64(36596), VmallocChunk: newuint64(34359637840), + Percpu: newuint64(26176), HardwareCorrupted: newuint64(0), AnonHugePages: newuint64(12288), HugePagesTotal: newuint64(0), @@ -96,6 +97,7 @@ func TestMeminfo(t *testing.T) { VmallocTotalBytes: newuint64(35184372087808), VmallocUsedBytes: newuint64(37474304), VmallocChunkBytes: newuint64(35184269148160), + PercpuBytes: newuint64(26804224), HardwareCorruptedBytes: newuint64(0), AnonHugePagesBytes: newuint64(12582912), HugepagesizeBytes: newuint64(2097152), diff --git a/testdata/fixtures.ttar b/testdata/fixtures.ttar index 92f72fa2..67065168 100644 --- a/testdata/fixtures.ttar +++ b/testdata/fixtures.ttar @@ -2317,7 +2317,7 @@ unused devices: Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/proc/meminfo -Lines: 42 +Lines: 43 MemTotal: 15666184 kB MemFree: 440324 kB Buffers: 1020128 kB @@ -2351,6 +2351,7 @@ Committed_AS: 530844 kB VmallocTotal: 34359738367 kB VmallocUsed: 36596 kB VmallocChunk: 34359637840 kB +Percpu: 26176 kB HardwareCorrupted: 0 kB AnonHugePages: 12288 kB HugePages_Total: 0