summaryrefslogtreecommitdiffstats
path: root/linux/Platform.h
Commit message (Collapse)AuthorAgeFilesLines
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* Add completion handling for dynamic meters and columnsNathan Scott2021-09-031-0/+4
| | | | | | | Be sure to free dynamic memory allocated for meters and columns strings, no-op on platforms other than pcp. Closes #774
* IWYU updateChristian Göttsche2021-08-251-0/+4
|
* PCP: support for 'dynamic columns' added at runtimeSohaib Mohamed2021-08-131-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Pointer indication aligned to typenameBenny Baumann2021-07-151-2/+2
|
* Code indentationBenny Baumann2021-07-151-2/+2
|
* Split statements that should go onto multiple linesBenny Baumann2021-07-151-1/+3
|
* Add a new DynamicMeter class for runtime Meter extensionNathan Scott2021-07-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* cleaned up includes with iwyumayurdahibhate2021-05-101-0/+3
|
* Add read-only optionChristian Göttsche2021-04-141-1/+1
| | | | | Add command line option to disable all system and process changing features.
* Request the realtime and monotonic clock times once per sampleNathan Scott2021-04-051-0/+9
| | | | | | | | | | | | | | | | 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
* Use a platform-specific routine for long option usageNathan Scott2021-03-221-13/+9
| | | | Related to https://github.com/htop-dev/htop/pull/564
* Move libcap use to (Linux) platform-specific codeNathan Scott2021-03-221-0/+15
| | | | | | | | | | | | 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
* 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-2/+2
|
* Move generic (shared) code into its own sub-directoryNathan Scott2021-03-041-3/+4
| | | | | | | | 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
* Separate display from sampling in SysArch and Hostname MetersNathan Scott2021-03-041-0/+9
| | | | | | | | | 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.
* Fix integer sizing issues in the NetworkIO MeterNathan Scott2021-03-011-4/+2
| | | | | | | | | 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.
* Define PATH_MAX for GNU/hurdDaniel Lange2021-01-161-0/+7
| | | | | Otherwise fails with "> linux/LinuxProcessList.c:889:20: error: ‘PATH_MAX’ undeclared (first use in this function)"
* Mark Platform_defaultFields constChristian Göttsche2020-12-191-1/+1
|
* Rework enum ProcessFieldChristian Göttsche2020-12-191-2/+0
| | | | | | 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
* Minor cleanups to platform-specific init and doneNathan Scott2020-11-191-2/+6
| | | | | | | 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.
* Merge individual Battery.[ch] files into Platform.[ch]Nathan Scott2020-11-181-0/+3
| | | | | Consistent with everything else involving platform-specific calls from core htop code.
* Resolve merge conflicts, merge #298 "Macro cleanup" from @BenBEDaniel Lange2020-11-151-4/+4
|\
| * Spacing around operatorsBenny Baumann2020-11-021-5/+5
| |
* | Split platform dependent parts for file locks screenBenny Baumann2020-11-141-0/+6
|/
* Zram Meter featureMurloc Knight2020-10-311-0/+2
|
* FreeBSD: implement Platform_getDiskIO()Christian Goettsche2020-10-291-3/+2
|
* Improve handling of no data in Disk and Network IO MetersChristian Göttsche2020-10-261-2/+4
|
* Make all required includes explicitBenny Baumann2020-10-181-3/+5
| | | | Information as seen by IWYU 0.12 + clang 9 on Linux
* Add NetworkIOMeterChristian Göttsche2020-10-161-0/+5
|
* Mark Object instances constChristian Göttsche2020-10-071-1/+1
|
* Update License consistently to GPLv2 as per COPYING fileDaniel Lange2020-10-051-1/+1
|
* Add DiskIOMeter for IO read/write usageChristian Göttsche2020-10-031-0/+2
|
* Use strict function prototypesChristian Göttsche2020-09-181-2/+2
| | | | int foo(); declares a function taking any number of arguments.
* 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.
* Remove superfluous 'extern's from function declarations.Zev Weiss2020-09-031-11/+11
| | | | | | | | 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/+3
|\
| * Support for ZFS Compressed ARC statisticsRoss Williams2019-09-031-0/+2
| |
| * ZFS arcstats for LinuxRoss Williams2019-07-071-0/+2
| | | | | | | | | | | | 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-2/+0
|\|
* | Merge branch 'hishamhm-pull-890'Nathan Scott2020-08-201-0/+2
|\ \
| * | Add pressure stall information (PSI) meters on LinuxRan Benita2019-02-131-0/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pressure stall information (PSI) metrics provide useful information on delays caused by waiting for CPU, IO and memory. Particularly on busy servers it can provide a quick overview of what's "slowing things down". This feature is supported on Linux >= 4.20. The interface is documented here: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/Documentation/accounting/psi.txt These links provide rationale: https://lwn.net/Articles/759781/ https://facebookmicrosites.github.io/psi/ The following metrics are added, corresponding to the currently exposed lines (see `head /proc/pressure/*`): - PressureStallCPUSome - PressureStallIOSome - PressureStallIOFull - PressureStallMemorySome - PressureStallMemoryFull The color scheme is the same as that used for Load Average, however I gave it separate entries just in case someone wants to change them specifically. Tested on 4.20.7-arch1-1-ARCH, on the linux platform. Also tested that other platforms still compile (changed configure to use the unsupported platform). Closes #879.
* | Merge branch 'hishamhm-pull-890'Nathan Scott2020-08-201-0/+2
| |
* | Re-generate all headers with latest scripts/MakeHeader.pyNathan Scott2020-08-181-8/+8
|/ | | | Sync-up missing extern declarations for many functions.
* Mark signal tables 'const'Explorer092016-08-301-2/+2
| | | | | | | | | Specifically, Platform_signals[] and Platform_numberOfSignals. Both are not supposed to be mutable. Marking them 'const' puts them into rodata sections in binary. And for Platform_numberOfSignals, this aids optimization (aids only Link Time Optimization for now). :) Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* 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--) .
* Add Platform_getProcessEnvMichael Klein2015-12-031-0/+2
| | | | - currently implemented for darwin and linux
* Move list of signals to platform-specific code.Hisham Muhammad2015-10-061-0/+5
| | | | | Implementations for Linux (tested) and FreeBSD (still untested, thanks to @etosan for providing the table). Darwin and OpenBSD(ping @mmcco) builds should be broken now, pending their own tables.

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