Commit Graph

2579 Commits

Author SHA1 Message Date
Daniel Lange 4cb2b5fc1c Merge branch 'fix_zfs_arc_ratio_color' of overhacked/htop 2021-02-09 20:02:13 +01:00
Ross Williams f73c98abd4 Forgot to correctly color ZFS ARC ratio
`ZFS_RATIO` in `CRT.c` was unused, because I forgot
to colorize the ARC ratio in the Compressed ARC meter.

The intent was to improve readability of the meter by
highlighting the most relevant value, the ratio, in
a brighter color, for most themes. This change effects
that intent.
2021-02-09 17:07:00 +00:00
Christian Göttsche f273bfd083 Linux: restore memory calculation regarding HugePages
Subtract the total amount of huge page memory from total and used memory.

Restores behavior from #450 (see also #447)

Follow-up of 3d497a37
2021-02-09 16:01:05 +01:00
Daniel Lange 7ba3396a4c Update ChangeLog and report credits for the MemAvailable issue and initial implementation 2021-02-09 13:24:01 +01:00
Daniel Lange 69d3b9ccf1 Merge branch 'mem' of cgzones/htop
* Use MemAvailable info from Linux 3.14+ where available
* Thanks to Chris Cheney for reporting and Tomas Wido for an initial implementation

