summaryrefslogtreecommitdiffstats
path: root/darwin
AgeCommit message (Collapse)Author
2021-04-14Rework TTY columnChristian Göttsche
* Rename internal identifier from TTY_NR to just TTY * Unify column header on platforms * Use devname(3) on BSD derivate to show the actual terminal, simplifies current FreeBSD implementation. * Use 'unsigned long int' as id type, to fit dev_t on Linux. Only on Solaris the terminal path is not yet resolved.
2021-04-05Request the realtime and monotonic clock times once per sampleNathan Scott
Refactor the sample time code to make one call to gettimeofday (aka the realtime clock in clock_gettime, when available) and one to the monotonic clock. Stores each in more appropriately named ProcessList fields for ready access when needed. Every platform gets the opportunity to provide their own clock code, and the existing Mac OS X specific code is moved below darwin instead of in Compat. A couple of leftover time(2) calls are converted to use these ProcessList fields as well, instead of yet again sampling the system clock. Related to https://github.com/htop-dev/htop/pull/574
2021-03-22Use a platform-specific routine for long option usageNathan Scott
Related to https://github.com/htop-dev/htop/pull/564
2021-03-22Each platform defines its own long opt macro, prefer printfNathan Scott
Follow up on the two items of feedback from cgzones review, and resolve a build failure picked up by CI on Mac OS X. Related to https://github.com/htop-dev/htop/pull/564
2021-03-22Move libcap use to (Linux) platform-specific codeNathan Scott
The libcap code is Linux-specific so move it all below the linux/ platform subdirectory. As this feature has custom command-line long options I provide a mechanism whereby each platform can add custom long options that augment the main htop options. We'll make use this of this with the pcp/ platform in due course to implement the --host and --archive options there. Related to https://github.com/htop-dev/htop/pull/536
2021-03-19Use unsigned types for CPU counts and associated variablesChristian Göttsche
2021-03-17MemoryMeter: show shared memory before cachedChristian Göttsche
Shared memory is less free-able than cached memory. Show it beforehand.
2021-03-04Fix include file ordering of generic headersNathan Scott
2021-03-04Move generic (shared) code into its own sub-directoryNathan Scott
Code that is shared across some (but not all) platforms is moved into a 'generic' home. Makefile.am cleanups to match plus some minor alphabetic reordering/formatting. As discussed in https://github.com/htop-dev/htop/pull/553
2021-03-04Separate display from sampling in SysArch and Hostname MetersNathan Scott
Several of our newer meters have merged coding concerns in terms of extracting values and displaying those values. This commit rectifies that for the SysArch and Hostname meters, allowing use of this code with alternative front/back ends. The SysArch code is also refined to detect whether the platform has an os-release file at all and/or the sys/utsname.h header via configure.ac.
2021-03-03Darwin: add normalized CPU percentage columnChristian Göttsche
Missed in 15eab2012d21
2021-03-01Fix integer sizing issues in the NetworkIO MeterNathan Scott
On Linux kernels the size of the values exported for network device bytes and packets has used a 64 bit integer for quite some time (2.6+ IIRC). Make the procfs value extraction use correct types and change internal types used to rate convert these counters (within the NetworkIO Meter) 64 bit integers, where appropriate.
2021-01-31[#480] SysArchMeter to view kernel/arch infoahgamut
At start, SysArchMeter calls the uname function to obtain the kernel version and architecture. If available, the distro version is obtained by calling lsb_release. The obtained values are stored in static variables and used when updating the meter.
2021-01-21Sort out the mess around column sorting that had accumulated over timeDaniel Lange
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-02Fix CPU percentage on M1 silicon MacsLuke Groeninger
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-20Make remaining number literals use uppercaseBenny Baumann
2020-12-19Remove duplicate newline in CRT_fatalError callsChristian Göttsche
2020-12-19Unhardcode tick-to-ms conversionAlexander Momchilov
Division by 100000.0 worked because `sysconf(_SC_CLK_TCK)` happened to be 100. By unhardcoding: 1) It becomes more clear what this 100000.0 figure comes from. 2) It protects against bugs in the case `sysconf(_SC_CLK_TCK)` ever changes.
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-13Merge branch 'fix_mach_timebase' of benbe/htopDaniel Lange
2020-12-13Add column in darwin to indicate whether the the process is running under ↵Dániel Bakai
translation
2020-12-13Move Process_fields from darwin/Platform to darwin/DarwinProcessDániel Bakai
2020-12-13Correct timebase for non-x86 CPUs on DarwinBenny Baumann
Fixes: #368
2020-12-13Sort include in Darwin platform headersBenny Baumann
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-11-25Unify naming of first argument of Platform_getBatteryChristian Göttsche
Use percent throughout
2020-11-23DarwinProcessList: retry getting list of all processes on ENOMEMChristian Göttsche
The process count might change between the two sysctl() calls getting the size and getting the data. Retry (3 times) in case the data-retrieval sysctl() call fails with ENOMEM. see http://mirror.informatimago.com/next/developer.apple.com/qa/qa2001/qa1123.html Related: #118
2020-11-23Merge branch 'cleanup-init-done' into masterNathan Scott
2020-11-21Rename virtual memory column from M_SIZE to M_VIRTChristian Göttsche
Closes: #325
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-17DarwinProcessList: mark local functions static and sort includesChristian Göttsche
2020-11-17DarwinProcess: mark local function static and sort includesChristian Göttsche
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-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 (for)Benny Baumann
2020-11-02Spacing after keywords (if)Benny Baumann
2020-11-02Spacing after keywords (while)Benny Baumann
2020-10-29FreeBSD: implement Platform_getDiskIO()Christian Goettsche
2020-10-27Drop always true conditionChristian Göttsche