| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
It is inappropriate to use the 'fd' name for 'FILE*' variables.
POSIX file descriptiors are of type 'int' and are distinguished from
ISO C stream pointers (type 'FILE*').
Rename these variables to 'fp', which is a preferred naming in POSIX.
(Note that ISO C preferred the 'stream' name for the variables.)
No code changes.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Shared memory is less available than buffers, so move it
left next to used memory.
This is in preparation for including shared memory in the
basic "in use" for the bar text. It would not make sense
to sum a discontiguous region.
|
|\
| |
| |
| | |
into BenBE-style-header-consistency
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Coverity scanning shows we end up passing an integer into the
Row_setPidColumnWidth routine which requires a pid_t - update
each platform to return the correct type (and never return -1
as a failure code, this was being ignored).
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|/
|
| |
https://github.com/htop-dev/htop/issues/1223
|
|
|
|
|
| |
Move host-centric data to new derived <Platform>Machine classes,
separate from process-list-centric data.
|
|
|
|
|
|
|
|
|
|
|
| |
First stage in sanitizing the process list structure so that htop
can support other types of lists too (cgroups, filesystems, ...),
in the not-too-distant future.
This introduces struct Machine for system-wide information while
keeping process-list information in ProcessList (now much less).
Next step is to propogate this separation into each platform, to
match these core changes.
|
| |
|
|
|
|
|
|
|
| |
On Linux, use zswap to populate "compressed memory" metrics added in the
previous commit.
Fixes #104.
|
|
|
|
|
|
|
|
| |
For now, the semantics are mostly fit for Linux zswap subsystem. For
instance, we add the third swap usage metric that indicates the amount
of memory that is accounted to swap but in fact stored elsewhere. This
exactly matches the definition of frontswap/zswap, and is probably of
little use to all other platforms.
|
| |
|
|
|
|
|
|
| |
Show both compressed and uncompressed bars.
Closes: #1216
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* declare read-only pointer parameter const
* drop duplicate include of <errno.h>
* use String_startsWith
|
|
|
|
|
|
|
|
|
|
|
|
| |
The linux kernel recently gained a new PSI meter, namely
a new /proc/pressure/irq meter has been added [1]:
full avg10=0.00 avg60=0.00 avg300=0.00 total=100648410
This commit adds support for this PSI meter by adding a
PressureStallIRQFullMeter_class.
[1] https://github.com/torvalds/linux/commit/52b1364ba0b105122d6de0e719b36db705011ac1
|
| |
|
|
|
|
| |
Also reflow it to not be absolutely bonkers
|
|
|
|
| |
Doubly meaningless since the IDs are now per-FD
|
|
|
|
|
|
| |
It's an artefact of the previous implementation of
Platform_getProcessLocks for Linux, and is never used;
there's no reason for it to have ever been exported
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of filtering the global /proc/locks by PID-that-locked
(which is different than the process that holds it for inherited
flock(2)s and always literal -1 for fcntl(F_OFD_SETLK)s),
just look at the locks on open files
For a process with:
$ head /proc/$$/fdinfo/{9,10,11}
==> /proc/797393/fdinfo/9 <==
pos: 0
flags: 0100000
mnt_id: 2775
lock: 1: FLOCK ADVISORY WRITE 818754 00:69:7 0 EOF
==> /proc/797393/fdinfo/10 <==
pos: 0
flags: 0100000
mnt_id: 127
lock: 1: FLOCK ADVISORY WRITE 828244 00:30:509028 0 EOF
lock: 2: OFDLCK ADVISORY READ -1 00:30:509028 0 199
==> /proc/797393/fdinfo/11 <==
pos: 0
flags: 0100000
mnt_id: 2775
lock: 1: FLOCK ADVISORY WRITE 935925 00:69:1187 0 EOF
Instead of:
No locks have been found for the selected process.
I now observe:
1 FLOCK ADVISORY WRITE 00:30:00000000000000509028 0 <END OF FILE> /home/nabijaczleweli/.feeds
1 FLOCK ADVISORY WRITE 00:69:00000000000000000007 0 <END OF FILE> /home/nabijaczleweli/uwu/mart.html
1 FLOCK ADVISORY WRITE 00:69:00000000000000001187 0 <END OF FILE> /home/nabijaczleweli/uwu/removedfile (deleted)
2 OFDLCK ADVISORY READ 00:30:00000000000000509028 0 199 /home/nabijaczleweli/.feeds
This also fixes an obvious issue where the filename for fd 0 would
never be resolved
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This includes:
- Wrap function implementations
- Pointer alignment for function signatures
- Pointer alignment for variable declarations
- Whitespace after keywords
- Whitespace after comma
- Whitespace around initializers
- Whitespace around operators
- Code indentation
- Line break for single line statements
- Misleading alignment
|
|
|
|
|
|
|
| |
CRT.c:1015:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
void CRT_done() {
^
void
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
At the moment this is used to make the memory meter report sane values even
if the host has ZFS and that leaks through into a containerized environment
Fixes #863
Includes a clever check for magic PROC_PID_INIT_INO in /proc/self/ns/pid thanks to Pavel Snajdr (snajpa)
|
|
|
|
|
| |
The default htop command process field has the enum identifier `COMM`
but the name `Command` (`COMM` is the field name for /proc/<PID>/comm).
|
| |
|
|
|
|
|
|
|
|
|
| |
Not all batteries entries in /sys/class/power_supply start with either
BAT or AC, but might have device specific names, e.g. CMB1.
Detect the types of those entries and parse them accordingly.
Closes: #881
Fixes: 3e70de64 ("Code clean up for reading battery info")
|
|
|
|
| |
This is a forward port (by nathans) of Hisham's original code.
|
| |
|
| |
|
| |
|