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

Replicate htop's process list/tree options #363

Open
singalen opened this issue Dec 18, 2020 · 3 comments
Open

Replicate htop's process list/tree options #363

singalen opened this issue Dec 18, 2020 · 3 comments
Labels
feature Requests for a new feature.

Comments

@singalen
Copy link

Describe the feature request

What is the feature of interest? Be clear and concise.

htop has a bunch of coloring features that make navigating a large process tree easier:

  • "Shadow other users' processes": draw them in a more dim gray color;
  • "Hide kernel threads" (on by default): only show userspace threads/processes;
  • "Hide userland process threads": only show processes;
  • "Display threads in a different color": helps distinguish threads and only pay attention to processes;
  • "Show custom thread names": useful when processes care to set meaningful thread names;
  • "Show program path" - helps to locate the exact executable for a process;
  • "Highlight program "basename": really helps with a mile-long commands;
  • "Update process names on every refresh": probably useful for processes that do exec().

Additional context/details

I hope the option names are self-explanatory and the demand for them proven by their existence in htop.
Sorry for partially duplicating #228.

@singalen singalen added the feature Requests for a new feature. label Dec 18, 2020
@fosskers
Copy link

Especially hiding kernel threads and highlighting base names.

@rallyram
Copy link

htop's can also show a processes' open file handles, which can be handy

@q3cpma
Copy link

q3cpma commented Aug 28, 2024

Some other stuff missing:

  • nice, ionice/cgroup/OOM score (Linux only), swap, etc... Full list from htop itself:
Available Columns
PID - Process/thread ID
STATE - Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging, I idle)
PPID - Parent process ID
PGRP - Process group ID
SESSION - Process's session ID
TTY - Controlling terminal
TPGID - Process ID of the fg process group of the controlling terminal
MINFLT - Number of minor faults which have not required loading a memory page from disk
CMINFLT - Children processes' minor faults
MAJFLT - Number of major faults which have required loading a memory page from disk
CMAJFLT - Children processes' major faults
UTIME - User CPU time - time the process spent executing in user mode
STIME - System CPU time - time the kernel spent running system calls for this process
CUTIME - Children processes' user CPU time
CSTIME - Children processes' system CPU time
PRIORITY - Kernel's internal priority for the process
NICE - Nice value (the higher the value, the more it lets other processes take priority)
STARTTIME - Time the process was started
PROCESSOR - Id of the CPU the process last executed on
M_VIRT - Total program size in virtual memory
M_RESIDENT - Resident set size, size of the text and data sections, plus stack usage
M_SHARE - Size of the process's shared pages
M_TRS - Size of the .text segment of the process (CODE)
M_DRS - Size of the .data segment plus stack usage of the process (DATA)
M_LRS - The library size of the process (calculated from memory maps)
ST_UID - User ID of the process owner
PERCENT_CPU - Percentage of the CPU time the process used in the last sampling
PERCENT_MEM - Percentage of the memory the process is using, based on resident memory size
USER - Username of the process owner (or user ID if name cannot be determined)
TIME - Total time the process has spent in user and system time
NLWP - Number of threads in the process
TGID - Thread group ID (i.e. process ID)
PERCENT_NORM_CPU - Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)
ELAPSED - Time since the process was started
SCHEDULERPOLICY - Current scheduling policy of the process
RCHAR - Number of bytes the process has read
WCHAR - Number of bytes the process has written
SYSCR - Number of read(2) syscalls for the process
SYSCW - Number of write(2) syscalls for the process
RBYTES - Bytes of read(2) I/O for the process
WBYTES - Bytes of write(2) I/O for the process
CNCLWB - Bytes of cancelled write(2) I/O
IO_READ_RATE - The I/O rate of read(2) in bytes per second for the process
IO_WRITE_RATE - The I/O rate of write(2) in bytes per second for the process
IO_RATE - Total I/O rate in bytes per second
CGROUP - Which cgroup the process is in
OOM - OOM (Out-of-Memory) killer score
IO_PRIORITY - I/O priority
M_PSS - proportional set size, same as M_RESIDENT but each page is divided by the number of processes sharing it
M_SWAP - Size of the process's swapped pages
M_PSSWP - shows proportional swap share of this mapping, unlike "Swap", this does not take into account swapped out page of underlying shmem objects
CTXT - Context switches (incremental sum of voluntary_ctxt_switches and nonvoluntary_ctxt_switches)
SECATTR - Security attribute of the process (e.g. SELinux or AppArmor)
COMM - comm string of the process from /proc/[pid]/comm
EXE - Basename of exe of the process from /proc/[pid]/exe
CWD - The current working directory of the process
AUTOGROUP_ID - The autogroup identifier of the process
AUTOGROUP_NICE - Nice value (the higher the value, the more other processes take priority) associated with the process autogroup
CCGROUP - Which cgroup the process is in (condensed to essentials)
CONTAINER - Name of the container the process is in (guessed by heuristics)
M_PRIV - The private memory size of the process - resident set size minus shared memory
  • A more detailed/shorter state column following what most ps implementations give.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Requests for a new feature.
Projects
None yet
Development

No branches or pull requests

4 participants