Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] add cgroup column #529

Closed
beelze opened this issue Sep 13, 2023 · 4 comments
Closed

[FR] add cgroup column #529

beelze opened this issue Sep 13, 2023 · 4 comments

Comments

@beelze
Copy link

beelze commented Sep 13, 2023

Thanks for the great tool - nice replacement for good old ps!
Though, It would be nice to have an ability to add cgroup column to output. htop implemented a good approach for it – «raw» and «compact» values:

CGROUP
Which cgroup the process is in. For a shortened view see the CCGROUP column below.
CCGROUP
Shortened view of the cgroup name that the process is in. This performs some pattern-based replacements 
to shorten the displayed string and thus condense the information.

/*.slice is shortened to /[*] (exceptions below)
/system.slice is shortened to /[S]
/user.slice is shortened to /[U]
/user-*.slice is shortened to /[U:*] (directly preceding /[U] before dropped)
/machine.slice is shortened to /[M]
/machine-*.scope is shortened to /[SNC:*] (SNC: systemd nspawn
container), uppercase for the monitor
/lxc.monitor.* is shortened to /[LXC:*]
/lxc.payload.* is shortened to /[lxc:*]
/*.scope is shortened to /!*
/*.service is shortened to /* (suffix removed)

Encountered escape sequences (e.g. from systemd) inside the cgroup name are not decoded.
dalance added a commit that referenced this issue Oct 17, 2023
@dalance
Copy link
Owner

dalance commented Oct 17, 2023

Thank you for your suggestion!
I added cgroup and ccgroup column.

@beelze
Copy link
Author

beelze commented Oct 19, 2023

Thanks!
But tried to build 0.14.2 I got errors like:

error[E0658]: use of unstable library feature 'local_key_cell_methods'
  --> src/./columns/group.rs:42:46
   |
42 |             if let Some(group) = USERS_CACHE.with_borrow_mut(|x| x.get_group_by_gid(gid)) {
   |                                              ^^^^^^^^^^^^^^^
   |
   = note: see issue #92122 <https://github.com/rust-lang/rust/issues/92122> for more information

@dalance
Copy link
Owner

dalance commented Oct 20, 2023

procs v0.14.2 requires Rust 1.73.
I released v0.14.3 which can be built on Rust 1.67.

@beelze
Copy link
Author

beelze commented Oct 20, 2023

Sorry, missed the dependency. Successfully built with Rust 1.73, works like a charm. Thanks!

@beelze beelze closed this as completed Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants