-
Notifications
You must be signed in to change notification settings - Fork 302
feature: add support for threads in linux #1793
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
Conversation
a444aa9
to
5207790
Compare
stat, | ||
io, | ||
cmdline, | ||
cmdline, // cmdline is usually empty for kernel threads; could use this to determine that? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
htop decided against this in favour of PF_KTHREAD (freebsd can use sysctl mib afaik for it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for collecting and displaying process threads on Linux platforms through a new --get-threads
command line option. The feature is disabled by default and only available on Linux.
Key changes include:
- New thread collection and display functionality for Linux processes
- UI styling for thread entries to visually distinguish them from regular processes
- Configuration options and command-line flags for enabling thread support
Reviewed Changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/collection/processes/linux/process.rs | Core process parsing logic updated to collect thread information from /proc/<PID>/task |
src/collection/processes/linux/mod.rs | Process collection loop modified to handle threads as separate entries |
src/collection/processes.rs | New ProcessType enum to categorize processes vs threads |
src/widgets/process_table/process_data.rs | Process widget data structure updated with thread styling support |
src/options/args.rs | New --get-threads command line argument added |
src/options/config/process.rs | Configuration support for thread collection setting |
src/canvas/components/data_table/data_type.rs | DataToCell trait extended with cell-level styling capabilities |
Multiple theme files | Thread-specific text styling colors added across all themes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [ClementTsang/bottom](https://github.com/ClementTsang/bottom) | patch | `0.11.1` -> `0.11.2` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>ClementTsang/bottom (ClementTsang/bottom)</summary> ### [`v0.11.2`](https://github.com/ClementTsang/bottom/blob/HEAD/CHANGELOG.md#0112---2025-10-07) [Compare Source](ClementTsang/bottom@0.11.1...0.11.2) ##### Features - [#​1793](ClementTsang/bottom#1793): Add support for threads in Linux. - [#​1719](ClementTsang/bottom#1719): Support ignoring all keypresses. - [#​1772](ClementTsang/bottom#1772): Support hiding kernel threads. ##### Bug Fixes - [#​1800](ClementTsang/bottom#1800): Fix colon at end of process name in Linux. - [#​1804](ClementTsang/bottom#1804): Draw average CPU last again. - [#​1811](ClementTsang/bottom#1811): Fix drawing average CPU in basic mode when dedicated row is enabled. - [#​1817](ClementTsang/bottom#1817): Fix builds for FreeBSD on ARM/PowerPC due to `libc::c_char` data type being different. - [#​1821](ClementTsang/bottom#1821): Use alpha version of ratatui version which fixes drawing at high resolutions. - [#​1827](ClementTsang/bottom#1827): Fix crash for Windows where the network widget could cause a crash if the program started too quickly after boot under certain settings. ##### Other - [#​1801](ClementTsang/bottom#1801): Build and check Windows ARM. - [#​1816](ClementTsang/bottom#1816): Optimize username cloning on Unix. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNDEuMCIsInVwZGF0ZWRJblZlciI6IjQxLjE0MS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Description
A description of the change, what it does, and why it was made. If relevant (such as any change that modifies the UI), please provide screenshots of the changes:
This PR adds process thread support for just Linux (default off, can be enabled with
--get-threads
). I can explore this for other operating systems later.Examples:
With tree on:
Tree off:
Issue
If applicable, what issue does this address?
Part of #228
Testing
If relevant, please state how this was tested. All changes must be tested to work:
If this is a code change, please also indicate which platforms were tested:
Checklist
If relevant, ensure the following have been met:
cargo fmt
)README.md
, help menu, doc pages, etc.)