summaryrefslogtreecommitdiffstats
path: root/darwin/DarwinProcessList.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename ProcessList to ProcessTable throughoutNathan Scott2023-08-311-126/+0
| | | | | | | | | | | | Following up with some discusson from a few months back, where it was proposed that ProcessTable is a better name. This data structure is definitely not a list ... if it was one-dimensional it'd be a set, but in practice it has much more in common with a two-dimensional table. The Process table is a familiar operating system concept for many people too so it resonates a little in that way as well.
* Introduce Row and Table classes for screens beyond top-processesNathan Scott2023-08-301-4/+6
| | | | | | | | | This commit refactors the Process and ProcessList structures such they each have a new parent - Row and Table, respectively. These new classes handle screen updates relating to anything that could be represented in tabular format, e.g. cgroups, filesystems, etc, without us having to reimplement the display logic repeatedly for each new entity.
* Remove duplicate zeroing of global task accounting values on MacOSNathan Scott2023-06-061-6/+0
| | | | | This has already been performed in ProcessList.c before calling the platform-specific code, so this is a no-op.
* Adapt platform code for the new Machine base classNathan Scott2023-05-081-93/+9
| | | | | Move host-centric data to new derived <Platform>Machine classes, separate from process-list-centric data.
* Introduce Machine class for host-specific info (split from ProcessList)Nathan Scott2023-05-081-10/+21
| | | | | | | | | | | First stage in sanitizing the process list structure so that htop can support other types of lists too (cgroups, filesystems, ...), in the not-too-distant future. This introduces struct Machine for system-wide information while keeping process-list information in ProcessList (now much less). Next step is to propogate this separation into each platform, to match these core changes.
* Fix typo in code commentGuillaume Gomez2023-05-051-1/+1
|
* Refactor and consolidate dynamic meters/columns pointersNathan Scott2023-04-061-2/+2
| | | | | | | | This removes the duplication of dynamic meter/column hashtable pointers that has come in between the Settings and ProcessList structures - only one copy of these is needed. With the future planned dynamic screens feature adding another pointer, let us first clean this up before any further duplication happens.
* Darwin: increase buffer size each retryChristian Göttsche2022-09-231-1/+2
| | | | | | | Increase the buffer for the current running processes each retry to handle very busy systems. Closes: #118
* Refactor Platform_CompareKernelVersion APIAlexander Momchilov2021-09-261-1/+1
|
* Extract Darwin "PlatformHelpers"Alexander Momchilov2021-09-261-42/+2
|
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* Refactor Darwin platform unit conversion helpersAlexander Momchilov2021-08-251-8/+1
|
* Fix macOS CPU time calculationsAlexander Momchilov2021-08-231-4/+6
|
* PCP: support for 'dynamic columns' added at runtimeSohaib Mohamed2021-08-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements support for arbitrary Performance Co-Pilot metrics with per-process instance domains to form new htop columns. The column-to-metric mappings are setup using configuration files which will be documented via man pages as part of a follow-up commit. We provide an initial set of column configurations so as to provide new capabilities to pcp-htop: including configs for containers, open fd counts, scheduler run queue time, tcp/udp bytes/calls sent/recv, delay acct, virtual machine guests, detailed virtual memory, swap. Note there is a change to the configuration file path resolution algorithm introduced for 'dynamic meters'. First, look in any custom PCP_HTOP_DIR location. Then iterate, in priority order, users home directory, then local sysadmins files in /etc/pcp/htop, then readonly configuration files below /usr/share/pcp/htop. This final location becomes the preferred place for our own shipped meter and column files. The Settings file (htoprc) writing code is updated to not using the numeric identifier for dynamic columns. The same strategy used for dynamic meters is used here where we write Dynamic(name) so the name can be setup once more at start. Regular (static) columns writing to htoprc - i.e. numerically indexed - is unchanged.
* Add ProcessList_isCPUonlineChristian Göttsche2021-07-181-0/+9
|
* Rework CPU countingChristian Göttsche2021-07-181-3/+5
| | | | | | | | | | | Currently htop does not support offline CPUs and hot-swapping, e.g. via echo 0 > /sys/devices/system/cpu/cpu2/online Split the current single cpuCount variable into activeCPUs and existingCPUs. Supersedes: #650 Related: #580
* Add a new DynamicMeter class for runtime Meter extensionNathan Scott2021-07-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is based on exploratory work by Sohaib Mohamed. The end goal is two-fold - to support addition of Meters we build via configuration files for both the PCP platform and for scripts ( https://github.com/htop-dev/htop/issues/526 ) Here, we focus on generic code and the PCP support. A new class DynamicMeter is introduced - it uses the special case 'param' field handling that previously was used only by the CPUMeter, such that every runtime-configured Meter is given a unique identifier. Unlike with the CPUMeter this is used internally only. When reading/writing to htoprc instead of CPU(N) - where N is an integer param (CPU number) - we use the string name for each meter. For example, if we have a configuration for a DynamicMeter for some Redis metrics, we might read and write "Dynamic(redis)". This identifier is subsequently matched (back) up to the configuration file so we're able to re-create arbitrary user configurations. The PCP platform configuration file format is fairly simple. We expand configs from several directories, including the users homedir alongside htoprc (below htop/meters/) and also /etc/pcp/htop/meters. The format will be described via a new pcp-htop(5) man page, but its basically ini-style and each Meter has one or more metric expressions associated, as well as specifications for labels, color and so on via a dot separated notation for individual metrics within the Meter. A few initial sample configuration files are provided below ./pcp/meters that give the general idea. The PCP "derived" metric specification - see pmRegisterDerived(3) - is used as the syntax for specifying metrics in PCP DynamicMeters.
* Darwin: Always update usernameBenny Baumann2021-06-221-2/+5
|
* platform-dependent files included relative to main source directorymayurdahibhate2021-05-101-3/+3
|
* Use unsigned types for CPU counts and associated variablesChristian Göttsche2021-03-191-1/+1
|
* Fix include file ordering of generic headersNathan Scott2021-03-041-1/+1
|
* Move generic (shared) code into its own sub-directoryNathan Scott2021-03-041-1/+1
| | | | | | | | 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
* Drop usage of formatted error messages from <err.h>Christian Göttsche2021-01-071-1/+0
| | | | | | | They do not clean up the ncurses environment, leaving the terminal in a broken state. Also drop bare usage of exit(3).
* Fix CPU percentage on M1 silicon MacsLuke Groeninger2021-01-021-1/+1
|
* Remove duplicate newline in CRT_fatalError callsChristian Göttsche2020-12-191-4/+4
|
* Unhardcode tick-to-ms conversionAlexander Momchilov2020-12-191-1/+9
| | | | | | | | | 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.
* Add column in darwin to indicate whether the the process is running under ↵Dániel Bakai2020-12-131-1/+1
| | | | translation
* DarwinProcessList: retry getting list of all processes on ENOMEMChristian Göttsche2020-11-231-17/+15
| | | | | | | | | | | 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
* DarwinProcessList: mark local functions static and sort includesChristian Göttsche2020-11-171-17/+19
|
* Embracing branchesBenny Baumann2020-11-021-3/+6
|
* Spacing around operatorsBenny Baumann2020-11-021-6/+6
|
* Whitespace and indentation issuesBenny Baumann2020-11-021-83/+95
|
* Spacing after keywords (for)Benny Baumann2020-11-021-3/+3
|
* Spacing after keywords (if)Benny Baumann2020-11-021-5/+5
|
* Hold only a const version of Settings in ProcessChristian Göttsche2020-10-261-1/+1
|
* Drop tabs in source indentionsChristian Göttsche2020-10-201-3/+3
|
* Continue to update generic data in paused modeChristian Göttsche2020-10-191-1/+5
| | | | | | | | | Generic data, as CPU and memory usage, are used by Meters. In paused mode they would stop receiving updates and especially Graph Meters would stop showing continuous data. Improves: #214 Closes: #253
* Refactor generating starttime string into Process classChristian Göttsche2020-10-161-4/+1
|
* Update License consistently to GPLv2 as per COPYING fileDaniel Lange2020-10-051-1/+1
|
* Fail travis CI on compiler warningsChristian Göttsche2020-09-181-1/+0
|
* Switch variable/field naming from WhiteList to MatchListNathan Scott2020-09-091-2/+2
|
* Axe automated header generation.Zev Weiss2020-09-031-22/+0
| | | | | | | | | | | | | | Reasoning: - implementation was unsound -- broke down when I added a fairly basic macro definition expanding to a struct initializer in a *.c file. - made it way too easy (e.g. via otherwise totally innocuous git commands) to end up with timestamps such that it always ran MakeHeader.py but never used its output, leading to overbuild noise when running what should be a null 'make'. - but mostly: it's just an awkward way of dealing with C code.
* Refactor openzfs_sysctl_init() and ZfsArcMeter...Ross Williams2019-09-031-1/+1
| | | | | | | | | | | openzfs_sysctl_init() now returns void instead of int. The ZfsArcStats->enabled flag is set inside the init function now, instead of having to be set from its return value. Preparation for more flag setting in Compressed ARC commit. ZfsArcMeter_readStats() added and all Meter->values[] setting moved to it, eliminating duplicated code in {darwin,freebsd,linux,solaris}/Platform.c.
* Refactor common OpenZFS sysctl accessRoss Williams2019-07-071-76/+6
| | | | | Darwin and FreeBSD export zfs kstats through the same APIs, so moving functions into a common file.
* ZFS arcstats for Darwin (macOS / OS X)Ross Williams2019-07-071-0/+80
|
* Prevent possible NULL pointer deferenceAlan Barr2019-02-101-2/+1
| | | | Raised by cppcheck
* macOS: fix the switched version test (#772)pmalhaire2018-04-051-3/+8
|
* macOS: keep scanning thread for versions before High Sierra (#728)pmalhaire2018-03-261-3/+35
| | | | | Keep scanning threads for versions before High Sierra 13.0.0 and after 13.3.0.
* Darwin: disable thread reading due to bug in macOS High SierraHisham Muhammad2018-02-041-1/+2
|
* Scan threads for process state information.Hisham Muhammad2016-02-181-1/+3
| | | | | | Based on: http://stackoverflow.com/questions/6788274/ios-mac-cpu-usage-for-thread and https://github.com/max-horvath/htop-osx/blob/e86692e869e30b0bc7264b3675d2a4014866ef46/ProcessList.c This should be a fix for #361.

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