Skip to content

Commit

Permalink
slabtop: fix incorrect data.
Browse files Browse the repository at this point in the history
  • Loading branch information
Krysztal112233 committed Apr 16, 2024
1 parent 1c3231c commit b142ea3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/uu/slabtop/src/slabtop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ fn percentage(numerator: u64, denominator: u64) -> f64 {
fn output(info: &SlabInfo) {
for name in info.names() {
let objs = info.fetch(name, "num_objs").unwrap_or_default();
let active = info.fetch(name, "num_objs").unwrap_or_default();
// FIXME: There ware sometime NaN.
let active = info.fetch(name, "active_objs").unwrap_or_default();
let used = format!("{:.0}%", percentage(active, objs));
let objsize = {
let size = info.fetch(name, "objsize").unwrap_or_default(); // Byte to KB :1024
Expand Down

0 comments on commit b142ea3

Please sign in to comment.