Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mem/ex_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type ExVirtualMemory struct {
InactiveAnon uint64 `json:"inactiveanon"`
Unevictable uint64 `json:"unevictable"`
Percpu uint64 `json:"percpu"`
KernelStack uint64 `json:"kernelstack"`
}

func (v ExVirtualMemory) String() string {
Expand Down
6 changes: 6 additions & 0 deletions mem/mem_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ func fillFromMeminfoWithContext(ctx context.Context) (*VirtualMemoryStat, *ExVir
return ret, retEx, err
}
ret.Sunreclaim = t * 1024
case "KernelStack":
t, err := strconv.ParseUint(value, 10, 64)
if err != nil {
return ret, retEx, err
}
retEx.KernelStack = t * 1024
case "PageTables":
t, err := strconv.ParseUint(value, 10, 64)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions mem/mem_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ var virtualMemoryTests = []struct {
InactiveAnon: 1186612 * 1024,
Unevictable: 32 * 1024,
Percpu: 19136 * 1024,
KernelStack: 14224 * 1024,
},
},
{
Expand Down Expand Up @@ -127,6 +128,7 @@ var virtualMemoryTests = []struct {
InactiveAnon: 0,
Unevictable: 0,
Percpu: 0,
KernelStack: 624 * 1024,
},
},
{
Expand Down