Closes #281
Closes #385
2021-02-09 13:15:52 +01:00
Daniel Lange e86acd6893 Remove force sort order to ASC when returning to tree mode
Bug found by BenBE via IRC
2021-02-07 13:46:57 +01:00
Christian Göttsche 3d497a3760 Linux: overhaul memory partition
Use similar calculation than procps.
Show AvailableMemory in text mode.
Use total minus available memory instead of manually computed used-
memory as fraction part in bar mode (if available).
2021-02-07 12:41:52 +01:00
Daniel Lange 0d67263b36 Merge branch 'stderr_cache' of cgzones/htop 2021-02-06 16:10:22 +01:00
Christian Göttsche 7b1fa1bf49 Cache stderr to be able to print assert messages 2021-02-05 19:21:28 +01:00
Christian Göttsche fd2a0cf421 FreeBSD: add support for CPU frequency and temperature 2021-02-05 16:32:25 +01:00
Christian Göttsche 64a1ab848f configure: ignore usage of C11 _Generic on FreeBSD
BatteryMeter.c:30:8: error: '_Generic' is a C11 extension [-Werror,-Wc11-extensions]
   if (isnan(percent)) {
       ^
/usr/include/math.h:114:2: note: expanded from macro 'isnan'
        __fp_type_select(x, __inline_isnanf, __inline_isnan, __inline_isnanl)
        ^
/usr/include/math.h:82:39: note: expanded from macro '__fp_type_select'
#define __fp_type_select(x, f, d, ld) _Generic((x),                     \
                                      ^
1 error generated.
2021-02-05 15:20:00 +01:00
Christian Göttsche cae47bb28d configure: add -lelf for static build on FreeBSD 2021-02-05 15:15:01 +01:00
Christian Göttsche fd4e6b432b Use MainPanel type in State struct
The State struct holds a pointer to the main process panel.
Use the distinct MainPanel type, to improve maintainability regrading
its usage.
This avoids usages of down-casts from Panel to MainPanel, only up-casts
from MainPanel to Panel are now required.
2021-02-05 14:12:49 +01:00
Daniel Lange fd1ad863dc Merge branch 'lsb' of eworm-de/htop (skip "n/a" values for SysArchMeter) 2021-02-04 17:27:16 +01:00
Christian Hesse 85a855f5b2 SysArchMeter: skip "n/a" values
Unavailable values are returned as "n/a" from lsb_release, skip these.

$ lsb_release -a
LSB Version:    1.4
Distributor ID: Arch
Description:    Arch Linux
Release:        rolling
Codename:       n/a
2021-02-04 13:26:39 +01:00
Daniel Lange 8fb51627b2 Improve initial setup for systems with many CPUs
Resolves #435
2021-02-02 18:03:17 +01:00
Daniel Lange b612256486 Leave less right margin next to long (text) meters 2021-02-02 11:07:29 +01:00
Daniel Lange ba630e8ad5 Make descriptions to -shelp available so people find threads
Fixes #511
2021-02-02 10:08:59 +01:00
Daniel Lange ef87877826 Fix typo, align with man page, drop dots 2021-02-02 10:08:59 +01:00
Daniel Lange f3eab4e796 Explain historic naming of Light-Weight Processes column aka threads 2021-02-02 10:08:59 +01:00
Daniel Lange de3e271206 Merge branch 'comm' of cgzones/htop
Already in Debian so making sure upstream has it, too
2021-02-02 09:56:32 +01:00
Benny Baumann 12208af777 DiD: Avoid negative cmdlineBasenameOffset 2021-02-01 22:09:39 +01:00
Daniel Lange 12f5f06e88 Check for sortTimeout to not run towards -inf
Seems to happen on Mac OS "Big Sur" (~forced application sleep)
Partial fix for #510
2021-02-01 16:02:31 +01:00
Daniel Lange 3808b3b553 Remove unused key definitions 2021-02-01 16:01:04 +01:00
BenBE 06b5828dc4
Fix Shift+Function key on Qt-based terminals
Fixes #508.
2021-02-01 09:02:36 +01:00
Christian Göttsche 8bd543562b Quote SYSCONFDIR definition
As SYSCONFDIR is a compile time string literal, use compile time string
concatenation instead of a runtime one.

Also drop related TODO, cause we indeed using the correct way of getting
$sysconfdir from autoconf
2021-01-31 21:44:34 +01:00
Christian Göttsche 06b1674aa6 Improve handling when selected last process entry
If the last process entry is selected and the process dies, stay at the
end of the list and do not jump to the start.

Also if the last entry is selected keep, after rebuilding the process
list due to a new scan, the last entry selected.
2021-01-31 21:44:00 +01:00
ahgamut 51e79ddc07 [#480] SysArchMeter to view kernel/arch info
At start, SysArchMeter calls the uname function to obtain the kernel
version and architecture. If available, the distro version is obtained
by calling lsb_release. The obtained values are stored in static
variables and used when updating the meter.
2021-01-31 20:08:09 +01:00
Christian Göttsche 7bfa466abe Linux: silence UBSAN implicit conversions
pgrp and session might be -1

linux/LinuxProcessList.c:312:20: runtime error: implicit conversion from type 'unsigned long' of value 18446744073709551615 (64-bit, unsigned) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior linux/LinuxProcessList.c:312:20 in
linux/LinuxProcessList.c:314:23: runtime error: implicit conversion from type 'unsigned long' of value 18446744073709551615 (64-bit, unsigned) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior linux/LinuxProcessList.c:314:23 in
2021-01-30 14:21:26 +01:00
Christian Göttsche 1014e897a7 Linux: document /proc/PID/stat field parsing 2021-01-30 14:21:26 +01:00
Christian Göttsche 69efa94f9f Use String_eq wrapper instead of raw strcmp 2021-01-30 14:21:26 +01:00
Christian Göttsche 04cf590967 FreeBSD: drop minflt and implement majflt 2021-01-30 14:21:26 +01:00
Christian Göttsche 46370231e3 FreeBSD: drop unused idle thread code 2021-01-30 14:21:26 +01:00
Christian Göttsche 8c43856380 FreeBSD: populate processor field 2021-01-30 14:21:26 +01:00
Christian Göttsche 79620d01c0 FreeBSD: drop unused jail_errmsg variable 2021-01-30 14:21:26 +01:00
Christian Göttsche 399add39ca FreeBSD: simplify kernel thread logic 2021-01-30 14:21:26 +01:00
Christian Göttsche 56c4055fd1 FreeBSD: drop unused ProcessList fields 2021-01-30 14:21:26 +01:00
Christian Göttsche fa499fc155 FreeBSD: misc 2021-01-30 14:21:26 +01:00
Christian Göttsche fdaa15bd8d Linux: overhaul io process fields
- avoid UBSAN conversions
- print N/A on no data (i.e. as unprivileged user)
- fix rate calculation to show bytes (instead of a thousandth)
- print bytes as human number (i.e. 8MB) instead of 8388608
- stabilize sorting by adjusting NAN values to very tiny negative number
2021-01-30 14:21:26 +01:00
Christian Göttsche fee744abd2 Update generic process field display
- sort cases by identifier
- use check snprintf
- color nice value of 0 as gray
- color cpu and memory percentages of 0.0 as gray
- color number of threads of 1 as gray
- color idle and sleeping state as gray
- color tgid matching pid (indicating main thread) as gray
2021-01-30 14:21:26 +01:00
Christian Göttsche d5de1bc23d Overhaul sorting of state process column
Do not sort by ascii value of the state identifier, sort by relevance
2021-01-30 14:21:26 +01:00
Christian Göttsche a3c8285237 Refactor to tty_nr process field display
If no terminal name can be found, fall back to generic display method
with major and minor device numbers.

Print special value '(none)' in case both are zero.
2021-01-30 14:21:26 +01:00
Christian Göttsche 03d6345c89 Process: document process fields
Drop unused fields 'flags' and 'exit_signal'
2021-01-30 14:21:26 +01:00
divinity76 93378b9ee5 fix typo/missing newline for --enable-static
https://i.imgur.com/byraZxG.png
2021-01-30 13:20:09 +01:00
Christian Göttsche 3acf28c259 Unsupported: pass compilation 2021-01-29 14:12:44 +01:00
Christian Göttsche bd694c0ce6 Do not call exit(3) in signal handler
Call safe _exit(2) instead
2021-01-29 12:38:30 +01:00
Christian Göttsche fd8c0611af Use different function on different detection method to avoid caching
Using the same function for the same library causes AC_CHECK_LIB to use
cached results.
Since we change the detection method via different or no
ncurses(5|6)-config invocation, avoid such caching by using different
functions.
2021-01-28 23:40:37 +01:00
Christian Göttsche f27bab470b Drop duplicate option
Option subdir-objects is now define in configure.ac
2021-01-28 23:40:37 +01:00
YJ Lee 34da6fdadb Avoid syntax injection inside code block
Co-authored-by: BenBE <BenBE@geshi.org>
2021-01-28 09:21:18 +01:00
Youngjae Lee e54a790b14 TraceScreen: draw panel header 2021-01-28 09:21:18 +01:00