Commit Graph

138 Commits

Author SHA1 Message Date
Benny Baumann 601480003f Centralise fault handling
This should be done as all platforms essentially did the same anyway and there was nothing platform specific.
2020-10-12 13:06:12 +02:00
Christian Göttsche f4439b1b60 Makefile sort correction 2020-10-09 10:40:54 +02: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
Christian Göttsche b7f63292e5 Add --enable-debug configure option to enable asserts
asserts are still disabled by default.
2020-10-03 19:04:27 +02:00
Christian Göttsche e518459981 Add DiskIOMeter for IO read/write usage 2020-10-03 19:01:38 +02:00
ryenus f4bb50294a show selected command wrapped in a separate window
For a process with a very long command, especially with many long
command line arguments, inspecting the command and its arguments could
become inconvenient.

Meanwhile htop supports the concept of "screen", or window, which is
extended here to create a dedicated "CommandScreen", making it possible
to display the command of the selected process in a separate window
meanwhile being wrapped into multiple lines.

Another benefit of using a command screen is, the user can navigate
through the wrapped lines of the command and perform actions like
searching and filtering.
2020-09-24 19:22:25 +02:00
Christian Göttsche f4602f7b4e Add some default compiler warnings
Compatible with gcc and clang.
2020-09-18 12:28:40 +02:00
Christian Göttsche 84d39f95c6 autotools: enable warnings and cleanup
- enable warnings in autogen script
- drop unused m4/ directory usage
- drop AC_TYPE_SIGNAL:
  C99 guarantees the signal return type to be void
- drop AC_CHECK_FILE of procdir:
  most of the time compilation is done on a different system than htop is run
  and there is a runtime check in place
- improve linux_affinity corss compile logic:
  use fourth argument instead of pre-test
2020-09-17 21:45:11 +02:00
Nathan Scott c5808c56db Consolidate repeated macro definitions into one header
The MIN, MAX, CLAMP, MINIMUM, and MAXIMUM macros appear
throughout the codebase with many re-definitions.  Make
a single copy of each in a common header file, and use
the BSD variants of MINIMUM/MAXIMUM due to conflicts in
the system <sys/param.h> headers.
2020-09-09 16:56:04 +10:00
Nathan Scott 8ec5d4a3a0 Further, minor cleanups to headers post-MakeHeaders
Remove leftover empty ifdef/endif pairs, whitespace.
The generated htop.h file was also unused - removed.
2020-09-08 17:33:50 +10: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 d0f31ede56 Merge branch 'ci-hwloc-job' of https://github.com/bertwesarg/htop into bertwesarg-ci-hwloc-job 2020-08-26 10:15:00 +10:00
Bert Wesarg 345d415537 Do not include the generated `config.h` header into the package 2020-08-25 11:42:16 +02:00
Bert Wesarg 054b7f2801 Fix out-of-tree builds 2020-08-25 10:36:27 +02:00
Christian Göttsche 57254cdd05 configure: add option --enable-werror
Adds the compiler flag -Werror to fail on warnings.
Useful for CI runs.
2020-08-21 10:37:20 +02:00
Nathan Scott 9a55efc8b5 Merge branch 'hishamhm-pull-920' 2020-08-20 18:24:35 +10:00
Nathan Scott 0622be6ab3 Merge branch 'hishamhm-pull-1009' 2020-08-20 15:14:26 +10:00
Nathan Scott 2be0992700 Merge branch 'hishamhm-pull-890' 2020-08-20 14:00:13 +10:00
Jorge Pereira 1b4ed916b1
Fix use of '-rdynamic'
The option should be informed to the linker.
2020-06-11 13:30:30 -03:00
Ross Williams 613556faeb Support for ZFS Compressed ARC statistics 2019-09-03 18:44:19 +00:00
Ross Williams ff6914e4ad ZFS arcstats for Solaris 2019-07-07 23:10:54 -04:00
Ross Williams a88d2e313d Refactor common OpenZFS sysctl access
Darwin and FreeBSD export zfs kstats through the
same APIs, so moving functions into a common file.
2019-07-07 23:10:54 -04:00
Ross Williams fc8e9a2d3e ZFS arcstats for Darwin (macOS / OS X) 2019-07-07 23:10:46 -04:00
Ross Williams 070fe90461 ZFS arcstats for Linux
If no pools are imported (ARC size == 0) or the
ZFS module is not in the kernel (/proc/spl/kstat/zfs/arcstats
does not exist), then the Meter reports "Unavailable".
2019-07-07 22:57:15 -04:00
Ross Williams a93edde1a2 Support ZFS ARC stats on FreeBSD
New meter displays same ARC stats as FreeBSD top(1).
Can be extended to other platforms that support ZFS.

