Commit Graph

85 Commits

Author SHA1 Message Date
Benny Baumann
c0a9e92eea Implement FreeBSD support for minimum ZFS ARC size 2022-05-30 07:50:57 +02:00
Christian Göttsche
5bc988ad6d Use correct command field as default field
The default htop command process field has the enum identifier `COMM`
but the name `Command` (`COMM` is the field name for /proc/<PID>/comm).
2021-12-17 14:45:15 +01:00
Christian Göttsche
6e9a5e9e49 Mark ScreenDefaults const 2021-12-17 14:45:15 +01:00
Hisham Muhammad
72ba20fa5f Introduce screen tabs
This is a forward port (by nathans) of Hisham's original code.
2021-12-07 17:04:49 +11:00
Volodymyr Vasiutyk
2ef70ad7f6 Early program termination only from main() 2021-10-31 15:07:00 +01:00
Christian Göttsche
60cfa2edce FreeBSD: add comment for memory leak workaround
Follow-up of #841

[ci skip]
2021-10-15 22:22:30 +02:00
Ximalas
2128edfba2 Plug the memory leak for the Disk I/O meter
There are no functions in libdevstat to initialise or clean up memory. The simplest change is to mark the local variable info as static.
2021-10-12 09:09:00 +02:00
Daniel Lange
94ad111391 Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
Christian Göttsche
b965417bf7 Add combined memory and swap meter
Closes: #699
2021-08-17 10:36:10 +02:00
Christian Göttsche
41af31be7f Rework CPU counting
Currently htop does not support offline CPUs and hot-swapping, e.g. via
    echo 0 > /sys/devices/system/cpu/cpu2/online

Split the current single cpuCount variable into activeCPUs and
existingCPUs.

Supersedes: #650
Related: #580
2021-07-18 07:44:02 +02:00
Benny Baumann
458749df45 Code indentation 2021-07-15 06:57:24 +02:00
mayurdahibhate
3f86a011e6 platform-dependent files included relative to main source directory 2021-05-10 18:40:53 +02:00
Christian Göttsche
a11d01568c Use unsigned types for CPU counts and associated variables 2021-03-19 23:30:54 +01:00
Daniel Lange
67b815a817 Merge branch 'shared_before_cached' of cgzones/htop 2021-03-19 09:49:36 +01:00
Graham Inggs
ee97916fd5
Merge pull request #436 from cgzones/freebsd
FreeBSD: add support for CPU frequency and temperature
Tested on two physical systems running FreeBSD 12.1
2021-03-18 14:03:51 +02:00
Christian Göttsche
9f41dc3332 MemoryMeter: show shared memory before cached
Shared memory is less free-able than cached memory.

Show it beforehand.
2021-03-17 16:32:16 +01:00
Nathan Scott
29570c0133
Merge pull request #550 from natoscott/diskio-types
Fix integer sizing issues in the DiskIO Meter
2021-03-02 13:34:52 +11:00
Nathan Scott
88a11859a0 Switch NetworkIO Meter to using uint32_t and uint64_t
From review via @BenBE, this is now a whole lot cleaner.
2021-03-02 12:14:44 +11:00
Nathan Scott
00339087b0 Fix integer sizing issues in the DiskIO Meter
On Linux kernels the size of the values exported for block
device bytes has used a 64 bit integer for quite some time
(2.6+ IIRC).  Make the procfs value extraction use correct
types and change internal types used to rate convert these
counters (within the DiskIO Meter) 64 bit integers, where
appropriate.
2021-03-01 12:10:18 +11:00
Nathan Scott
2d1839289e Fix integer sizing issues in the NetworkIO Meter
On Linux kernels the size of the values exported for network
device bytes and packets has used a 64 bit integer for quite
some time (2.6+ IIRC).  Make the procfs value extraction use
correct types and change internal types used to rate convert
these counters (within the NetworkIO Meter) 64 bit integers,
where appropriate.
2021-03-01 11:55:15 +11:00
Christian Göttsche
fd2a0cf421 FreeBSD: add support for CPU frequency and temperature 2021-02-05 16:32:25 +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
fa499fc155 FreeBSD: misc 2021-01-30 14:21:26 +01:00
Christian Göttsche
47cebafd77 kfreeBSD: include config.h for _GNU_SOURCE
strcasestr(3) is a GNU extension and when compiling freebsd/Platform.c
on kfreebsd for Debian <string.h> is included before we define
_GNU_SOURCE, so the function is not available.

In file included from ./Object.h:16,
                 from ./ListItem.h:12,
                 from ./Meter.h:16,
                 from ./Header.h:10,
                 from ./Action.h:15,
                 from freebsd/Platform.h:13,
                 from freebsd/Platform.c:8:
./XUtils.h: In function ‘String_contains_i’:
./XUtils.h:43:11: warning: implicit declaration of function ‘strcasestr’; did you mean ‘strcasecmp’? [-Wimplicit-function-declaration]
   43 |    return strcasestr(s1, s2) != NULL;
      |           ^~~~~~~~~~
      |           strcasecmp
