summaryrefslogtreecommitdiffstats
path: root/freebsd
AgeCommit message (Collapse)Author
2021-01-12kfreeBSD: include config.h for _GNU_SOURCE (part 2)Christian Göttsche
strcasestr(3) is a GNU extension and when compiling freebsd/Platform.c on kfreebsd for Debian <string.h> is included before we define _GNU_SOURCE, so the function is not available. In file included from ./Object.h:16, from ./ListItem.h:12, from ./Meter.h:16, from ./Header.h:10, from ./Action.h:15, from freebsd/Platform.h:13, from freebsd/Platform.c:8: ./XUtils.h: In function ‘String_contains_i’: ./XUtils.h:43:11: warning: implicit declaration of function ‘strcasestr’; did you mean ‘strcasecmp’? [-Wimplicit-function-declaration] 43 | return strcasestr(s1, s2) != NULL; | ^~~~~~~~~~ | strcasecmp ./XUtils.h:43:30: warning: comparison between pointer and integer 43 | return strcasestr(s1, s2) != NULL; | ^~ In file included from ./Object.h:16, from ./ProcessList.h:16, from freebsd/FreeBSDProcessList.h:15, from freebsd/FreeBSDProcessList.c:8: ./XUtils.h: In function ‘String_contains_i’: ./XUtils.h:43:11: warning: implicit declaration of function ‘strcasestr’; did you mean ‘strcasecmp’? [-Wimplicit-function-declaration] 43 | return strcasestr(s1, s2) != NULL; | ^~~~~~~~~~ | strcasecmp ./XUtils.h:43:30: warning: comparison between pointer and integer 43 | return strcasestr(s1, s2) != NULL; | ^~
2021-01-12kfreeBSD: include config.h for _GNU_SOURCEChristian Göttsche
strcasestr(3) is a GNU extension and when compiling freebsd/Platform.c on kfreebsd for Debian <string.h> is included before we define _GNU_SOURCE, so the function is not available. In file included from ./Object.h:16, from ./ListItem.h:12, from ./Meter.h:16, from ./Header.h:10, from ./Action.h:15, from freebsd/Platform.h:13, from freebsd/Platform.c:8: ./XUtils.h: In function ‘String_contains_i’: ./XUtils.h:43:11: warning: implicit declaration of function ‘strcasestr’; did you mean ‘strcasecmp’? [-Wimplicit-function-declaration] 43 | return strcasestr(s1, s2) != NULL; | ^~~~~~~~~~ | strcasecmp ./XUtils.h:43:30: warning: comparison between pointer and integer 43 | return strcasestr(s1, s2) != NULL; | ^~ In file included from ./Object.h:16, from ./ProcessList.h:16, from freebsd/FreeBSDProcessList.h:15, from freebsd/FreeBSDProcessList.c:8: ./XUtils.h: In function ‘String_contains_i’: ./XUtils.h:43:11: warning: implicit declaration of function ‘strcasestr’; did you mean ‘strcasecmp’? [-Wimplicit-function-declaration] 43 | return strcasestr(s1, s2) != NULL; | ^~~~~~~~~~ | strcasecmp ./XUtils.h:43:30: warning: comparison between pointer and integer 43 | return strcasestr(s1, s2) != NULL; | ^~
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-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-07Drop usage of formatted error messages from <err.h>Christian Göttsche
They do not clean up the ncurses environment, leaving the terminal in a broken state. Also drop bare usage of exit(3).
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().
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-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-11Drop redundant sys/dirent.h includeGraham Inggs
sys/dirent.h is included by dirent.h in FreeBSD, and does not exist in Debian GNU/kFreeBSD
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-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-05FreeBSD: fix crash on empty environmentChristian Goettsche
e.g. on kernel threads
2020-11-27Drop unused global ProcessList memory fieldsNathan Scott
The global ProcessList structure contains a couple of unused fields. 'sharedMem' has never been used by any Meter, since its not been anything other than zero in Linux /proc/meminfo for many, many years. The freeMem field is only used in the usedMem calculation, so it can reside on the stack like some other memory variables used within-calculations-only and not exposed to the user via a Meter.
2020-11-25Unify naming of first argument of Platform_getBatteryChristian Göttsche
Use percent throughout
2020-11-23Merge branch 'cleanup-init-done' into masterNathan Scott
2020-11-23Consistent ordering of function declarations for FreeBSDNathan Scott
2020-11-22Simplify code flow by inlining declarations where they are usedBenny Baumann
Note that xStrdup always returns non-NULL, thus the one error case cannot be reached.
2020-11-22No need to check for change when no action is requiredBenny Baumann
2020-11-21Simplify page size related calculationsChristian Göttsche
2020-11-21Rename virtual memory column from M_SIZE to M_VIRTChristian Göttsche
Closes: #325
2020-11-19IWYU update (FreeBSD)Christian Goettsche
2020-11-19Minor cleanups to platform-specific init and doneNathan Scott
Move platform-specific code out of the htop.c main function and into the platform sub-directories - primarily this is the Linux procfs path check and sensors setup/teardown; not needed on any other platforms. No functional changes here.
2020-11-18Merge individual Battery.[ch] files into Platform.[ch]Nathan Scott
Consistent with everything else involving platform-specific calls from core htop code.
2020-11-17Merge branch 'temperature_v2' of cgzones/htopDaniel Lange
Closes #111, closes #49 Closes #93 - thank you for leading the way @DX37 (Maxim Kurnosenko)!
2020-11-16Add process column for normalized CPU usageChristian Göttsche
Shows the process CPU usage divided by the number of CPU cores
2020-11-16Show CPU temperature in CPU meterChristian Göttsche
Show the CPU temperature in the CPU meter, like CPU frequency, instead of using an extra Meter.
2020-11-15Introduce spaceship comparison for ProcessesChristian Göttsche
If currently two unsigned values are compared via `a - b`, in the case b is actually bigger than a, the result will not be an negative number (as -1 is expected) but a huge positive number as the subtraction is an unsigned subtraction. Avoid over-/underflow affected operations; use comparisons. Modern compilers will generate sane code, like: xor eax, eax cmp rdi, rsi seta al sbb eax, 0 ret
2020-11-15Resolve merge conflicts, merge #298 "Macro cleanup" from @BenBEDaniel Lange
2020-11-14Split platform dependent parts for file locks screenBenny Baumann
2020-11-02Embracing branchesBenny Baumann
2020-11-02Spacing around operatorsBenny Baumann
2020-11-02Whitespace and indentation issuesBenny Baumann
2020-11-02Spacing after keywords (if)Benny Baumann
2020-10-29Add compat wrapper for fstatatChristian Göttsche
2020-10-29FreeBSD: update ProcessChristian Göttsche
2020-10-29FreeBSD: update ProcessListChristian Göttsche
2020-10-29FreeBSD: implement Platform_getDiskIO()Christian Goettsche
2020-10-29FreeBSD: Platform updateChristian Göttsche
2020-10-29FreeBSD: rework tty process columnChristian Goettsche
2020-10-28Unify function argument namesChristian Göttsche
Name first argument of ProcessList_goThroughEntries consistently super Name first argument of ProcessList_new consistently userTable
2020-10-27Drop duplicate assignmentChristian Göttsche
2020-10-26Hold only a const version of Settings in ProcessListChristian Göttsche
2020-10-26Hold only a const version of Settings in ProcessChristian Göttsche
2020-10-26Mark process parameter of Process_writeField consistently constChristian Göttsche
2020-10-26Hold only a const version of the ProcessList in MetersChristian Göttsche
2020-10-26Improve handling of no data in Disk and Network IO MetersChristian Göttsche
2020-10-26Simplify environment-reading codeRoss Williams
Suggested PR changes, thanks @cgzones