Skip to content

Commit ee98c0a

Browse files
committed
add hugetop command
1 parent 5c47122 commit ee98c0a

9 files changed

Lines changed: 700 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ jobs:
5050
- name: build and test all programs separately
5151
shell: bash
5252
run: |
53-
## TODO: add hugetop
5453
set -e
55-
programs="free pgrep pidof pidwait pkill pmap ps pwdx skill slabtop snice sysctl tload top vmstat w watch"
54+
programs="free hugetop pgrep pidof pidwait pkill pmap ps pwdx skill slabtop snice sysctl tload top vmstat w watch"
5655
for program in $programs; do
5756
echo "Building and testing $program"
5857
cargo test -p "uu_$program"

Cargo.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[workspace]
2+
members = ["src/uu/hugetop"]
13
# procps (uutils)
24
# * see the repository LICENSE, README, and CONTRIBUTING files for more information
35

@@ -33,6 +35,7 @@ uudoc = []
3335

3436
feat_common_core = [
3537
"free",
38+
"hugetop",
3639
"pgrep",
3740
"pidof",
3841
"pidwait",
@@ -94,6 +97,7 @@ uucore = { workspace = true }
9497

9598
#
9699
free = { optional = true, version = "0.0.1", package = "uu_free", path = "src/uu/free" }
100+
hugetop = { optional = true, version = "0.0.1", package = "uu_hugetop", path = "src/uu/hugetop" }
97101
pgrep = { optional = true, version = "0.0.1", package = "uu_pgrep", path = "src/uu/pgrep" }
98102
pidof = { optional = true, version = "0.0.1", package = "uu_pidof", path = "src/uu/pidof" }
99103
pidwait = { optional = true, version = "0.0.1", package = "uu_pidwait", path = "src/uu/pidwait" }

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Provides command line and full screen utilities for browsing procfs, a "pseudo"
1313

1414
Ongoing:
1515
* `free`: Shows the amount of free and used memory in the system.
16+
* `hugetop`: Report hugepage usage of processes and the system as a whole.
1617
* `pgrep`: Searches for processes based on name and other attributes.
1718
* `pidof`: Find the process ID of a running program.
1819
* `pidwait`: Waits for a specific process to terminate.
@@ -30,9 +31,6 @@ Ongoing:
3031
* `w`: Shows who is logged on and what they are doing.
3132
* `watch`: Executes a program periodically, showing output fullscreen.
3233

33-
TODO:
34-
* `hugetop`: Report hugepage usage of processes and the system as a whole.
35-
3634
Elsewhere:
3735

3836
* `kill` is already implemented in https://github.com/uutils/coreutils

src/uu/hugetop/Cargo.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[package]
2+
name = "uu_hugetop"
3+
description = "hugetop ~ (uutils) Report hugepage usage for the system and processes"
4+
repository = "https://github.com/uutils/procps/tree/main/src/uu/hugetop"
5+
authors.workspace = true
6+
categories.workspace = true
7+
edition.workspace = true
8+
homepage.workspace = true
9+
keywords.workspace = true
10+
license.workspace = true
11+
version.workspace = true
12+
13+
[lints]
14+
workspace = true
15+
16+
[dependencies]
17+
clap = { workspace = true }
18+
uucore = { workspace = true }
19+
20+
[dev-dependencies]
21+
tempfile = { workspace = true }
22+
23+
[lib]
24+
path = "src/hugetop.rs"
25+
26+
[[bin]]
27+
name = "hugetop"
28+
path = "src/main.rs"

0 commit comments

Comments
 (0)