./XUtils.h:43:30: warning: comparison between pointer and integer
   43 |    return strcasestr(s1, s2) != NULL;
      |                              ^~
In file included from ./Object.h:16,
                 from ./ProcessList.h:16,
                 from freebsd/FreeBSDProcessList.h:15,
                 from freebsd/FreeBSDProcessList.c:8:
./XUtils.h: In function ‘String_contains_i’:
./XUtils.h:43:11: warning: implicit declaration of function ‘strcasestr’; did you mean ‘strcasecmp’? [-Wimplicit-function-declaration]
   43 |    return strcasestr(s1, s2) != NULL;
      |           ^~~~~~~~~~
      |           strcasecmp
./XUtils.h:43:30: warning: comparison between pointer and integer
   43 |    return strcasestr(s1, s2) != NULL;
      |                              ^~
2021-01-12 17:02:16 +01:00
David Zarzycki
37e186fd66 Linux: Add SwapCached to the swap meter
According to the Linux kernel documentation, "SwapCached" tracks "memory
that once was swapped out, is swapped back in but still also is
in the swapfile (if memory is needed it doesn't need to be swapped out
AGAIN because it is already in the swapfile. This saves I/O)."
2021-01-11 20:27:47 +01:00
Christian Göttsche
f614b8a19f Mark Platform_defaultFields const 2020-12-19 21:13:32 +01:00
Christian Göttsche
89473cc9ae Rework enum ProcessField
Use only one enum instead of a global and a platform specific one.
Drop Platform_numberOfFields global variable.
Set known size of Process_fields array
2020-12-19 21:13:32 +01:00
Christian Goettsche
8d1595a20e FreeBSD: fix crash on empty environment
e.g. on kernel threads
2020-12-05 20:34:23 +01:00
Christian Göttsche
601ad61e7d Unify naming of first argument of Platform_getBattery
Use percent throughout
2020-11-25 12:47:07 +01:00
Nathan Scott
003f2c06a4 Merge branch 'cleanup-init-done' into master 2020-11-23 17:34:44 +11:00
Christian Göttsche
fa002c0ba9 Rename virtual memory column from M_SIZE to M_VIRT
Closes: #325
2020-11-21 19:39:45 +01:00
Christian Goettsche
f5c3349bdb IWYU update (FreeBSD) 2020-11-19 23:51:50 +01:00
Nathan Scott
c75c5ef9c6 Minor cleanups to platform-specific init and done
Move platform-specific code out of the htop.c main function
and into the platform sub-directories - primarily this is
the Linux procfs path check and sensors setup/teardown; not
needed on any other platforms.  No functional changes here.
2020-11-19 12:32:07 +11:00
Nathan Scott
ea9622b8c9 Merge individual Battery.[ch] files into Platform.[ch]
Consistent with everything else involving platform-specific
calls from core htop code.
2020-11-18 10:17:33 +11:00
Christian Göttsche
1b225cd7a0 Show CPU temperature in CPU meter
Show the CPU temperature in the CPU meter, like CPU frequency, instead
of using an extra Meter.
2020-11-16 16:38:54 +01:00
Daniel Lange
bb908f3dc4 Resolve merge conflicts, merge #298 "Macro cleanup" from @BenBE 2020-11-15 14:33:09 +01:00
Benny Baumann
18763051a2 Split platform dependent parts for file locks screen 2020-11-14 15:51:26 +01:00
Benny Baumann
61e14d4bb2 Spacing around operators 2020-11-02 22:15:01 +01:00
Benny Baumann
b23f8235e2 Whitespace and indentation issues 2020-11-02 22:15:01 +01:00
Christian Goettsche
c2fdfd99eb FreeBSD: implement Platform_getDiskIO() 2020-10-29 22:21:42 +01:00
Christian Göttsche
c91061c84b FreeBSD: Platform update 2020-10-29 22:21:42 +01:00
Christian Göttsche
72103e9613 Hold only a const version of the ProcessList in Meters 2020-10-26 19:30:38 +01:00
Christian Göttsche
f757810f48 Improve handling of no data in Disk and Network IO Meters 2020-10-26 19:17:14 +01:00
Ross Williams
94e32cf1e8 Simplify environment-reading code
Suggested PR changes, thanks @cgzones
2020-10-26 19:01:11 +01:00
Ross Williams
0ae2bb1f8e Add process environment for FreeBSD 2020-10-26 19:01:11 +01:00
Christian Göttsche
b08b255b41 Drop unused Platform functions Platform_setTasksValues 2020-10-22 22:26:12 +02:00
Christian Göttsche
7cd093ce95 Add NetworkIOMeter 2020-10-16 20:00:14 +02:00
Benny Baumann
4a78f4bb92 Some more locations for ARRAYSIZE 2020-10-08 15:37:03 +02:00
Christian Göttsche
ba282cfe19 Mark Object instances const 2020-10-07 13:01:53 +02:00
Christian Göttsche
08d85e6143 Mark Object classes and Object class fields const 2020-10-07 13:01:53 +02:00