Skip to content

Commit

Permalink
Merge pull request prometheus#103 from eminence/meminfo
Browse files Browse the repository at this point in the history
Add two new fields to Meminfo struct
  • Loading branch information
eminence committed Oct 4, 2020
2 parents 582ddab + 8bb00a1 commit fb918c5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/meminfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,16 @@ pub struct Meminfo {
///
/// Includes s_reclaimable, and other direct allocations with a shrinker.
pub k_reclaimable: Option<u64>,

/// Undocumented field
///
/// (CONFIG_TRANSPARENT_HUGEPAGE is requried. Since Linux 5.4)
pub file_pmd_mapped: Option<u64>,

/// Undocumented field
///
/// (CONFIG_TRANSPARENT_HUGEPAGE is required. Since Linux 5.4)
pub file_huge_pages: Option<u64>,
}

impl Meminfo {
Expand Down Expand Up @@ -367,6 +377,8 @@ impl Meminfo {
k_reclaimable: map.remove("KReclaimable"),
per_cpu: map.remove("Percpu"),
hugetlb: map.remove("Hugetlb"),
file_pmd_mapped: map.remove("FilePmdMapped"),
file_huge_pages: map.remove("FileHugePages"),
};

if cfg!(test) && !map.is_empty() {
Expand Down

0 comments on commit fb918c5

Please sign in to comment.