summaryrefslogtreecommitdiffstats
path: root/src/app/data_harvester/processes.rs
AgeCommit message (Collapse)Author
2023-02-10feature: Add support for displaying process usernames on Windows (#1016)Michael Bikovitsky
2022-09-16deps: update sysinfo to 0.26.2 (#806)Clement Tsang
* deps: update sysinfo to 0.26.2 This dependency update has some nice things in store for us: - MacOS M1 temperature support - Bevy of bug fixes * update documentation * some fixes
2022-07-23Implement support for FreeBSD (#766)Wesley Moore
* WIP FreeBSD support * Implement get_cpu_data_list for FreeBSD * Implement disks for FreeBSD It doesn't work though as sysinfo doesn't make the device name available. * Use libxo to read process cpu info on FreeBSD * Populate get_io_usage with libxo too Actual I/O stats still aren't populated though as there's not an easy source for them. * Share more processes code between macos and freebsd * Extract function for deserializing libxo output on FreeBSD * Implement filtering of disks in FreeBSD * Clean up memory data collection * Update module docs
2022-06-02refactor: unify all mod.rs structure to 2018 style (#742)Clement Tsang
This is a pretty small change, but at least _for now_, unifies all `mod.rs` use cases to the 2018 style for consistency. I personally don't mind going back to it on a case-by-case basis in the future if it results in cleaner code, though.
2021-05-15refactor: split up data collection by OS (#482)Clement Tsang
Refactor to split up data collection by OS and/or the backing library. The goal is to make it easier to work with and add new OS support, as opposed to how it was prior where we stored OS-independent implementations all in the same file.
2021-05-13refactor: switch to procfs library (#479)Clement Tsang
Switch the Linux proc parts to the procfs library: https://crates.io/crates/procfs.
2021-05-08deps: Update dependencies 2021-05-08 (#466)Clement Tsang
Did not update crossterm (and tui-rs) since it seems to have resulted in a massive CPU usage increase. Also fix minor clippy error with a duplicated to_string call.
2021-04-04refactor: Switch from fnv to fxhash (#444)Clement Tsang
Switches to fxhash from fnv, which should be a bit faster.
2021-04-04feature: Rework network y-axis, linear interpolation for off-screen data (#437)Clement Tsang
Rewrite of the y-axis labeling and scaling for the network widget, along with more customization. This still has one step to be optimized (cache results so we don't have to recalculate the legend each time), but will be done in another PR for sake of this one being too large already. Furthermore, this change adds linear interpolation at the 0 point in the case a data point shoots too far back - this seems to have lead to ugly gaps to the left of graphs in some cases, because the left hand limit was not big enough for the data point. We address this by grabbing values just outside the time range and linearly interpolating at the leftmost limit. This affects all graph widgets (CPU, mem, network). This can be optimized, and will hopefully be prior to release in a separate change.
2021-03-23bug: Fix getpwuid segfault (#440)Zeb Piasecki
Fixes a rare segfault if a uid does not have a passwd entry. The unsafe block at https://github.com/ClementTsang/bottom/blob/master/src/app/data_harvester/processes.rs#L137 can return a null pointer as specified at https://www.gnu.org/software/libc/manual/html_node/Lookup-User.html.
2021-02-28feature: User info in proc widget for Unix-based systems (#425)Clement Tsang
Adds users into the process widget (for Unix-based systems). This shows only in non-grouped modes, similar to state. Search is also supported. In addition, a quick fix to prevent users from being in grouped mode when they tried to enter tree mode while grouped.
2021-01-21feature: Use `ps` as fallback to query CPU usage under macOS (#390)Frederick Zhang
When running without elevated permissions under macOS, sysinfo cannot query states of processes by root user, which results in 0.0% CPU usage for all this kind of processes (and state = Unknown). Here we use `ps`, which has SUID, as a fallback to query CPU usages. This can be potentially applied to other properties if needed in the future (we'll need a proper struct and parser).
2020-12-27feature: Adds uid and gid collection (no GUI yet) (#375)Clement Tsang
Just adds uid and gid collection to the process collection step. This does not add GUI changes, that'll come later.
2020-12-11refactor: Another small optimization pass (#350)Clement Tsang
Making some small changes that would hopefully improve performance a bit. - Remove redundant string generations for CPU data conversion - Switch to fnv for PID hashmap and hashsets - Use buffered reading to avoid having to store too many lines as strings
2020-12-10bug: Fix some performance regressions (#344)Clement Tsang
Fixes some performance regressions and forgotten cleanup. Changes to attempt to improve performance to match 0.4.x: - Remove `trace!` and `--debug` for now. These were a significant hog. Removing this dropped initial memory usage by about half. - Add additional cleaning step for `pid_mapping` during process harvesting. This should hopefully improve memory usage as time goes on. - Slightly change how we do sorting to hopefully be a bit more optimal? This was just an easy change to make that I spotted. - Fix broken cleaning child thread task.
2020-12-03refactor: Clean up some parts of data harvesting (#336)Clement Tsang
2020-11-30refactor: Simplify data harvesting (#335)Clement Tsang
Refactors the data harvesting system function names.
2020-11-22other: Switch to once_cell (#324)Clement Tsang
Switch from lazy_static to once_cell.
2020-10-02bug: terminate threads, fix blocking poll in input (#262)Clement Tsang
Bug fix for improper use of threads, where they were not properly terminated (not really too bad) and the input thread code actually blocked.
2020-10-01bug: use cmdline for Linux proc name if >=15 chars (#261)Clement Tsang
This was the cause of some process names getting cut off and looking weird for Linux (and Linux only, I'm not directly responsible for the other OSes). This also adds spaces in between command line flags. Before, they were usually separated by either spaces (which looked fine) or null terminators (which meant it looked like something was broken).
2020-09-30Use tmp_dir rather than /tmp/ (#260)Clement Tsang
Uses a less hard-coded method of writing to /tmp/.
2020-09-09refactor: rename data harvesting fns to what archs/oses they support (#229)Clement Tsang
Just a simple rename.
2020-09-06feature: Adds tree view (#223)Clement Tsang
Adds a tree process view to bottom. Currently uses a pretty jank method of column width setting, should get fixed in #225.
2020-08-31refactor: Update error messages w/ anyhow and thiserror (#216)Clement Tsang
Refactoring and updating of error messages + tests to be more useful.
2020-08-25bug: fix grouping being broken after refactor (#201)0.4.6Clement Tsang
Fixes grouping not working properly after some refactoring done in 0.4.6.
2020-08-22feature: allow searching by state, add more keyword variantsClement Tsang
Allows searching by state (`state = sleep`), and adds more keyword variants for searching: `cpu%`, `mem%`, `r/s`, `w/s`, matching the columns.
2020-08-21feature: Support memb (mem bytes) searching in processesClement Tsang
Supports searching by the new mem value.
2020-08-21refactor: Remove ps callsClement Tsang
Removes and refactor ps calls that... should have not been there in the first place.
2020-08-17feature: Add appox. total mem as an option for processes and basic memClement Tsang
Adds a way to display the memory value as a column in the processes widget and the basic memory widget, rather than just the percentage.
2020-08-16bug: Fix bug w/ parsing `/proc/{pid}/stats` Clement Tsang
Fixes a bug caused by incorrectly reading the `/proc/{pid}/stats` file. Due to splitting by whitespace, the string parsing was read incorrectly if the process also contained spaces.
2020-08-15feature: Allow sorting by any columnClement Tsang
This feature allows any column to be sortable. This also adds: - Inverting sort for current column with `I` - Invoking a sort widget with `s` or `F6`. Close with same key or esc. And: - A bugfix in regards the basic menu and battery widget - A lot of refactoring
2020-08-07feature: add full command to process widgetClement Tsang
This PR adds the ability to toggle between the process name and process path. Currently, this uses `P` as the modifier key. Currently, the longer command names are dealt with by forcefully changing the width of the columns, but this can be handled in a more graceful manner IMO.
2020-05-21bug: fix incorrect parsing for process i/o calcClementTsang
Cause was checking the wrong indices for values. I thought I had taken in a vector of strings that were just byte values, but they actually contained the labels... oops.
2020-05-16change: remove slash, change scroll behaviour on cpuClement Tsang
- Removal of the old slash-space-to-hide behaviour of CPU widget - Scrolling onto a specific entry will only show that entry - Showing average is now default
2020-05-14deps: update sysinfoClementTsang
2020-05-13bug: add extra check for process cpu value to be >= 0ClementTsang
2020-04-11feature: Show process state (#114)Clement Tsang
This is not 100% finished and will be refined in the future, as I plan to do a bit of an overhaul on how the process widget is going to look and functionality. In particular, tabbed is currently kinda just slapped together (I just combine all the states together as one big string). However, it is enough to work and show state normally...
2020-04-10feature: add io and io/s for processes (#113)Clement Tsang
2020-04-01Add modularity to widget placement and inclusion (#95)Clement Tsang
2020-03-13Cleanup before modularity (#84)Clement Tsang
* Uptick some crates, update README dependencies * Cleanup before modularity feature. * Fix missing reset zoom on reset * Fixed reset... not resetting search or data displayed * Cleaned up options a tiny bit to make more sense. * Cleaned up some TODOs and the like. * specify only build master branch.
2020-03-02Refactoring.ClementTsang
2020-03-02Refactoring.ClementTsang
2020-02-28rustfmtClementTsang
2020-02-28Optimized imports as per clionClementTsang
2020-02-17Some clippy and refactoring.ClementTsang
2020-02-15Some refactoring... I also tried to make the processes part mutlithreaded, ↵ClementTsang
but that saved negliglble time and increase cpu usage...
2020-02-11Potential fix for strange use% in macos...?ClementTsang
2020-02-11Add current cpu total flag to other OSClementTsang
2020-02-10More clippy fixing.ClementTsang
2020-02-10Major refactoring to appease clippy; potential reintroduction of hjkl keys ↵ClementTsang
to navigate widgets...