| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
#1211 showed reading /proc/<pid>/status might have a significant
performance impact. Do not read by default only if actually needed,
since the permitted capabilities are no longer gather from it.
Improves: 8ea144df ("Linux: Refactor /proc/<pid>/status parsing")
Improves: #1211
|
|
|
|
|
|
| |
Improve maintainability by reordering calls in
LinuxProcessList_recurseProcTree() to group them by side-effect or
interdependency.
|
|
|
|
|
|
|
|
|
| |
Document for each block gathering information about a task whether the
information is shared for the whole process or specific to a single
userland thread.
Also avoid system calls for process-shared information and reuse the
information from the main task.
|
|
|
|
|
|
|
|
|
| |
#1211 has shown reading /proc/<pid>/status might have a significant
performance impact. It was started to be read by default to gather the
permitted capabilities of the process.
Gather permitted capabilities via the syscall capget(2) instead.
cap_get_proc(3) is not used to avoid linking with -lcap.
|
|
|
|
| |
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
|
|
|
|
|
|
|
|
|
| |
It prints the time in one of these formats: nanoseconds, "fraction of
seconds", "minutes + seconds + milliseconds". If the total time is
greater than 10 minutes, it uses Row_printTime() to print higher time
units.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of the current behavior of dynamic linking against libnl3 and
libnl-genl-3 when configured with --enable-delayacct, load the shared
libraries on request, if any delay accounting related process field is
active, via dlopen(3), similar to libsensors and libsystemd.
Distribution, who currently build htop with --enable-delayacct, need to
explicitly add libnl3 and libnl-genl-3 as runtime dependencies to
continue supporting delay accounting out-of-the-box.
|
|
|
|
|
|
|
| |
Move all the code using libnl functionality into a separate file to ease
modifications.
No functional change.
|
|
|
|
|
|
|
|
|
|
| |
Read htop configuration file in the modern location first
("~/.config/htop/htoprc") before trying the legacy location
("~/.htoprc"). This would prevent a case where configuration files exist
in both locations and the new configuration gets replaced by the old
one.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
Designated initializers are supported in C99 and simplify struct
initializations. All members not explicitly mentioned are default
initialized to 0, and also modern compilers can warn on of those missing
ones.
|
|
|
|
|
|
| |
Only use the environment variables HOME and XDG_CONFIG_HOME, or the home
directory from getpwuid(3) if they are absolute paths.
Avoid different behavior depending on the current working directory.
|
|
|
|
| |
This avoids a compiler warning with GCC 14 and LTO claiming uninitialized use of data[i] in the last loop.
|
|
|
|
|
|
|
|
| |
When starting htop the timestamp of the first scan
must be far in the past to avoid showing all processes as
being started just recently.
Fixes: b61685779cdf696ba4135a97ce66075c337c7562
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is an edge case in xRealloc upon failure to realloc memory
that manifests when the memory area pointed to by ptr contains pointers.
As the structure of ptr is opaque to xRealloc there's no chance for
properly releasing the memory for those indirect pointers.
The best we could do is release ptr itself, leaving behind an
indirect leak of those pointers inside the memory pointed to by ptr.
This memory leak is picked up by analyzers like deepcode and
GCC 14's -fanalyzer, which causes a lengthy, hard-to-parse diagnostic.
Leaving the memory allocated and failing on this code path is
properly ignored though (at least with GCC 14).
A better solution thus is to keep ptr untouched and instead leak the
whole block which avoids this diagnostic on indirectly leaked memory
which is free'd by bailing shortly after anyway.
This is not a fix, neither was the code we had before.
This commit mainly documents an edge case and tries to avoid
some hard-to-understand (but unavoidable) leak by making it
more blatantly obvious in the used tooling.
|
|
|
|
|
|
|
| |
Just call RichString_appendAscii() with the fixed string and avoid an
superfluous snprintf() formatting.
Suggested-by: Explorer09
|
|
|
|
|
|
|
| |
This allows the markdown formatted page to be rendered correctly in
other web frontends, like cgit.
https://git.zx2c4.com/cgit/about/
|
|
|
|
| |
These should not kill the application.
|
| |
|
|
|
|
| |
[ci skip]
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Addresses #1408
|
|
|
|
|
|
| |
Instead of ignoring the standard file descriptors 0, 1 and 2 scan for
GPU usage of a process only if that process had activity last cycle or
its last scan was more than five seconds ago.
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Bail out early if the passed time is 0 and shadow the result.
|
| |
|
|
|
|
|
|
| |
Instead of handling PERCENT_CPU as a special case for whether to align
the title of a dynamically sized column to the right or the left
introduce a new flag, which can be reused by other columns.
|
|
|
|
|
|
|
| |
The difference of scans is useful for utilization calculations.
To avoid divisions by 0 on first scan set monotonicMs also on first
scan.
|
| |
|
|
|
|
| |
The clamping itself has a sanity check when debug mode is active.
|
|
|
|
| |
Because the compilers weren't yet able to optimize this one. :)
|
|
|
|
|
|
|
|
|
|
| |
The passed width should always be at least 4, otherwise printing will
always truncate and lead to an abort().
The passed should not be greater or equal to the available buffer size,
otherwise printing will always truncate and lead to an abort().
Add fallback for non debug builds.
|
|
|
|
|
| |
In case the current CPU usage percentage is NAN the width calculation is
invalid. Use the default with of 4, which is appropriate for "N/A ".
|
|
|
|
|
| |
The GitHub runners for the LLVM jobs are using ubuntu-latest, which is
as of today Ubuntu 22.04 (jammy).
|
|
|
|
|
|
| |
Should be fixed in LLVm 17: https://github.com/llvm/llvm-project/commit/fb77ca05ffb4f8e666878f2f6718a9fb4d686839
This reverts commit 53bd369be760aaeb5e28cb965e9edcfb3f232d92.
|
| |
|
| |
|
| |
|
|
|
|
| |
Closes: #1410
|
| |
|
|\
| |
| |
| | |
of Scrumplex/htop
|
| |
| |
| |
| | |
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
|
|/
|
|
|
|
|
|
| |
Some configuration systems might link a htop configuration file and we
don't really want to replace the symlink but rather its source. This
will also allow us to fail in case the source is read only.
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
|
| |
|
| |
|