summaryrefslogtreecommitdiffstats
path: root/linux/LinuxMachine.c
AgeCommit message (Collapse)Author
2024-03-27Linux: Correctly mark trailing offline CPU threadsMartin Rys
2024-03-27Linux: add GPU meter and process columnChristian Göttsche
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
2024-01-25Explicitly check sscanf(3) and fscanf(3) return valuesChristian Göttsche
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.
2024-01-12Fix the display of number of running tasksBenny Baumann
This was broken by a logic change in 72235d8e. Fixes: #1369
2023-12-26Update includes based on IWYUBenny Baumann
2023-12-26Fix code styleBenny Baumann
2023-11-21Remove unused zswap pool size calculation from commit 71f5a80d9eNathan Scott
Quick discussion with Ivan confirmed this was a left-over from an earlier version of the zswap code and can be safely removed.
2023-08-31Rename ProcessList to ProcessTable throughoutNathan Scott
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.
2023-08-30Introduce Row and Table classes for screens beyond top-processesNathan Scott
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.
2023-08-29Rework ZramMeter and remove MeterClass.comprisedValuesExplorer09
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>
2023-08-18Replace isnan() with better comparisons (isgreater(), etc.)Explorer09
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>
2023-06-06Fix Linux running tasks count in the Tasks Meter, a recent regressionNathan Scott
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
2023-05-08Minor whitespace and small logic flow improvements on reviewNathan Scott
Quality improvements from BenBE as part of review for #1234.
2023-05-08Adapt platform code for the new Machine base classNathan Scott
Move host-centric data to new derived <Platform>Machine classes, separate from process-list-centric data.