summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ProcessList.h: remove `ProcessList_remove`Denis Lisov2022-05-052-12/+1
| | | | | | | | As the "highlight dying processes" option has to keep processes in the list when they disappear, no code except the cleanup loop in `ProcessList_scan` should remove processes from the list directly. Remove the export to prevent random process removals from being reintroduced accidentally.
* LinuxProcessList_recurseProcTree: keep on read errorDenis Lisov2022-05-051-1/+6
| | | | | | | | If a process goes away while reading its fields, but we already have that process in the list, we should keep it in case the "highlight dying processes" mode is active. Not only is that expected in this mode, but this should also ensure parents are in the list when their children are (wanted for tree mode consistency).
* LinuxProcessList_recurseProcTree: open dirfd firstDenis Lisov2022-05-051-8/+8
| | | | | | | | | | A process can die between reading the directory listing and opening the directory FD (if HAVE_OPENAT) or /proc files (otherwise) for reading the process data. This race would cause LinuxProcessList_recurseProcTree to remove it from the list immediately, which is unexpected in the "highlight dying processes" mode and can break the tree structure. This patch closes this race in the HAVE_OPENAT case by only accessing the process entry after the directory FD has been opened.
* Remove redundant sscanf calls (in (s)scanf a blank validates _zero_ or more ↵Daniel Lange2022-05-051-7/+2
| | | | | | | | whitespace) man sscanf(3): A sequence of white-space characters (space, tab, newline, etc.; see isspace(3)). This directive matches any amount of white space, including none, in the input.
* Always abort on overflow in String_catChristian Göttsche2022-05-051-1/+3
| | | | Not only in debug mode.
* ProcessList: fix quadratic process removal when scanningCharlie Vieth2022-05-055-35/+127
| | | | | | | | | | | | | | | | | | | | | | | This commit changes ProcessList_scan to lazily remove Processes by index, which is known, instead of performing a brute-force search by pid and immediately reclaiming the lost vector space via compaction. Searching by pid is potentially quadratic in ProcessList_scan because the process we are searching for is always at the back of the vector (the scan starts from the back of the vector). Additionally, removal via Vector_remove immediately reclaims space (by sliding elements down). With these changes process removal in ProcessList_scan is now linear. Changes: * ProcessList: add new ProcessList_removeIndex function to remove by index * Vector: add Vector_softRemove and Vector_compact functions to support lazy removal/deletion of entries Vector_softRemove Vector_compact * Vector: replace Vector_count with Vector_countEquals since it only used for consistency assertions.
* Merge branch 'natoscott-changelog-3.2.0'3.2.0Nathan Scott2022-05-012-1/+35
|\
| * Merge branch 'changelog-3.2.0' of https://github.com/natoscott/htop into ↵Nathan Scott2022-05-012-1/+35
|/| | | | | | | natoscott-changelog-3.2.0
| * Add changelog entries for pending htop-3.2.0 release, update versionNathan Scott2022-04-292-1/+35
| |
* | Merge branch 'natoscott-coverity-scan'Nathan Scott2022-05-011-14/+14
|\ \
| * | Merge branch 'coverity-scan' of https://github.com/natoscott/htop into ↵Nathan Scott2022-05-011-14/+14
|/| | | | | | | | | | | natoscott-coverity-scan
| * | Update Settings_newScreen with single-line sortKey checking.Nathan Scott2022-05-011-5/+1
| | | | | | | | | Co-authored-by: BenBE <BenBE@geshi.org>
| * | Remove redundant null checks on Settings_write (covscan)Nathan Scott2022-04-301-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | Coverity scan reports that there is dead code in Settings_write checking for nulls that have already been dereferenced on every code path leading to the check. This is likely a hangover from times when the screens pointer was only conditionally allocated - they're not needed anymore.
| * | Add array bounds checking for the Process_fields array (covscan)Nathan Scott2022-04-301-1/+7
| |/ | | | | | | | | | | | | Coverity scan reports there may be a code path that would cause an overrun in the (relatively new) ScreenSettings code where it evaluates default sort direction. Add bounds check and default to descending instead of a potentially invalid array access.
* | Add note that the Tree view setting is per Screen tab nowDaniel Lange2022-04-301-1/+1
| |
* | Document screen tab switching (TAB, Shift-TAB keys)Daniel Lange2022-04-302-0/+6
| |
* | FreeBSD: free emulation stringChristian Göttsche2022-04-301-0/+1
| |
* | Fix typoChristian Göttsche2022-04-301-4/+4
|/
* Merge branch 'main' of thesamesam/htopDaniel Lange2022-04-261-2/+2
|\
| * build: use AC_CANONICAL_HOST, not AC_CANONICAL_TARGETSam James2022-01-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | htop is a program which will be run on CHOST after cross-compilation; CTARGET is only for a small number of cases where a program itself outputs code (so you might cross-compile a compiler which spits out code for a third architecture/platform). We want to use AC_CANONICAL_HOST to check CHOST for the platform currently being used to build htop. The confusion around this issue was compounded by a mistake in autoconf-archive which has since been fixed (AX_PTHREAD pulled it in incorrectly). See: https://github.com/libstatgrab/libstatgrab/pull/131 See: https://github.com/fenrus75/powertop/pull/90#discussion_r705803725 Signed-off-by: Sam James <sam@gentoo.org>
* | Remove stray fprintf left from testing (introduced in 7039abe)Daniel Lange2022-04-261-1/+0
| |
* | Assume process just started when kproc->ki_start returns garbageBenny Baumann2022-04-211-0/+3
| |
* | Avoid extremely large year values when printing timeBenny Baumann2022-04-211-1/+6
| |
* | Force elapsed time display to zero if process seems started in the futureBenny Baumann2022-04-211-1/+9
| |
* | Process: Fix PID & UID column widths off-by-one errorExplorer092022-04-181-2/+2
| | | | | | | | | | | | | | | | | | If the max PID or UID value for a platform is exactly a power of ten (10000, 100000, etc.) the column widths of PID and UID would be 1 char less than the correct number of digits. This is caused by the wrong rounding function (ceil(x)); change to the correct one (trunc(x) + 1). Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* | README: Add macOS build dependency install commandahsmha2022-04-141-0/+5
| |
* | Merge branch 'allow-multiple-filters-and-search-strings' into mainDaniel Lange2022-04-147-11/+28
|\ \ | | | | | | | | | Closes #961
| * | Improve String_contains_i to allow for multiple termsDaniel Lange2022-03-257-11/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables: * Multiple filters in the main panel and strace etc. views * Multiple search terms The search terms are separated by "|" and are still fixed strings matched case-insensitive. Added a multi flag at request of BenBE.
* | | Merge branch 'improve-filter-label' into mainDaniel Lange2022-04-143-5/+7
|\ \ \
| * | | Improve MainPanel Label on active inc filter (Filter <-> FILTER)Daniel Lange2022-03-253-5/+7
| |/ /
* | | Make CLANG happy (-Wembedded-directive)Daniel Lange2022-04-071-4/+4
| | |
* | | Do not show help for -M / --no-mouse if HAVE_GETMOUSE is undefinedDaniel Lange2022-04-071-0/+2
| | |
* | | Fix a compile warning: comparison of unsigned enum expression < 0 is always ↵hwangcc232022-04-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | false Get this warning when compiling Settings.c on the Mac OS X with clang-800.0.42.1. Settings.c:447:28: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare] if (this->hLayout < 0 || this->hLayout >= LAST_HEADER_LAYOUT) ~~~~~~~~~~~~~ ^ ~ This patch fixes the problem.
* | | configure.ac: fix static build with hwlocFabrice Fontaine2022-04-031-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Retrieve hwloc dependencies through pkg-config to avoid the following static build failure: checking for hwloc_get_proc_cpubind in -lhwloc... no configure: error: can not find required library libhwloc This build failure is raised because without pkg-config, hwloc dependencies such as libxml2 are not retrieved: configure:8999: checking for hwloc_get_proc_cpubind in -lhwloc configure:9022: /home/autobuild/autobuild/instance-0/output-1/host/bin/powerpc-buildroot-linux-uclibc-gcc -o conftest -D_GNU_SOURCE -I/home/autobuild/autobuild/instance-0/output-1/host/powerpc-buildroot-linux-uclibc/sysroot/usr/bin/../../usr/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Og -g0 -static -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -static conftest.c -lhwloc -llzma -L/home/autobuild/autobuild/instance-0/output-1/host/powerpc-buildroot-linux-uclibc/sysroot/usr/bin/../../usr/lib -lncurses -lm >&5 /home/autobuild/autobuild/instance-0/output-1/host/lib/gcc/powerpc-buildroot-linux-uclibc/10.3.0/../../../../powerpc-buildroot-linux-uclibc/bin/ld: /home/autobuild/autobuild/instance-0/output-1/host/powerpc-buildroot-linux-uclibc/sysroot/usr/bin/../../usr/lib/libhwloc.a(topology-xml-libxml.o): in function `hwloc_libxml_free_buffer': topology-xml-libxml.c:(.text+0x6a): undefined reference to `xmlFree' Fixes: - http://autobuild.buildroot.org/results/5d815ec08c580005a863df6ac9ac29deff7d4128 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
* | | Guess lxc or docker from /proc/1/mountsDaniel Lange2022-04-021-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment this is used to make the memory meter report sane values even if the host has ZFS and that leaks through into a containerized environment Fixes #863 Includes a clever check for magic PROC_PID_INIT_INO in /proc/self/ns/pid thanks to Pavel Snajdr (snajpa)
* | | Merge branch 'full_meter' of cgzones/htop into mainDaniel Lange2022-04-022-6/+9
|\ \ \ | | | | | | | | | | | | Closes #786
| * | | Do not leave empty last column in headerChristian Göttsche2021-12-092-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not leave empty last column in header meters by refactoring the width and separator logic. Closes: #784
* | | | Merge branch 'main' (Linux: fix crash in LXD, fixes #965) of er-azh/htop ↵Daniel Lange2022-04-021-5/+12
|\ \ \ \ | | | | | | | | | | | | | | | into main
| * | | | use xCalloc for allocating cpuDataer-azh2022-03-271-1/+1
| | | | |
| * | | | Linux: allocate cpuData before reading cpu count.er-azh2022-03-261-3/+10
| | | | |
| * | | | Linux: fix crash in LXDer-azh2022-03-261-1/+1
| | |/ / | |/| |
* / | | Fix header layout and meters reset if a header column is emptyDaniel Lange2022-04-021-2/+9
|/ / / | | | | | | | | | | | | Closes #880 Patch from BenBE and cgzones
* | | README: Add Archlinux build dependency install commandHeshamTB2022-03-241-0/+5
| | | | | | | | | | | | Signed-off-by: HeshamTB <hishaminv@gmail.com>
* | | Make sure License is correctly specified as GNU GPLv2+ in some more file headersDaniel Lange2022-03-143-4/+6
| | |
* | | Skip system slice nameBenny Baumann2022-03-061-0/+6
| | | | | | | | | | | | | | | This shortens paths like /system.slice/system-postgres.slice/postgres@12-main.service to /[S]/postgres@12-main. Without this some cgroup names for getty processes explode in length.
* | | Reduce column width spam by snapdBenny Baumann2022-03-061-0/+18
| | |
* | | Auto-size (normalized) CPU usage columnsBenny Baumann2022-03-0619-25/+60
| | |
* | | Linux: dynamically adjust column width of CGROUP C(ompressed)CGROUPChristian Göttsche2022-03-062-5/+16
| | |
* | | Linux: dynamically adjust the SECATTR column widthChristian Göttsche2022-03-065-2/+39
| | | | | | | | | | | | | | | | | | | | | | | | SELinux contexts can be quite long; adjust the column width dynamically at each cycle to the longest value. Also with the recent addition of multiple screens, over-long columns can be moved into their own screen.
* | | Process: Handle rounding ambiguity between 99.9 and 100.0Kumar2022-02-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Depending upon default behavior of the compiler and floating-point environment, compiler could round down the value between "99.9" and "100.0" to "99.0", instead of rounding it to the nearest value, "100.0". Note: The floating-point environment access and modification is only meaningful when "#pragma STD FENV_ACCESS" is set to "ON"[1]. Otherwise implementation is free to assume that floating-point control modes are always the default. So it would be a good idea to address the rounding ambiguity between "99.9" and "100.0" to become compiler agnostic. [1]: https://en.cppreference.com/w/c/numeric/fenv Credits: @Explorer09, thanks for the suggestion.

© 2014-2024 Faster IT GmbH | imprint | privacy policy