Commit Graph

64 Commits

Author SHA1 Message Date
mayurdahibhate
3f86a011e6 platform-dependent files included relative to main source directory 2021-05-10 18:40:53 +02:00
Daniel Lange
6ea93fc6c0 Merge branch 'openbsd' of cgzones/htop 2021-03-21 17:48:41 +01:00
Christian Göttsche
e4e3f6c390 OpenBSD: update
* Set process data for:
    - minflt
    - majflt
    - processor
    - nlwp

* Drop unimplemented nlwp column

* Scan userland threads

* Mark a 'Thread is currently on a CPU.' with 'R', and processes
  'Currently runnable' with 'P', do confine with man:ps(1) and Linux.
  See https://man.openbsd.org/ps.1

* Show CPU frequency
2021-03-20 18:30:08 +01:00
Christian Göttsche
a11d01568c Use unsigned types for CPU counts and associated variables 2021-03-19 23:30:54 +01: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
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
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
69efa94f9f Use String_eq wrapper instead of raw strcmp 2021-01-30 14:21:26 +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 Göttsche
57d9ecc551 OpenBSD update
- compilation failures like `return &this->this;` -> `return &this->super;`
- iwyu update
- misc cleanup
2020-12-06 16:20:55 +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
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
45869513bf Embracing branches 2020-11-02 22:15:01 +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
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
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
Nathan Scott
e9fa290019 Merge branch 'update-license-and-copyright-info' 2020-10-06 10:27:38 +11:00
Michael F. Schönitzer
d93cac12be
Add a date and datetime meter (#159)
Add a date meter and sort header and source files in Makefile

Change the lists of header and source files sorted alphabetical and one
file per line. This way diffs become better readable and merges easier.
2020-10-05 13:52:58 +02:00
Daniel Lange
079c2abf8e Update License consistently to GPLv2 as per COPYING file 2020-10-05 10:13:12 +02:00
Christian Göttsche
e518459981 Add DiskIOMeter for IO read/write usage 2020-10-03 19:01:38 +02:00
multi
9ee72568dc CPUMeter: add octuple-column CPU meters.
This is a straightforward extension of the existing multi-column CPU meter
code, which now allows for up CPU meters to be displayed in up to 16 columns.

This also adds the meter declarations to all the platform-specific code.
2020-09-28 14:35:35 +02:00
multi
491bf98b90 Add missing 4-column CPU meters to non-Linux platforms. 2020-09-28 14:35:35 +02:00
Benny Baumann
3c65d78d77 Update CPU freq display to use NAN on error 2020-09-24 18:06:36 +02:00
Zev Weiss
a1a027b9bd Axe automated header generation.
Reasoning:
 - implementation was unsound -- broke down when I added a fairly
   basic macro definition expanding to a struct initializer in a *.c
   file.

 - made it way too easy (e.g. via otherwise totally innocuous git
   commands) to end up with timestamps such that it always ran
   MakeHeader.py but never used its output, leading to overbuild noise
   when running what should be a null 'make'.

 - but mostly: it's just an awkward way of dealing with C code.
2020-09-03 11:58:58 -05:00
Nathan Scott
6b443c5da9 Merge branch 'hishamhm-pull-932' 2020-08-20 14:47:07 +10:00
Nathan Scott
78f4d064de Merge branch 'hishamhm-pull-868' 2020-08-20 09:53:00 +10:00
Nathan Scott
e9947acfc6 Merge branch 'hishamhm-pull-818' 2020-08-19 16:49:43 +10:00
Nathan Scott
5a17cee74d Merge branch 'hishamhm-pull-817' 2020-08-19 16:43:55 +10:00
Arnavion
909bb86f05 Show N/A on unsupported platforms instead of 0KHz 2019-08-10 17:17:45 -07:00
Antoine Motet
27fe307d22 Remove a few unnecessary #includes 2018-12-16 11:34:15 +01:00
Antoine Motet
9197adf57e Fix CPU usage on OpenBSD
The current OpenBSD-specific CPU usage code is broken. The `cpu`
parameter of `Platform_setCPUValues` is an integer in the interval
[0, cpuCount], not [0, cpuCount-1]: Actual CPUs are numbered from
1, the “zero” CPU is a “virtual” one which represents the average
of actual CPUs (I guess it’s inherited from Linux’s `/proc/stats`).
This off-by-one error leads to random crashes.

Moreover, the displayed CPU usage is more detailed with system,
user and nice times.

I made the OpenBSD CPU code more similar to the Linux CPU code,
removing a few old bits from OpenBSD’s top(1). I think it will be
easier to understand, maintain and evolve.

I’d love some feedback from experienced OpenBSD people.
2018-12-16 11:30:06 +01:00
multiplexd
c1fb585b6b OpenBSD: add environment reading support (#819) 2018-08-19 01:07:36 -03:00
kremlin
060aa2b20f remove wrongfix 2018-07-26 04:17:06 -05:00
multiplexd
3d79c72e9a Update OpenBSD maximum PID
The source code correctly states that the maximum PID number in
the OpenBSD kernel is fixed in sys/sys/proc.h, however this was
updated in revision 1.215 (two years ago!) from 32766 to 99999.
2018-07-17 18:46:55 +01:00
Ian Sutton
c005ffc3d7 Fix zero-index array bounds issue 2018-07-17 08:50:22 -05:00