| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| | |
Co-authored-by: BenBE <BenBE@geshi.org>
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
| |
Quick discussion with Ivan confirmed this was a left-over from
an earlier version of the zswap code and can be safely removed.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This implements our concept of 'dynamic screens' in htop, with a
first use-case of pcp-htop displaying things like top-filesystem
and top-cgroups under new screen tabs. However the idea is more
general than use in pcp-htop and we've paved the way here for us
to collectively build mroe general tabular screens in core htop,
as well.
From the pcp-htop side of things, dynamic screens are configured
using text-based configuration files that define the mapping for
PCP metrics to columns (and metric instances to rows). Metrics
are defined either directly (via metric names) or indirectly via
PCP derived metric specifications. Value scaling and the units
displayed is automatic based on PCP metric units and data types.
This commit represents a collaborative effort of several months,
primarily between myself, Nathan and BenBE.
Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
Signed-off-by: Nathan Scott <nathans@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 SPACESHIP_NUMBER() macro does not work well with floating point
values that are possible to be NaNs. Change the compare logic of all
percentage fields of Process entries to use compareRealNumbers().
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Use saturatingSub() when subtracting CPU time and I/O read/write
bytes of processes so that the values would never go negative (causing unsigned integer wraparound).
* The CPU percentages of processes are now NaN if the time interval
between measures (the "delta time") is zero. Make the conditional
explicit and avoid division by zero. Previously the percentage values
would be 0.0.
Note: The saturatingSub() function is not used in cpu_delay_percent,
blkio_delay_percent and swapin_delay_percent with a comment added that
explains the reason.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
|
|\ \ |
|
| | | |
|
| | | |
|
|/ /
| |
| | |
https://github.com/htop-dev/htop/issues/1223
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Quality improvements from BenBE as part of review for #1234.
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
This removes the duplication of dynamic meter/column hashtable
pointers that has come in between the Settings and ProcessList
structures - only one copy of these is needed. With the future
planned dynamic screens feature adding another pointer, let us
first clean this up before any further duplication happens.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Below is a small example of two threads program, whose main thread
statistics is incorrect in htop. Despite main thread is permanently
sleeping, its CPU load is 100% (must be 0%). CPU load of secondary
thread is correct (100%).
void *thread_func(void *data)
{
while(1) {
}
return NULL;
}
int main()
{
pthread_t thread;
pthread_create(&thread, NULL, thread_func, NULL);
pthread_join(thread, NULL);
}
The reason is in there is a difference in behavior of some files
in /proc/pid and /proc/pid/task/pid directories. For example,
/proc/pid/stat shows agregated user and sys times for all threads
of a process. For the details please see do_task_stat() implementation
and this function behavior difference in dependence of last argument:
https://elixir.bootlin.com/linux/v6.2.8/source/fs/proc/array.c#L652
So, the problem occurs because of user and sys times of main thread are
polluted by secondary thread statistics. This patch fixes the problem
by reading correct stat from /proc/pid/task/pid/stat for main thread.
Looking at other files from /proc/pid directory I found /proc/pid/io
file with the same problem:
https://elixir.bootlin.com/linux/v6.2.8/source/fs/proc/base.c#L3029
This problem is also fixed in this patch by reading correct data
from /proc/pid/task/pid/io file for main thread.
/proc/pid directory files are declared in tgid_base_stuff, while
/proc/pid/task/tid directory files are declared in tid_base_stuff
in kernel's fs/proc/base.c file:
https://elixir.bootlin.com/linux/v6.2.8/source/fs/proc/base.c#L3238
I checked the difference between rest of declarations and it looks like
there is no more problems of such type affecting htop.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
LXC shows the real host CPU ids but can be limited in configuration
as to which cores are used. Still the sysfs files are visible and the
CPUs (stay) marked online. We will need to parse
/sys/devices/system/cpu/online to follow LXC's logic.
Revert for now until we can come up with a better handling of the LXC hacks.
Cf. issue #1195
Essentially reverting 33973f7e and 0d53245c (#993, #995)
|
| |
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
| |
Highlight processes started from binaries with file capabilities set,
like kwin_wayland, or retaining Linux capabilities, via the ambient set,
after switching from the root user, e.g. rtkit.
|
|
|
|
|
|
|
| |
Merge parsing /proc/<pid>/status for context switches, vserver ID and
container detection into one function.
(OpenVZ still does a separate cycle but is left as an exercise for
someone actually using it.)
|
|
|
|
| |
Make them reusable for function defined earlier in the file.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a process column for scheduling policy to show the current
scheduling policy of the process.
Add a the ability to change the scheduling policy of a process via the
key 'Y'.
Currently implemented on Linux and FreeBSD only but should be portable,
since sched_getscheduler(2) is part of POSIX.1-2001.
Closes: #1161
|