summaryrefslogtreecommitdiffstats
path: root/linux
AgeCommit message (Collapse)Author
2021-01-11Mark several non-modified pointer variables constChristian Göttsche
2021-01-11SELinuxMeter: hardcode SELINUX_MAGIC valueChristian Göttsche
Avoid <linux/magic.h> include, not found by musl-gcc. The value of SELINUX_MAGIC should really never change.
2021-01-11Linux: Add SwapCached to the swap meterDavid Zarzycki
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-11Mark several non-modified pointer variables constChristian Göttsche
2021-01-11Remove dead codeChristian Göttsche
2021-01-11Process: drop commLenChristian Göttsche
It is only used on Linux to optimize memory handling in case the command changes to a smaller-or-equal string. This "optimization" however causes more code bloat and maintenance cost on string handling issues than it gains.
2021-01-11Add wrapper function for free and strdupChristian Göttsche
Reduces code in callers and helps avoiding memory leaks.
2021-01-11Drop always false conditionChristian Göttsche
The previous if conditional branch would have been taken in case this condition would be true,
2021-01-11Linux: use correct column alignment for wide fieldsChristian Göttsche
This affects: - PROC_COMM, PROC_EXE and CWD on Linux - JAIL on FreeBSD and DragonFlyBSD - ZONE on Solaris
2021-01-10RichString_setAttrn: refactor to take a length instead of a stop indexChristian Göttsche
Fixes: #459
2021-01-06Hashtable: use more distinct typename for key typeChristian Göttsche
2021-01-06LibSensors: add support for Ryzen CPUsMatej Dian
2021-01-06Declare for loop variables inside the loopChristian Göttsche
2021-01-04Panel_new: reorder argumentsChristian Göttsche
Reorder owner and type so they match the order of Panel_init
2021-01-02XUtils: check for multiplication overflow in allocation sizeChristian Göttsche
2021-01-02Object: return int on comparisonChristian Göttsche
Comparisons do, due to the new introduced shaceship-comparisons, only return -1, 0, 1 or the result of strcmp().
2021-01-01Only initialize and gather delay accounting data if a related column is enabledChristian Göttsche
Avoid creating and communicating over a netlink socket by default, which triggers cap_net_admin checks as root.
2020-12-25Also find libsensors.so.4 for Fedora and friendsDaniel Lange
2020-12-23Linux: accept clock CPU frequencyChristian Göttsche
processor : 0 cpu : POWER8 (architected), altivec supported clock : 4024.000000MHz revision : 2.0 (pvr 004d 0200) Closes: #424
2020-12-22Resolve clang-analyzer signed/unsigned comparison CI failureNathan Scott
2020-12-21DiD: Ensure string offsets are inside string boundariesBenny Baumann
2020-12-21Avoid NULL dereference on zombie processesBenny Baumann
Fixes #361
2020-12-20Make remaining number literals use uppercaseBenny Baumann
2020-12-20Use upper case numeric literalsChristian Göttsche
See https://rules.sonarsource.com/c/RSPEC-818
2020-12-19Mark Platform_defaultFields constChristian Göttsche
2020-12-19Merge Process_pidColumns into Process_fields and rework auto-fit for ↵Christian Göttsche
PID-like columns
2020-12-19Rework enum ProcessFieldChristian Göttsche
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-19LinuxProcess: drop dead Process columnsChristian Göttsche
2020-12-19Split boilerplate and platform-independent field comparisonBenny Baumann
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.
2020-12-19Invert Process_compare resolution so that superclass matches run firstHisham Muhammad
* 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.
2020-12-16Move macro definitions close to usageChristian Göttsche
2020-12-16Use common naming for bare enum typesChristian Göttsche
2020-12-15LibSensors: fix unversioned libsensors library nameChristian Göttsche
2020-12-15LibSensors: restore temperature for Raspberry PiChristian Göttsche
sensors output: cpu_thermal-virtual-0 Adapter: Virtual device temp1: +58.0 C (crit = +90.0 C)
2020-12-14Handle absence of package CPU temperatureChristian Göttsche
Resolves: #389
2020-12-14Harden the extraction of boot time for the Linux platformNathan Scott
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.
2020-12-14Cleanup initialization of jiffies on the Linux platformNathan Scott
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
2020-12-14Simplify initialization of the Linux haveSmapsRollup variableNathan Scott
2020-12-13Merge branch 'fix-dlopen-libsensors-debian' of fasterit/htopDaniel Lange
2020-12-13Define O_PATH if not already definedChris Burr
2020-12-12Fix dlopen issue for libsensors5 in Debian Buster, BullseyeDaniel Lange
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
2020-12-10Cull the definitions of pageSize and pageSizeKB from CRT.cNathan Scott
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.
2020-12-08PSI Meter: use constant width and only print ten-duration as barChristian Göttsche
2020-12-08Additional code simplificationBenny Baumann
Additional correction for #375
2020-12-08Split RichString_(append|appendn|write) into wide and asciiChristian Göttsche
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.
2020-12-07SELinuxMeter: silence comparison warning on 32-bitChristian Göttsche
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
2020-12-06Introduce METER_BUFFER_CHECK and METER_BUFFER_APPEND_CHR to cleanup writing ↵Christian Göttsche
to bar buffers Closes: #294
2020-12-06Use size_t as type for buffer length in ProcessChristian Göttsche
2020-12-06Use size_t as len type for Meter_UpdateValuesChristian Göttsche
Most of the time the parameter is passed to snprintf type functions
2020-12-06IWYU updateChristian Göttsche