summaryrefslogtreecommitdiffstats
path: root/ProcessList.c
Commit message (Collapse)AuthorAgeFilesLines
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* PCP: support for 'dynamic columns' added at runtimeSohaib Mohamed2021-08-131-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Rework CPU countingChristian Göttsche2021-07-181-1/+2
| | | | | | | | | | | 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
* Pointer indication aligned to typenameBenny Baumann2021-07-151-4/+4
|
* Add a new DynamicMeter class for runtime Meter extensionNathan Scott2021-07-071-1/+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.
* Call makeCommandStr on all platformsBenny Baumann2021-05-231-2/+2
|
* Rename command line field from comm to cmdlineBenny Baumann2021-05-231-1/+1
|
* cleaned up includes with iwyumayurdahibhate2021-05-101-1/+0
|
* Avoid implicit pointer to bool conversion in assignmentChristian Göttsche2021-04-211-1/+1
| | | | Improve readability
* Drop ProcessList_get and ProcessList_sizeChristian Göttsche2021-04-211-10/+2
| | | | Only used inside ProcessList.c and only once each.
* Update timestamps for the special process scans at startup alsoNathan Scott2021-04-091-1/+3
| | | | Resolves https://github.com/htop-dev/htop/issues/592
* Request the realtime and monotonic clock times once per sampleNathan Scott2021-04-051-15/+12
| | | | | | | | | | | | | | | | 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
* ProcessList: fix treeview on OpenBSD when hiding kernel threadsChristian Göttsche2021-03-201-0/+5
| | | | | | | | Currently the tree-view is empty on OpenBSD when kernel threads are hidden, cause the kernel thread 'swapper' has pid 0 and gets treated as root of the tree and parent of 'init'. Do not build any tree with a pid 0 root node.
* RichString: do not unnecessarily clean whole bufferChristian Göttsche2021-03-171-1/+1
| | | | | | | The local stack buffer does not need to be cleaned to zeros when - just initialized, cause the length is set to 0 and the first character is set to '\0', so all printing functions will safely stop - no further used, i.e. the variable goes out of scope
* Improve process followingChristian Göttsche2021-03-141-5/+15
| | | | | | | | | - stay in follow mode on sort inversion (I) - stay in follow mode after viewing help screen (h) - select parent process (where available) when having followed a thread and hiding these (H) Closes: #560
* InfoScreen/ProcessList: do not access Vector internalsChristian Göttsche2021-03-121-1/+1
| | | | Use wrapper function to encapsulate the Vector structure
* Follow followed process when switching thread visibilitiesChristian Göttsche2021-03-031-0/+8
| | | | | | | Do not stop following a process when switching the visibility of userland or kernel threads. Related: #557
* Make the first tree item stable on expand / collapse againDaniel Lange2021-02-281-1/+1
| | | | Regression introduced with 06b1674
* Option and key ("*") to collapse / expand all branches under PID 1Daniel Lange2021-02-131-0/+10
| | | | | | | (and PID 2 if kernel threads are shown) Based on hishamhm/htop#510 by Krishna Chaitanya, B Closes #68
* Improve handling when selected last process entryChristian Göttsche2021-01-311-1/+14
| | | | | | | | If the last process entry is selected and the process dies, stay at the end of the list and do not jump to the start. Also if the last entry is selected keep, after rebuilding the process list due to a new scan, the last entry selected.
* Sort out the mess around column sorting that had accumulated over timeDaniel Lange2021-01-211-1/+1
|
* RichString: implement safe rewindChristian Göttsche2021-01-151-1/+1
| | | | | The current rewind logic causes issues when rewinding over the short string optimization boundary.
* Mark several non-modified pointer variables constChristian Göttsche2021-01-111-4/+4
|
* Exit follow mode cleanly after followed process diesChristian Göttsche2021-01-101-4/+8
|
* Show arrow indicating order of sorted process columnChristian Göttsche2021-01-071-0/+7
|
* Object: return int on comparisonChristian Göttsche2021-01-021-2/+2
| | | | | Comparisons do, due to the new introduced shaceship-comparisons, only return -1, 0, 1 or the result of strcmp().
* Merge Process_pidColumns into Process_fields and rework auto-fit for ↵Christian Göttsche2020-12-191-12/+16
| | | | PID-like columns
* Separate tree and list sort ordersHisham Muhammad2020-12-191-2/+4
| | | | | | | | | | | | Implements the suggestion from https://github.com/htop-dev/htop/issues/399#issuecomment-747861013 Thanks to the refactors from 0bd5c8fb5da and 6393baa74e5, this was really easy and clean to do. It maintains the "Tree view always by PID" option in the Settings, which results in some specific behaviors such as "clicking on the column header to exit tree view" and "picking a new sort order to exit tree view", for the sake of the muscle memory of long time htop users. :)
* Add "Tree view is always sorted by PID" option to mimic htop 2 behaviorHisham Muhammad2020-12-191-4/+12
|
* Fix typoChristian Göttsche2020-12-181-1/+1
|
* ProcessList: save scan time in millisecondChristian Göttsche2020-12-181-2/+4
| | | | | The delay is saved in deciseconds, use a bigger resolution to avoid timing irregularities.
* Support clock_gettime() on OSX El Capitan and earlierChristian Göttsche2020-12-181-3/+3
|
* Additional code simplificationBenny Baumann2020-12-081-9/+6
| | | | Additional correction for #375
* Split RichString_(append|appendn|write) into wide and asciiChristian Göttsche2020-12-081-2/+2
| | | | | | | | 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.
* IWYU updateChristian Göttsche2020-12-061-0/+1
|
* Silence possible NULL dereferenceChristian Göttsche2020-12-031-1/+2
| | | | | | | | | | | Found by compiling with LTO ProcessList.c: In function ‘ProcessList_updateTreeSetLayer’: ProcessList.c:195:15: error: potential null pointer dereference [-Werror=null-dereference] 195 | if (proc->tree_depth == deep && proc->tree_left > left && proc->tree_right < right) { | ^ ProcessList.c:195:15: error: potential null pointer dereference [-Werror=null-dereference] ProcessList.c:195:15: error: potential null pointer dereference [-Werror=null-dereference]
* Minor code streamliningBenny Baumann2020-12-021-3/+3
|
* Some minor spelling issuesBenny Baumann2020-12-021-10/+12
|
* Avoid expensive build of tree when not using itBenny Baumann2020-12-021-7/+9
|
* Avoid useless search for pid 0Benny Baumann2020-12-021-0/+5
|
* Reorder field initialization to group fields by taskBenny Baumann2020-12-021-8/+10
|
* Code style cleanup and documentation/commentsBenny Baumann2020-12-021-29/+47
|
* Use common values for initial size estimates for HashtablesBenny Baumann2020-12-021-3/+3
|
* Fix issue with inconsistent displayTreeSetMaxim Zhiburt2020-12-021-7/+22
|
* Implement sorting in tree modeMaxim Zhiburt2020-12-021-62/+228
|
* Include merge status with column title when enabledNarendran Gopalakrishnan2020-11-241-4/+5
|
* Improving Command display/sortNarendran Gopalakrishnan2020-11-241-1/+1
|
* fix indentChristian Göttsche2020-11-211-1/+1
|
* Apply patch from BenBE as per ↵Daniel Lange2020-11-161-11/+7
| | | | https://github.com/htop-dev/htop/pull/241#issuecomment-720081138
* Merge branch 'hili-new-old' of adsr/htop into highlight-new-old-processesDaniel Lange2020-11-161-5/+40
|\

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