| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
`__STDC_VERSION__` will be defined as 202311L for C23.
|
|
|
|
|
|
| |
Inspired by: https://github.com/hishamhm/htop/pull/848
Closes: #542
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
All uses of meter drawing "mode" numbers now have the type
`MeterModeId`, including the uses in structures and arrays.
`MeterModeId` is defined as `unsigned int`, as (currently) it doesn't
save any code size by defining it to any smaller type.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
|
|
|
|
|
| |
This is a prerequisite to using MeterModeId type in more headers, to
avoid header dependency hell.
|
|
|
|
|
|
|
|
|
|
|
| |
All client codes that access this global `Meter_modes` array have been
replaced in previous commits, thus it's no longer necessary to keep
this internal information (draw functions, default heights, etc.)
public. It was also a bad idea when the client codes need to avoid
accessing `Meter_modes[0]` (which is reserved and contains null
information) by themselves.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
|
|
|
|
|
| |
This section reordering is a prerequisite to privatizing the
`Meter_modes` array.
|
|
|
|
|
|
|
| |
The Meter objects have their own 'h' properties.
Avoid access to the `Meter_modes` array.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
|
|
|
|
|
|
|
| |
The Meter objects have their own 'h' properties.
Avoid access to the `Meter_modes` array.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
|
|
|
|
| |
Meter mode ID 0 will now be reserved.
|
|
|
|
|
|
|
|
|
|
|
| |
Let the respective `MeterClass.updateMode` functions initialize the
meter mode instead. The `updateMode` function is always called after the
`MeterClass.init` function by `Meter_new()`.
This not only simplifies the init functions of meter subclasses, but
avoids the use of the global `Meter_modes` array when it's unnecessary.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The use of CUSTOM_METERMODE value in meter default mode was a bad
design. There are no meter that really has a "custom" mode to work with
and currently that value serves as a useless placeholder that hides the
real default mode for a meter.
Replace CUSTOM_METERMODE in `defaultMode` of all meters with the real
intended default modes. Currently only CPU meters and MemorySwapMeter
used this, and their real defaults are BAR_METERMODE.
In Meter_setMode(), remove the special treatment of `defaultMode ==
CUSTOM_METERMODE`, Meter_setMode() still calls the `updateMode` function
for custom treatment when it's present for a meter class.
As CUSTOM_METERMODE is obsolete from `defaultMode`, the init functions
of CPU meters and MemorySwapMeter need to be adjusted to avoid
incomplete initialization (Meter.draw function bring NULL).
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
|
|\ |
|
| | |
|
| |
| |
| |
| | |
Only happens with LTO, -fanalyzer, and -fsanitize=address,leak
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Deprecate the use of 'st' and other names. The 'sb' name is often seen
in example codes in Linux man pages. (The 'statbuf' name is sometimes
also used but I choose 'sb' name because it's shorter.)
No code changes.
|
|/
|
|
|
|
|
|
|
|
|
| |
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.
|
|\ |
|
| |
| |
| |
| |
| | |
and a reference of the last tag, the changes since then and the
dirty flag from `git describe`
|
|\ \ |
|
| |/ |
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Settings_write() is called on a crash inside of a signal handler. Using
fprintf(3) is not safe to call ins signal handlers due to file buffering
and memory allocations.
Format messages in signal handlers via snprintf(3) and output them via
write(2) on crash.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
fprintf(3) is not safe to call ins signal handlers due to file buffering
and memory allocations.
Format messages in signal handlers via snprintf(3) and output them via
write(2).
|
|\ \ \ |
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Check whether the configuration file (after symlink resolution) is
writable and is a regular file on htop startup, and only then, write the
configuration on exit.
Also permit reading when the legacy configuration file ("~/.htoprc") is
a symlink. Write the new configuration only when both the legacy file
and the new location are writable.
Thanks to Christian Göttsche (@cgzones) for providing the initial
version of the patch.
Fixes: #1426
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
|
| |/
|/|
| |
| |
| |
| |
| | |
Fixes regression caused by 15b4bc45b2b0ccf2
Fixes: #1449
Co-authored-by: Kang-Che Sung <explorer09@gmail.com>
|
| |
| |
| |
| | |
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
|
|/
|
|
|
|
|
|
|
| |
Recently FreeBSD updated its Autoconf package to 2.72 and removed the
old Autoconf-2.71 package. This caused build error in our CI jobs.
Remove the Autoconf version number from FreeBSD and DragonFlyBSD jobs.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
|
|
|
|
|
| |
Handle corrupted data in /proc/tty/drivers, either via injection or
buffer truncation.
|
|
|
|
| |
Suggested by Benny Baumann (@BenBE). No code changes.
|
|
|
|
|
| |
While both pointers are identical, GCC-14 with -fanalyzer complains about these return statements to leak memory.
The leak is only reported with LTO though.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Percentage column was always broken, time column needs to be adjusted
after recent formatting changes.
|
|
|
|
|
|
| |
Don't print twice for 0.9s.
Don't truncate on 1.2s, leading to an abort.
|
|\ |
|
|/ |
|
|
|
|
|
| |
Might be useful for some users and for debugging the
hideRunningInContainer detection.
|
|
|
|
|
|
|
| |
Container engines like docker and podman rely on Linux namespaces. If
available check if the target process is inside a different PID
namespace than htop. This check will mark sandbox'ed applications, e.g.
under bubblewrap, but not light-wight containers, like distrobox.
|
|
|
|
|
|
|
|
|
| |
#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.
|