Skip to content
Open
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 Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/uu/hugetop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ version.workspace = true
workspace = true

[dependencies]
chrono = { workspace = true }
clap = { workspace = true }
uucore = { workspace = true }

Expand Down
11 changes: 4 additions & 7 deletions src/uu/hugetop/src/hugetop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

use chrono::{DateTime, Local};
use clap::{value_parser, Arg, Command};
use std::collections::BTreeMap;
use std::fs;
use std::path::Path;
use std::thread::sleep;
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use std::time::Duration;
use uucore::error::UResult;

const DEFAULT_HUGEPAGES_ROOT: &str = "/sys/kernel/mm/hugepages";
Expand Down Expand Up @@ -122,12 +123,8 @@ pub fn uu_app() -> Command {
}

fn print_summary(numa: bool, human: bool) {
let now = SystemTime::now()
.duration_since(UNIX_EPOCH)
.map(|d| d.as_secs())
.unwrap_or_default();

println!("hugetop - {}", now);
let now: DateTime<Local> = Local::now();
println!("hugetop - {}", now.format("%a %b %e %T %Y"));

let pools = match read_node_hugepage_pools() {
Ok(nodes) if numa => {
Expand Down
Loading