summaryrefslogtreecommitdiffstats
path: root/ProcessList.h
AgeCommit message (Collapse)Author
2021-08-25IWYU updateChristian Göttsche
2021-08-13PCP: support for 'dynamic columns' added at runtimeSohaib Mohamed
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.
2021-07-18Add ProcessList_isCPUonlineChristian Göttsche
2021-07-18Rework CPU countingChristian Göttsche
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
2021-07-07Add a new DynamicMeter class for runtime Meter extensionNathan Scott
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.
2021-05-10cleaned up includes with iwyumayurdahibhate
2021-04-21Drop ProcessList_get and ProcessList_sizeChristian Göttsche
Only used inside ProcessList.c and only once each.
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-04-05Merging all the points related to calculating time in one placeSohaib
The end goal is to consolidate all the points in htop that can only work in live-only mode today, so that will be able to inject PCP archive mode and have a chance at it working. The biggest problem we've got at this moment is all the places that are independently asking the kernel to 'give me the time right now'. Each of those needs to be audited and ultimately changed to allow platforms to manage their own idea of time. So, all the calls to gettimeofday(2) and time(2) are potential problems. Ultimately I want to get these down to just one or two. Related to https://github.com/htop-dev/htop/pull/574
2021-03-21Merge branch 'openbsd' of cgzones/htopDaniel Lange
2021-03-20OpenBSD: updateChristian Göttsche
* Set process data for: - minflt - majflt - processor - nlwp * Drop unimplemented nlwp column * Scan userland threads * Mark a 'Thread is currently on a CPU.' with 'R', and processes 'Currently runnable' with 'P', do confine with man:ps(1) and Linux. See https://man.openbsd.org/ps.1 * Show CPU frequency
2021-03-19Use unsigned types for CPU counts and associated variablesChristian Göttsche
2021-03-15Linux: individually show shared memoryChristian Göttsche
Shmem: Total memory used by shared memory (shmem) and tmpfs Source: https://www.kernel.org/doc/Documentation/filesystems/proc.txt Closes: #556
2021-02-13Option and key ("*") to collapse / expand all branches under PID 1Daniel Lange
(and PID 2 if kernel threads are shown) Based on hishamhm/htop#510 by Krishna Chaitanya, B Closes #68
2021-02-07Linux: overhaul memory partitionChristian Göttsche
Use similar calculation than procps. Show AvailableMemory in text mode. Use total minus available memory instead of manually computed used- memory as fraction part in bar mode (if available).
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
2020-12-02Implement sorting in tree modeMaxim Zhiburt
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-16Apply patch from BenBE as per ↵Daniel Lange
https://github.com/htop-dev/htop/pull/241#issuecomment-720081138
2020-11-16Merge branch 'hili-new-old' of adsr/htop into highlight-new-old-processesDaniel Lange
2020-11-15Mark ProcessList_keyAt argument constChristian Göttsche
2020-10-30Highlight new and old processes (#74)Adam Saponara
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-26Hold only a const version of Settings in ProcessListChristian Göttsche
2020-10-19Continue to update generic data in paused modeChristian Göttsche
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
2020-10-18Make all required includes explicitBenny Baumann
Information as seen by IWYU 0.12 + clang 9 on Linux
2020-10-07Mark Object classes and Object class fields constChristian Göttsche
2020-10-05Update License consistently to GPLv2 as per COPYING fileDaniel Lange
2020-09-29Sort headers/includesBenny Baumann
2020-09-09Switch variable/field naming from WhiteList to MatchListNathan Scott
2020-09-03Remove superfluous 'extern's from function declarations.Zev Weiss
Applied via: $ find * -name '*.h' -exec sed -i -r 's/^extern (.+\()/\1/;' {} + Suggested-by: Bert Wesarg <bert.wesarg@googlemail.com>
2020-09-03Axe automated header generation.Zev Weiss
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.
2020-08-18Re-generate all headers with latest scripts/MakeHeader.pyNathan Scott
Sync-up missing extern declarations for many functions.
2016-02-14Portable affinity using hwlocHisham
2015-04-09Fixes to use platform-specific compare routines.Hisham Muhammad
2015-04-02Merge branch 'master' into wipHisham Muhammad
Conflicts: Process.c Process.h htop.c linux/LinuxProcess.c linux/LinuxProcess.h test_spec.lua
2015-03-16Major advances in FreeBSD port.Hisham Muhammad
2015-03-16Get FreeBSD tree to compile again with latest changes.Hisham Muhammad
2015-01-21Sorry about the mega-patch.Hisham Muhammad
This is a work-in-progress, code is currently broken. (Some actions, and notably, the header, are missing.)
2014-11-27Add ProcessList_delete to the variable interface.Hisham Muhammad
2014-11-24Changes for supporting separate platform subdirectories.Hisham Muhammad
2014-11-19Refactored key handlers.Hisham Muhammad
Made the logic more modular, hopefully easier to follow, and removed repeated code. Plus, some optimization in RichString code.
2014-02-27alignment improvementsHisham Muhammad
2014-01-29Added additional column to monitor OOM killer score of each processLeigh Simpson
2013-12-18Make CPU meter optionally account guest time in its percentagesHisham Muhammad
2013-05-24Performance improvements due to conditional parsing of IO data depending on ↵Hisham Muhammad
selected fields. On my machine, this gives a ~20% improvement in htop process time use with the default config.
2013-04-29Performance improvementsHisham Muhammad
(thanks to Jann Horn)
2012-12-05Changes in object model: separate class objects to store vtable. Also, nicer ↵Hisham Muhammad
UTF-8 display of big numbers.
2012-11-10search and filter for the strace and lsof screens!Hisham Muhammad