summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Linux: do not always read /proc/<pid>/statusChristian Göttsche2024-04-061-2/+9
| | | | | | | | | #1211 showed reading /proc/<pid>/status might have a significant performance impact. Do not read by default only if actually needed, since the permitted capabilities are no longer gather from it. Improves: 8ea144df ("Linux: Refactor /proc/<pid>/status parsing") Improves: #1211
* Linux: reorder some calls in LinuxProcessList_recurseProcTree()Christian Göttsche2024-04-061-26/+34
| | | | | | Improve maintainability by reordering calls in LinuxProcessList_recurseProcTree() to group them by side-effect or interdependency.
* Linux: update gathering information regarding threadsChristian Göttsche2024-04-064-39/+156
| | | | | | | | | Document for each block gathering information about a task whether the information is shared for the whole process or specific to a single userland thread. Also avoid system calls for process-shared information and reuse the information from the main task.
* Linux: gather permitted capabilities via capget(2)Christian Göttsche2024-04-063-10/+24
| | | | | | | | | #1211 has shown reading /proc/<pid>/status might have a significant performance impact. It was started to be read by default to gather the permitted capabilities of the process. Gather permitted capabilities via the syscall capget(2) instead. cap_get_proc(3) is not used to avoid linking with -lcap.
* Adapt GPU_TIME field for the new nanoseconds formatExplorer092024-04-051-2/+2
| | | | Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* New Row_printNanoseconds() functionExplorer092024-04-052-0/+54
| | | | | | | | | It prints the time in one of these formats: nanoseconds, "fraction of seconds", "minutes + seconds + milliseconds". If the total time is greater than 10 minutes, it uses Row_printTime() to print higher time units. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* linux: use dlopen for libnl3 instead of dynamic linkingChristian Göttsche2024-04-053-51/+151
| | | | | | | | | | | Instead of the current behavior of dynamic linking against libnl3 and libnl-genl-3 when configured with --enable-delayacct, load the shared libraries on request, if any delay accounting related process field is active, via dlopen(3), similar to libsensors and libsystemd. Distribution, who currently build htop with --enable-delayacct, need to explicitly add libnl3 and libnl-genl-3 as runtime dependencies to continue supporting delay accounting out-of-the-box.
* linux: move libnl code into separate fileChristian Göttsche2024-04-055-113/+153
| | | | | | | Move all the code using libnl functionality into a separate file to ease modifications. No functional change.
* Read htoprc in modern location first before old oneExplorer092024-04-051-5/+2
| | | | | | | | | | Read htop configuration file in the modern location first ("~/.config/htop/htoprc") before trying the legacy location ("~/.htoprc"). This would prevent a case where configuration files exist in both locations and the new configuration gets replaced by the old one. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Avoid multiplication in calloc argumentChristian Göttsche2024-04-051-1/+1
|
* Use designated initializer moreChristian Göttsche2024-04-052-15/+19
| | | | | | | Designated initializers are supported in C99 and simplify struct initializations. All members not explicitly mentioned are default initialized to 0, and also modern compilers can warn on of those missing ones.
* Check for absolute paths in environment variablesChristian Göttsche2024-04-051-3/+3
| | | | | | Only use the environment variables HOME and XDG_CONFIG_HOME, or the home directory from getpwuid(3) if they are absolute paths. Avoid different behavior depending on the current working directory.
* Use size_t for array indices consistentlyBenny Baumann2024-04-051-5/+5
| | | | This avoids a compiler warning with GCC 14 and LTO claiming uninitialized use of data[i] in the last loop.
* Fix regression from storing monotonic time deltasBenny Baumann2024-04-051-1/+2
| | | | | | | | When starting htop the timestamp of the first scan must be far in the past to avoid showing all processes as being started just recently. Fixes: b61685779cdf696ba4135a97ce66075c337c7562
* Make memory leak in xRealloc explicitBenny Baumann2024-04-041-2/+9
| | | | | | | | | | | | | | | | | | | | | | | There is an edge case in xRealloc upon failure to realloc memory that manifests when the memory area pointed to by ptr contains pointers. As the structure of ptr is opaque to xRealloc there's no chance for properly releasing the memory for those indirect pointers. The best we could do is release ptr itself, leaving behind an indirect leak of those pointers inside the memory pointed to by ptr. This memory leak is picked up by analyzers like deepcode and GCC 14's -fanalyzer, which causes a lengthy, hard-to-parse diagnostic. Leaving the memory allocated and failing on this code path is properly ignored though (at least with GCC 14). A better solution thus is to keep ptr untouched and instead leak the whole block which avoids this diagnostic on indirectly leaked memory which is free'd by bailing shortly after anyway. This is not a fix, neither was the code we had before. This commit mainly documents an edge case and tries to avoid some hard-to-understand (but unavoidable) leak by making it more blatantly obvious in the used tooling.
* Simplify string formattingChristian Göttsche2024-03-281-2/+1
| | | | | | | Just call RichString_appendAscii() with the fixed string and avoid an superfluous snprintf() formatting. Suggested-by: Explorer09
* README: swap regular file and symlinkChristian Hesse2024-03-272-189/+189
| | | | | | | This allows the markdown formatted page to be rendered correctly in other web frontends, like cgit. https://git.zx2c4.com/cgit/about/
* CRT: handle (ignore) signals `USR1` and `USR2`Christian Hesse2024-03-271-0/+4
| | | | These should not kill the application.
* Linux: Correctly mark trailing offline CPU threadsMartin Rys2024-03-271-7/+18
|
* Fix typoChristian Göttsche2024-03-271-1/+1
| | | | [ci skip]
* Avoid glibc FILE API for number of open filesBenny Baumann2024-03-271-5/+5
|
* Avoid glibc FILE API for maxpidBenny Baumann2024-03-271-9/+15
|
* Avoid glibc FILE API for loadavgBenny Baumann2024-03-271-13/+14
|
* Avoid glibc FILE API for uptime readingBenny Baumann2024-03-271-7/+13
|
* Avoid glibc FILE API for secattrBenny Baumann2024-03-271-10/+4
|
* Avoid glibc FILE API for oom_scoreBenny Baumann2024-03-271-10/+15
|
* Avoid glibc FILE voodooBenny Baumann2024-03-271-4/+5
| | | | Addresses #1408
* Linux: scan GPU based on previous activityChristian Göttsche2024-03-272-6/+13
| | | | | | Instead of ignoring the standard file descriptors 0, 1 and 2 scan for GPU usage of a process only if that process had activity last cycle or its last scan was more than five seconds ago.
* Linux: add GPU meter and process columnChristian Göttsche2024-03-2714-2/+560
| | | | | | | Based on the DRM client usage stats[1] add statistics for GPU time spend and percentage utilization. [1]: https://www.kernel.org/doc/html/latest/gpu/drm-usage-stats.html
* Short circuit zero time in Row_printTime()Christian Göttsche2024-03-271-0/+8
| | | | Bail out early if the passed time is 0 and shadow the result.
* Introduce String_eq_nullable()Christian Göttsche2024-03-271-0/+10
|
* Introduce autoTitleRightAlign column flagChristian Göttsche2024-03-2711-8/+13
| | | | | | Instead of handling PERCENT_CPU as a special case for whether to align the title of a dynamically sized column to the right or the left introduce a new flag, which can be reused by other columns.
* Store time of the previous process scanChristian Göttsche2024-03-272-3/+8
| | | | | | | The difference of scans is useful for utilization calculations. To avoid divisions by 0 on first scan set monotonicMs also on first scan.
* TypoBenny Baumann2024-03-221-1/+1
|
* Check for sufficient buffer space only after clampingBenny Baumann2024-03-221-2/+3
| | | | The clamping itself has a sanity check when debug mode is active.
* Simplify expression in Process_updateCPUFieldWidths()Explorer092024-03-221-1/+1
| | | | Because the compilers weren't yet able to optimize this one. :)
* Check width in Row_printPercentage()Christian Göttsche2024-03-201-0/+4
| | | | | | | | | | The passed width should always be at least 4, otherwise printing will always truncate and lead to an abort(). The passed should not be greater or equal to the available buffer size, otherwise printing will always truncate and lead to an abort(). Add fallback for non debug builds.
* Avoid too large CPU field widthsChristian Göttsche2024-03-201-1/+1
| | | | | In case the current CPU usage percentage is NAN the width calculation is invalid. Use the default with of 4, which is appropriate for "N/A ".
* ci: update LLVM repositoriesChristian Göttsche2024-03-201-4/+4
| | | | | The GitHub runners for the LLVM jobs are using ubuntu-latest, which is as of today Ubuntu 22.04 (jammy).
* Revert "Workaround for ASAN-induced segfaults in Github Ubuntu runner images"Christian Göttsche2024-03-201-5/+0
| | | | | | Should be fixed in LLVm 17: https://github.com/llvm/llvm-project/commit/fb77ca05ffb4f8e666878f2f6718a9fb4d686839 This reverts commit 53bd369be760aaeb5e28cb965e9edcfb3f232d92.
* ci: bump to LLVM 18Christian Göttsche2024-03-201-14/+14
|
* Replace OpenCollective with Hack ClubDaniel Lange2024-03-201-1/+1
|
* Fix the compiler name for OpenBSD.fraggerfox2024-03-181-1/+1
|
* Ignore FOCUS_IN and FOCUS_OUT events if these have been activated within xtermDaniel Lange2024-03-143-0/+7
| | | | Closes: #1410
* Workaround for ASAN-induced segfaults in Github Ubuntu runner imagesDaniel Lange2024-03-141-0/+5
|
* Merge branch 'feat/refuse-saving-symlinked-config' (branch name superseded) ↵Daniel Lange2024-03-123-3/+14
|\ | | | | | | of Scrumplex/htop
| * Print message if config file was resolvedSefa Eyeoglu2024-03-123-7/+12
| | | | | | | | Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
| * Resolve configuration pathSefa Eyeoglu2024-03-111-0/+6
|/ | | | | | | | Some configuration systems might link a htop configuration file and we don't really want to replace the symlink but rather its source. This will also allow us to fail in case the source is read only. Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
* Add Solaris to the CIfraggerfox2024-02-291-0/+21
|
* Add Dragonfly BSD to the CIfraggerfox2024-02-291-0/+23
|

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