Pulling kstat.zfs.misc.arcstats.c_max as the meter
total, so the meter has a meaningful value to work
up to.

The Text meter displays, first, the maximum
ARC size (Meter.total), then second, the total
ARC used, using the difference between Meter.maxItems
and Meter.curItems to "hide" the used value from the
Bar and Graph drawing functions by using an index
in Meter.values[] that is beyond curItems - 1, but
less than maxItems - 1.
2019-07-07 22:52:04 -04:00
Explorer09 103f1a497a Disable 'make dist' when pkg.m4 is unused in configure
This would prevent a careless future package maintainer from creating a
release tarball with a defective configure script. :)

Also, add a warning in the autogen.sh phase if pkg.m4 is unused.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2018-05-22 23:21:42 -03:00
Explorer09 442b0d2576 New makefile targets to rebuild and clean htop headers.
`make htop-headers` will regenerate all '.h' headers in htop source for
all platforms.
`make clean-htop-headers` will delete all generated htop headers.

Because of the introduction of these two targets, I slightly changed
the style of platform-specific portions of makefile rules.
Please comment if you accept such a style, or need me to revert to old
style.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2018-03-26 15:14:12 -03:00
Kang-Che Sung (宋岡哲) 2e3c35d66d Use AM_CFLAGS and AM_LDFLAGS in Makefile.am (#760)
This reduces generated Makefile.in size by 74%.
(217319 bytes -> 56326 bytes)

Automake considers that <prog>_CFLAGS and <prog>_LDFLAGS are
program-specific build rules, and when such are specified, Automake
will generate additional code just to avoid the "generic" and
package-wide AM_CFLAGS or AM_LDFLAGS. (Especially for <prog>_CFLAGS,
Automake will rename generated object files to become "prog-foo.o" and
such, and it's _a lot_ of code to achieve this in Makefile.)

There's no reason for htop to rename intermediate object files. It's
better to make things simpler.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2018-03-16 11:31:48 -03:00
gmbroome 697f5bb9c1 Import Solaris support (#741)
This commit adds support for Solaris, squashed from PR #741:

Summary of additions:

* Initial setup of Solaris platform directory
* Add Solaris platform into autoconf template
* Uptime and load averages
* Add dependency on libkstat
* Basic process listing
* Zone name display
* CPU detection
* Per-process memory and CPU usage parsed correctly
* Uses sysconf to discover number of CPUs, instead of more complex libkstat code
* Simple memory display working
* Reduce repetitive calls to the PAGE_SIZE macro when reading memory info
* Add Project, Contract, Task, and Pool into process properties
* Use system major()/minor() implementations and remove extraneous definition of mkdev()
* Get the STARTTIME column working properly, using the Linux implementation as a guide
2018-03-02 18:20:46 -03:00
Diederik de Groot cb7a06379d Enh: Add support for backtrace using execinfo 2017-04-21 16:36:19 +02:00
Diederik de Groot b258d6e53e Initial addition of dragonflybsd (based on FreeBSD) 2017-04-19 16:19:32 +02:00
Hisham a8a5e62760 Force -lgcov harder when running `make coverage`.
Shouldn't be needed, but I had to make this tweak to make this work again.
2016-02-19 13:40:21 -02:00
Hisham b54d2dde40 Check for failure in allocations. 2016-02-02 15:53:02 +01:00
Hisham Muhammad 466d4da0c6 refactor *Screen classes, add InfoScreen superclass 2016-01-12 06:00:58 -02:00
Michael Klein 0919ea32f9 'e' displays environment of current process
- uses sysctl(KERN_PROCARGS2) on *BSD
- doesn't work on Linux yet
2015-12-02 23:26:00 +01:00
Michael McConville a9a5a539cf (Very) initial working OpenBSD port 2015-09-18 00:46:48 -04:00
David Hunt 70e7c8db59 Added darwin with working battery meter 2015-08-19 13:47:26 -03:00
David Hunt 5e602f18d5 Rename String to StringUtils.
Fixes building on case-insensitive filesystems where String.h gets confused with <string.h>.

From d734dacea0a10d0465dad4e95b3421511e7da112 Mon Sep 17 00:00:00 2001
From: David Hunt <dhunt@iolanthe.attlocal.net>
Date: Sat, 11 Jul 2015 20:56:31 -0500
Subject: [PATCH 1/8] Rename String to StringUtils
2015-08-19 13:45:20 -03:00
Hisham Muhammad 80ef119fe7 Add coverage testing rules 2015-03-25 17:14:40 -03:00
Hisham Muhammad adbfe3c3f1 Get FreeBSD tree to compile again with latest changes. 2015-03-16 03:14:20 -03:00
Hisham Muhammad d2acffa59a Merge branch 'wip' of https://github.com/hishamhm/htop into freebsd
Conflicts:
	htop.c
	unsupported/Platform.h
2015-03-15 22:53:10 -03:00
Hisham Muhammad 5ca9b8e002 Work on fixing build of "unsupported" platform 2015-02-23 00:59:24 -03:00
Hisham Muhammad f97d1bc54a Merge branch 'master' into wip 2015-02-04 12:19:52 -02:00
Hisham Muhammad aed9b9d18e Test if -Wextra is supported. Closes #155. 2015-02-04 12:19:04 -02:00
Hisham Muhammad 3383d8e556 Sorry about the mega-patch.
This is a work-in-progress, code is currently broken.
(Some actions, and notably, the header, are missing.)
2015-01-21 23:27:31 -02:00
Hisham Muhammad d4c26a3932 Merge branch 'master' into freebsd 2014-11-27 21:05:30 -02:00
Hisham Muhammad 430c7c9a9b Move platform-dependent parts of Linux battery meter. 2014-11-27 21:04:57 -02:00
Hisham Muhammad 3ba3d6fa6f Add uptime calculation code. 2014-11-27 19:44:20 -02:00
Hisham Muhammad 1dd165c14b Merge branch 'master' into freebsd 2014-11-27 19:41:31 -02:00
Hisham Muhammad ca03094bb2 Make UptimeMeter cross-platform again. 2014-11-27 19:41:14 -02:00
Hisham Muhammad a9f05c2a8b Uptime meter for FreeBSD.
This will produce too much replicated code.
I think I'll use a lighter abstraction in things like this.
2014-11-27 19:33:37 -02:00
Hisham Muhammad 79662291fa Merge branch 'master' into freebsd 2014-11-27 19:19:54 -02:00
Hisham Muhammad 357e7a3243 Move UptimeMeter into platform-dependent area.
Set up environment to move other meters.
2014-11-27 19:18:14 -02:00
Hisham Muhammad 8915b29395 Beginnings of FreeBSD port! 2014-11-27 16:27:34 -02:00
Hisham Muhammad aaaaf063a1 Builds on Linux again! 2014-11-24 19:22:50 -02:00
Hisham Muhammad eb229d9aef Changes for supporting separate platform subdirectories. 2014-11-24 18:55:03 -02:00
Robert Rosengren 5aac1733a6 Possible to regenerate headers outside of srcdir 2014-01-17 09:33:52 +01:00
Hisham Muhammad 2a73405cd0 search and filter for the strace and lsof screens! 2012-11-10 00:31:37 +00:00
Hisham Muhammad 47e881f460 Add IO priority support ('i' key) 2012-10-04 23:59:45 +00:00
Hisham Muhammad 5b3cc559b2 remove old reference to hwloc directory 2011-12-26 22:09:59 +00:00
Hisham Muhammad 45f7a4fc8d Remove old memory debugging routines. We have Valgrind nowadays. 2011-12-26 22:04:29 +00:00
Hisham Muhammad bc87a8ff8c Remove bundled hwloc-1.2.1. Use either native Linux affinity support or an external libhwloc.
(for details see https://sourceforge.net/mailarchive/forum.php?thread_name=CAJpkDYeZpwqcWxZ77wq6bMrnhn-KzkU1xAqb3cU0drfnA3n9FQ%40mail.gmail.com&forum_name=htop-general )
2011-11-21 02:52:41 +00:00
Hisham Muhammad e204861de5 Allow typing to select items in various panels (sort, user, signal).
Factored code from the SignalsPanel to apply to all selections from main screen.
Closes feature request #3425304.
2011-11-05 04:19:47 +00:00
Hisham Muhammad c18ccdb910 store cppcheck rule for future use 2011-10-25 00:46:37 +00:00
Hisham Muhammad d1b1cbc757 cleanups and fixes, thanks to cppcheck and gcc -Wextra 2011-10-25 00:05:46 +00:00
Hisham Muhammad 1afef1899d Add flag to allow using the system install of hwloc. 2011-09-26 03:24:22 +00:00
Hisham Muhammad ec17b7029a Convert affinity control from the deprecated PLPA to HWLOC 2011-09-24 00:30:47 +00:00
Hisham Muhammad 5fd1436a92 Build fixes. BTW, we're going for 0.9 now. 2010-11-20 18:54:39 +00:00
Hisham Muhammad 6486229308 add support for steal/guest CPU time measurement
simplify processor data accounting (add CPUData structure)
remove Process_clone trick
2010-08-24 23:20:38 +00:00
Hisham Muhammad 6501432ef6 upgrade PLPA to 1.3.2 2010-03-29 19:08:14 +00:00
Hisham Muhammad 6330ff3a0a changes for htop 0.8.2 2009-06-02 04:51:23 +00:00
Hisham Muhammad 3b950e4189 BSD related fixes:
* BUGFIX: Correct page size calculation for FreeBSD systems
  (thanks to Andrew Paulsen)
* Allow compilation without PLPA on systems that don't support it
  (thanks to Timothy Redaelli)
2009-03-11 13:15:43 +00:00
Hisham Muhammad ac5cecb6fc Option to display hostname in the meters area 2009-02-17 18:33:32 +00:00
Hisham Muhammad 11931f1bc8 ACPI Battery meter
contributed by Ian Hands
2008-09-23 06:21:28 +00:00
Hisham Muhammad 8fa33dc336 Add Unicode support, enabled with the --enable-unicode
flag, which requires libncursesw.
Thanks to Sergej Pupykin!
2008-03-09 02:33:23 +00:00
Hisham Muhammad 4df76d127b Embed PLPA (Portable Linux Processor Affinity) in order to support
conflicting affinity API of different Linux kernel versions.
2008-03-05 09:46:47 +00:00
Hisham Muhammad a7c2aedcec Improve construction of tree view, properly nesting threads.
Add CPU affinity screen ('a' key).
BUGFIX: Correct display of TPGID field.
Add TGID field.
2007-11-08 23:23:01 +00:00
Hisham Muhammad e1a7e2bdef Fix regeneration of headers 2007-05-21 19:09:19 +00:00
Hisham Muhammad df20abfd67 Rule for automatically rebuilding headers 2007-05-17 18:28:20 +00:00
Hisham Muhammad c494308b21 Add an additional debug mode for Hardened GCC. 2006-11-08 21:46:40 +00:00
Hisham Muhammad 3bf904b7ce Bringing extra files up-to-date 2006-07-12 01:14:48 +00:00
Hisham Muhammad 5d48ab8c28 Performance improvement hackathon: improve process comparison routines,
disable useless code in release builds such as runtime type-checking on
dynamic data structures and process fields that are not being computed,
faster(?) method for verifying the process owner (still need to ensure
correctness), don't destroy and create process objects for hidden kernel
threads over and over. Phew. I shouldn't be doing all this today, but I
could not resist.
2006-07-11 06:13:32 +00:00
Hisham Muhammad 57bd892b37 Add "debuglite" mode. 2006-05-30 14:26:30 +00:00
Hisham Muhammad c2cdcd0c1d Rename ListBox to Panel, matching dit. 2006-05-30 13:47:28 +00:00
Hisham Muhammad a853faaa2d Rename TypedVector to Vector, matching dit. 2006-05-30 13:45:40 +00:00
Hisham Muhammad 33113fe0d7 - Overhaul meters implementation;
- add AllCPUsMeter;
- because of that, the new .htoprc is incompatible with previous released versions.
2006-04-10 20:40:38 +00:00
Hisham Muhammad 86d6313560 * make debug target
* Support for generating a /proc trace for debugging purposes.
2006-03-24 03:39:04 +00:00
Hisham Muhammad d6231bab89 Initial import. 2006-03-04 18:16:49 +00:00