summaryrefslogtreecommitdiffstats
path: root/linux/LinuxProcessList.h
Commit message (Collapse)AuthorAgeFilesLines
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* Merge branch 'dynamic-columns' of https://github.com/smalinux/htop into ↵Nathan Scott2021-08-131-1/+1
|\ | | | | | | smalinux-dynamic-columns
| * PCP: support for 'dynamic columns' added at runtimeSohaib Mohamed2021-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 columns for process autogroup identifier and nice valueNathan Scott2021-08-091-0/+1
|/ | | | | | | | | | | | Adds AGRP (autogroup) and ANI (autogroup nice) columns that report the information from /proc/PID/autogroup, as well as handlers for '{' and '}' to change the autogroup nice value. This is guarded by /proc/sys/kernel/sched_autogroup_enabled such that sampling and/or changing values wont be attempted unless the kernel feature is enabled. Fixes: #720
* Add ProcessList_isCPUonlineChristian Göttsche2021-07-181-0/+2
|
* Rework CPU countingChristian Göttsche2021-07-181-1/+4
| | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Linux: overhaul memory partitionChristian Göttsche2021-02-071-2/+4
| | | | | | | 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).
* Linux: individual huge page values in the huge page meterDavid Zarzycki2021-01-191-1/+3
|
* Linux: handle hugepagesChristian Göttsche2021-01-191-0/+3
| | | | | | | Subtract hugepages from normal memory. Add a HugePageMeter. Closes: #447
* Dynamically load libsensors at runtimeChristian Göttsche2020-12-021-1/+1
|
* Show CPU temperature in CPU meterChristian Göttsche2020-11-161-0/+4
| | | | | Show the CPU temperature in the CPU meter, like CPU frequency, instead of using an extra Meter.
* Spacing around operatorsBenny Baumann2020-11-021-1/+1
|
* Zram Meter featureMurloc Knight2020-10-311-0/+3
|
* Continue to update generic data in paused modeChristian Göttsche2020-10-191-1/+1
| | | | | | | | | 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
* Make all required includes explicitBenny Baumann2020-10-181-0/+7
| | | | Information as seen by IWYU 0.12 + clang 9 on Linux
* Update License consistently to GPLv2 as per COPYING fileDaniel Lange2020-10-051-1/+1
|
* Drop redundant declarationsChristian Göttsche2020-09-291-2/+0
| | | | | | | | - `CRT_fatalError()` is declared twice in CRT.h - `Process_pidFormat`, `Process_writeField()` and `Process_compare` are declared twice in Process.h - `btime` is defined in LinuxProcess.c and also declared in LinuxProcess.h, so drop in LinuxProcessList.h
* Switch variable/field naming from WhiteList to MatchListNathan Scott2020-09-091-1/+1
|
* Consolidate repeated macro definitions into one headerNathan Scott2020-09-091-4/+0
| | | | | | | | The MIN, MAX, CLAMP, MINIMUM, and MAXIMUM macros appear throughout the codebase with many re-definitions. Make a single copy of each in a common header file, and use the BSD variants of MINIMUM/MAXIMUM due to conflicts in the system <sys/param.h> headers.
* Further, minor cleanups to headers post-MakeHeadersNathan Scott2020-09-081-34/+0
| | | | | Remove leftover empty ifdef/endif pairs, whitespace. The generated htop.h file was also unused - removed.
* Remove superfluous 'extern's from function declarations.Zev Weiss2020-09-031-3/+3
| | | | | | | | Applied via: $ find * -name '*.h' -exec sed -i -r 's/^extern (.+\()/\1/;' {} + Suggested-by: Bert Wesarg <bert.wesarg@googlemail.com>
* Axe automated header generation.Zev Weiss2020-09-031-2/+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.
* Merge branch 'hishamhm-pull-920'3.0.0rc1Nathan Scott2020-08-201-0/+7
|\
| * Refactor common OpenZFS sysctl accessRoss Williams2019-07-071-8/+2
| | | | | | | | | | Darwin and FreeBSD export zfs kstats through the same APIs, so moving functions into a common file.
| * ZFS arcstats for LinuxRoss Williams2019-07-071-0/+13
| | | | | | | | | | | | If no pools are imported (ARC size == 0) or the ZFS module is not in the kernel (/proc/spl/kstat/zfs/arcstats does not exist), then the Meter reports "Unavailable".
* | Merge branch 'hishamhm-pull-932'Nathan Scott2020-08-201-0/+6
|\ \
| * | Move sysfs-reading code to LinuxProcessList.c and add average frequency.Arnavion2019-08-101-0/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This way the frequency is read from sysfs only once per update cycle instead of every time the UI is redrawn. This also changes the code to read from /proc/cpuinfo instead. This is because reading from scaling_cur_freq stalls for 10ms if the previous read for the file was more than one second ago. [1] Since htop's update cycle is longer than that, it would cause the read of each CPU's scaling_cur_freq file to block the UI for 20ms. This easily led to a noticeable half-second lag on a 20+ CPU machine. /proc/cpuinfo also has a 10ms delay, but this applies for the whole file so the delay does not scale with the number of CPUs. [2] [1]: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4815d3c56d1e10449a44089a47544d9ba84fad0d [2]: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7d5905dc14a87805a59f3c5bf70173aac2bb18f8
* | Merge branch 'hishamhm-pull-960'Nathan Scott2020-08-201-3/+3
|\ \
| * | Clean up existing whitespaceDaniel Flanagan2019-10-311-3/+3
| |/
* | Merge branch 'hishamhm-pull-866'Nathan Scott2020-08-201-2/+1
|\ \
| * | Remove unnecessary HAVE_SYS_SYSMACROS_H checkWataru Ashihara2018-12-151-2/+1
| |/ | | | | | | | | | | | | | | | | | | | | HAVE_SYS_SYSMACROS_H is always true if MAJOR_IN_SYSMACROS. This way of checking is recommended in autoconf 2.70 documentation: https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blobdiff;f=doc/autoconf.texi;h=4f041bd4e;hp=9ad7dc1c5f02c8ba25b2fe1218bf931c7113a5d5;hb=e17a30e987d7ee695fb4294a82d987ec3dc9b974;hpb=565a6dc50cfa01cec2fb4db894026689cdf4970c NOTE: currently https://www.gnu.org/software/autoconf/manual/autoconf.html is the doc for autoconf 2.69.
* | Merge branch 'hishamhm-pull-843'Nathan Scott2020-08-191-0/+1
|\ \
| * | Linux: Use /proc/*/smaps_rollup for improved PSS parsing speedAlexander Schlarb2019-03-201-0/+1
| |/
* / Re-generate all headers with latest scripts/MakeHeader.pyNathan Scott2020-08-181-3/+3
|/ | | | Sync-up missing extern declarations for many functions.
* Linux: add process->starttime and use it for STARTTIME column (#700)Shawn Landden2018-08-191-1/+3
| | | | | | | this way a remount of /proc will not reset starttimes and we can also see startup times for processes started before the mount of /proc also record btime (boot time in seconds since epoch) as Linux semi-global
* Updates to generated header filesHisham Muhammad2018-02-261-0/+5
|
* Adds support for linux delay accounting (#667)André Carvalho2017-12-041-0/+15
| | | | | | Adds support for showing columns with linux delay accounting. This information can be read from the netlink interface, and thus we set up a socket to read from that when initializing the LinuxProcessList (LinuxProcessList_initNetlinkSocket). After that, for each process we call LinuxProcessList_readDelayAcctData, which sends a message thru the socket after setting up a callback to get the answer from the Kernel. That callback sets the process total delay time attribute. We then set the delay percent as the percentage of time process cpu time since last scan.
* Interpret TTY_NR column on Linux,Hisham2016-10-011-3/+15
| | | | | translate dev_t to major:minor on other platforms. Closes #316.
* Introduce CLAMP macro. Unify all MIN(MAX(a,b),c) uses.Explorer092016-01-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | With the CLAMP macro replacing the combination of MIN and MAX, we will have at least two advantages: 1. It's more obvious semantically. 2. There are no more mixes of confusing uses like MIN(MAX(a,b),c) and MAX(MIN(a,b),c) and MIN(a,MAX(b,c)) appearing everywhere. We unify the 'clamping' with a single macro. Note that the behavior of this CLAMP macro is different from the combination `MAX(low,MIN(x,high))`. * This CLAMP macro expands to two comparisons instead of three from MAX and MIN combination. In theory, this makes the code slightly smaller, in case that (low) or (high) or both are computed at runtime, so that compilers cannot optimize them. (The third comparison will matter if (low)>(high); see below.) * CLAMP has a side effect, that if (low)>(high) it will produce weird results. Unlike MIN & MAX which will force either (low) or (high) to win. No assertion of ((low)<=(high)) is done in this macro, for now. This CLAMP macro is implemented like described in glib <http://developer.gnome.org/glib/stable/glib-Standard-Macros.html> and does not handle weird uses like CLAMP(a++, low++, high--) .
* Extend buffer for reading lines from /proc.Hisham Muhammad2015-12-141-0/+4
| | | | | Apparently a line longer than 255 chars was spotted in the wild: http://serverfault.com/questions/577939/linux-ps-htop-show-processes-running-for-hundreds-or-thousands-of-days-though-h#comment676098_577939
* Enable OOM support unconditionally on Linux.Hisham Muhammad2015-04-091-4/+0
| | | | | Read OOM data only if column is enabled. Make sort ordering more consistent. Closes #182.
* Build fixes to resync with FreeBSD changes.Hisham Muhammad2015-03-161-7/+1
|
* Linux build fixes.Hisham Muhammad2015-03-161-10/+0
|
* Sorry about the mega-patch.Hisham Muhammad2015-01-211-3/+53
| | | | | This is a work-in-progress, code is currently broken. (Some actions, and notably, the header, are missing.)
* Move platform-dependent parts of Linux battery meter.Hisham Muhammad2014-11-271-0/+56

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