summaryrefslogtreecommitdiffstats
path: root/linux/LinuxMachine.c
Commit message (Collapse)AuthorAgeFilesLines
* Linux: Correctly mark trailing offline CPU threadsMartin Rys2024-03-271-7/+18
|
* Linux: add GPU meter and process columnChristian Göttsche2024-03-271-0/+10
| | | | | | | Based on the DRM client usage stats[1] add statistics for GPU time spend and percentage utilization. [1]: https://www.kernel.org/doc/html/latest/gpu/drm-usage-stats.html
* Explicitly check sscanf(3) and fscanf(3) return valuesChristian Göttsche2024-01-251-6/+6
| | | | | | | | | Compare the return value of sscanf(3) and fscanf(3) explicitly against the expected number of parsed items and avoid implicit boolean conversion. Such an implicit conversion would treat EOF (-1) the same as at least one item parsed successfully. Reported by CodeQL.
* Fix the display of number of running tasksBenny Baumann2024-01-121-2/+1
| | | | | | This was broken by a logic change in 72235d8e. Fixes: #1369
* Update includes based on IWYUBenny Baumann2023-12-261-5/+7
|
* Fix code styleBenny Baumann2023-12-261-55/+56
|
* Remove unused zswap pool size calculation from commit 71f5a80d9eNathan Scott2023-11-211-20/+0
| | | | | Quick discussion with Ivan confirmed this was a left-over from an earlier version of the zswap code and can be safely removed.
* Rename ProcessList to ProcessTable throughoutNathan Scott2023-08-311-2/+2
| | | | | | | | | | | | Following up with some discusson from a few months back, where it was proposed that ProcessTable is a better name. This data structure is definitely not a list ... if it was one-dimensional it'd be a set, but in practice it has much more in common with a two-dimensional table. The Process table is a familiar operating system concept for many people too so it resonates a little in that way as well.
* Introduce Row and Table classes for screens beyond top-processesNathan Scott2023-08-301-1/+2
| | | | | | | | | This commit refactors the Process and ProcessList structures such they each have a new parent - Row and Table, respectively. These new classes handle screen updates relating to anything that could be represented in tabular format, e.g. cgroups, filesystems, etc, without us having to reimplement the display logic repeatedly for each new entity.
* Rework ZramMeter and remove MeterClass.comprisedValuesExplorer092023-08-291-0/+3
| | | | | | | | | | | | The 'comprisedValues' boolean property unnecessarily complicates the drawing algorithms of Bar meters and Graph meters. Since the only user of 'comprisedValues' is ZramMeter, it is better to rework the meter so that it no longer needs 'comprisedValues'. The 'values[ZRAM_METER_UNCOMPRESSED]' now stores the difference between uncompressed and compressed data size. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Replace isnan() with better comparisons (isgreater(), etc.)Explorer092023-08-181-1/+2
| | | | | | | | | | | | | | | | | | The standard isnan() function is defined to never throw FP exceptions even when the argument is a "signaling" NaN. This makes isnan() more expensive than (x != x) expression unless the compiler flag '-fno-signaling-nans' is given. Introduce functions isNaN(), isNonnegative(), isPositive(), sumPositiveValues() and compareRealNumbers(), and replace isnan() in htop's codebase with the new functions. These functions utilize isgreater() and isgreaterequal() comparisons, which do not throw FP exceptions on "quiet" NaNs, which htop uses extensively. With isnan() removed, there is no need to suppress the warning '-Wno-c11-extensions' in FreeBSD. Remove the code from 'configure.ac'. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Fix Linux running tasks count in the Tasks Meter, a recent regressionNathan Scott2023-06-061-1/+1
| | | | | | | | | | | | | | The recent split of machine-wide metric gathering from process metrics gathering introduced a regression in the Linux running task accounting. The way we extract this value from /proc/stat (which typically is used for machine-wide metrics) conspired with a now-incorrectly placed init- to-zero at the start of the per-process sampling, caused this value to always be zero by the time the Tasks Meter used it. Fix this by making it much more clear that Linux has this special case handling of runningTasks. Resolves #1256
* Minor whitespace and small logic flow improvements on reviewNathan Scott2023-05-081-1/+1
| | | | Quality improvements from BenBE as part of review for #1234.
* Adapt platform code for the new Machine base classNathan Scott2023-05-081-0/+707
Move host-centric data to new derived <Platform>Machine classes, separate from process-list-centric data.

© 2014-2024 Faster IT GmbH | imprint | privacy policy