summaryrefslogtreecommitdiffstats
path: root/linux
Commit message (Collapse)AuthorAgeFilesLines
* Linux: use correct column alignment for wide fieldsChristian Göttsche2021-01-111-12/+19
| | | | | | | This affects: - PROC_COMM, PROC_EXE and CWD on Linux - JAIL on FreeBSD and DragonFlyBSD - ZONE on Solaris
* RichString_setAttrn: refactor to take a length instead of a stop indexChristian Göttsche2021-01-101-9/+9
| | | | Fixes: #459
* Hashtable: use more distinct typename for key typeChristian Göttsche2021-01-061-1/+1
|
* LibSensors: add support for Ryzen CPUsMatej Dian2021-01-061-1/+6
|
* Declare for loop variables inside the loopChristian Göttsche2021-01-061-2/+1
|
* Panel_new: reorder argumentsChristian Göttsche2021-01-041-1/+1
| | | | Reorder owner and type so they match the order of Panel_init
* XUtils: check for multiplication overflow in allocation sizeChristian Göttsche2021-01-021-2/+2
|
* Object: return int on comparisonChristian Göttsche2021-01-021-1/+1
| | | | | Comparisons do, due to the new introduced shaceship-comparisons, only return -1, 0, 1 or the result of strcmp().
* Only initialize and gather delay accounting data if a related column is enabledChristian Göttsche2021-01-013-25/+35
| | | | | Avoid creating and communicating over a netlink socket by default, which triggers cap_net_admin checks as root.
* Also find libsensors.so.4 for Fedora and friendsDaniel Lange2020-12-251-5/+7
|
* Linux: accept clock CPU frequencyChristian Göttsche2020-12-231-1/+3
| | | | | | | | | processor : 0 cpu : POWER8 (architected), altivec supported clock : 4024.000000MHz revision : 2.0 (pvr 004d 0200) Closes: #424
* Resolve clang-analyzer signed/unsigned comparison CI failureNathan Scott2020-12-221-2/+2
|
* DiD: Ensure string offsets are inside string boundariesBenny Baumann2020-12-211-0/+6
|
* Avoid NULL dereference on zombie processesBenny Baumann2020-12-211-2/+9
| | | | Fixes #361
* Make remaining number literals use uppercaseBenny Baumann2020-12-201-1/+1
|
* Use upper case numeric literalsChristian Göttsche2020-12-201-2/+2
| | | | See https://rules.sonarsource.com/c/RSPEC-818
* Mark Platform_defaultFields constChristian Göttsche2020-12-192-2/+2
|
* Merge Process_pidColumns into Process_fields and rework auto-fit for ↵Christian Göttsche2020-12-192-25/+10
| | | | PID-like columns
* Rework enum ProcessFieldChristian Göttsche2020-12-195-58/+58
| | | | | | 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
* LinuxProcess: drop dead Process columnsChristian Göttsche2020-12-192-38/+0
|
* Split boilerplate and platform-independent field comparisonBenny Baumann2020-12-191-1/+1
| | | | | | | | This acheives two things: - Allows for simple tie-breaking if values compare equal (needed to make sorting the tree-view stable) - Allows for platform-dependent overriding of the sort-order for specific fields Also fixes a small oversight on DragonFlyBSD when default-sorting.
* Invert Process_compare resolution so that superclass matches run firstHisham Muhammad2020-12-191-15/+8
| | | | | | | | | | * This removes duplicated code that adjusts the sort direction from every OS-specific folder. * Most fields in a regular htop screen are OS-independent, so trying Process_compare first and only falling back to the OS-specific compareByKey function if it's an OS-specific field makes sense. * This will allow us to override the sortKey in a global way without having to edit each OS-specific file.
* Move macro definitions close to usageChristian Göttsche2020-12-161-0/+5
|
* Use common naming for bare enum typesChristian Göttsche2020-12-161-2/+2
|
* LibSensors: fix unversioned libsensors library nameChristian Göttsche2020-12-151-2/+2
|
* LibSensors: restore temperature for Raspberry PiChristian Göttsche2020-12-151-0/+3
| | | | | | | sensors output: cpu_thermal-virtual-0 Adapter: Virtual device temp1: +58.0 C (crit = +90.0 C)
* Handle absence of package CPU temperatureChristian Göttsche2020-12-143-44/+60
| | | | Resolves: #389
* Harden the extraction of boot time for the Linux platformNathan Scott2020-12-141-12/+11
| | | | | | | | | There is a possible path - albeit theoretical really - through the btime initialization code in Linux ProcessList_new(), when String_startsWith() is always false, which can result in btime not being initialized. This commit refactors the code to remove that possibility.
* Cleanup initialization of jiffies on the Linux platformNathan Scott2020-12-143-18/+15
| | | | | | | | | | Small cleanups - add error handling, remove a local static variable and refactor LinuxProcess_adjustTime (also rename it, as its in LinuxProcessList.c not LinuxProcess.c) - and while there, move the related 'btime' global variable into LinuxProcessList.c so it can be made static. Resolves https://github.com/htop-dev/htop/issues/384
* Simplify initialization of the Linux haveSmapsRollup variableNathan Scott2020-12-141-8/+2
|
* Merge branch 'fix-dlopen-libsensors-debian' of fasterit/htopDaniel Lange2020-12-131-3/+7
|\
| * Fix dlopen issue for libsensors5 in Debian Buster, BullseyeDaniel Lange2020-12-121-3/+7
| | | | | | | | | | | | | | libsensors.so is provided only by the -dev package, so search for libsensors.so.5 (installed from the libsensors5 package) explicitly see: dpkg-query -S libsensors.so
* | Define O_PATH if not already definedChris Burr2020-12-131-0/+6
|/
* Cull the definitions of pageSize and pageSizeKB from CRT.cNathan Scott2020-12-103-7/+22
| | | | | | | | | | | | | | | By storing the per-process m_resident and m_virt values in the form htop wants to display them in (KB, not pages), we no longer need to have definitions of pageSize and pageSizeKB in the common CRT code. These variables were never really CRT (i.e. display) related in the first place. It turns out the darwin platform code doesn't need to use these at all (the process values are extracted from the kernel in bytes not pages) and the other platforms can each use their own local pagesize variables, in more appropriate locations. Some platforms were actually already doing this, so this change is removing duplication of logic and variables there.
* PSI Meter: use constant width and only print ten-duration as barChristian Göttsche2020-12-081-4/+8
|
* Additional code simplificationBenny Baumann2020-12-081-1/+2
| | | | Additional correction for #375
* Split RichString_(append|appendn|write) into wide and asciiChristian Göttsche2020-12-084-22/+24
| | | | | | | | RichString_writeFrom takes a top spot during performance analysis due to the calls to mbstowcs() and iswprint(). Most of the time we know in advance that we are only going to print regular ASCII characters.
* SELinuxMeter: silence comparison warning on 32-bitChristian Göttsche2020-12-071-1/+1
| | | | | | | | | linux/SELinuxMeter.c: In function ‘hasSELinuxMount’: linux/SELinuxMeter.c:38:21: warning: comparison of integer expressions of different signedness: ‘__fsword_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare] 38 | if (sfbuf.f_type != SELINUX_MAGIC) { | ^~ Origin: https://github.com/SELinuxProject/selinux/blob/7df27b78e9eecbe65a57cdfefb9e51f547231b20/libselinux/src/init.c#L40
* Introduce METER_BUFFER_CHECK and METER_BUFFER_APPEND_CHR to cleanup writing ↵Christian Göttsche2020-12-061-25/+10
| | | | | | to bar buffers Closes: #294
* Use size_t as type for buffer length in ProcessChristian Göttsche2020-12-061-1/+1
|
* Use size_t as len type for Meter_UpdateValuesChristian Göttsche2020-12-064-8/+12
| | | | Most of the time the parameter is passed to snprintf type functions
* IWYU updateChristian Göttsche2020-12-066-8/+4
|
* Initialize buffer for retrieved pathBenny Baumann2020-12-061-1/+2
| | | | | | This avoids a warning on GCC 11. Fixes #369
* LinuxProcessList: add underscore suffix for raw struct nameChristian Göttsche2020-12-051-1/+1
| | | | Fit the general coding style
* Resolve conversion from ssize_t to int for readlink return valueChristian Göttsche2020-12-051-1/+1
|
* Convert personal copyright authorship to teamChristian Göttsche2020-12-044-4/+4
|
* Linux: avoid float division by 0 after system sleepChristian Göttsche2020-12-031-2/+3
| | | | | linux/LinuxProcessList.c:1403:63: runtime error: division by zero SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior linux/LinuxProcessList.c:1403:63 in
* Add Linux cwd process columnChristian Göttsche2020-12-033-1/+48
|
* Dynamically load libsensors at runtimeChristian Göttsche2020-12-025-48/+136
|
* Add xReadfile wrapper for reading small to medium size filesChristian Göttsche2020-12-023-134/+31
| | | | | | Inspired by proposed Linux syscall Avoid file descriptor leaks like 4af8c63f

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