summaryrefslogtreecommitdiffstats
path: root/pcp/Platform.c
Commit message (Collapse)AuthorAgeFilesLines
* Minor bug fixes for Coverity issuesKen McDonell2024-02-051-1/+1
| | | | | | | | | | | | | | | | | Over in the PCP project, Coverity has spotted a couple of minor issues in the htop code. This commit addresses them: Settings.c need to take control of the umask before calling mkstemp() pcp/Platform.c Although Platform_getMaxPid() returns a pid_t (which strictly speaking is signed), the value is used to call Row_setPidColumnWidth() and a negative value here is not good ... using INT_MAX instead of UNIT_MAX on the (unlikely) error path makes no practical difference but may keep Coverity quiet
* Fix code styleBenny Baumann2023-12-261-3/+4
|
* Remove unused zswap pool size calculation from commit 71f5a80d9eNathan Scott2023-11-211-1/+0
| | | | | Quick discussion with Ivan confirmed this was a left-over from an earlier version of the zswap code and can be safely removed.
* PCP platform implementation of frontswap and zswap accountingNathan Scott2023-11-201-3/+24
|
* Correct pid_t type return from Platform_getMaxPid functionNathan Scott2023-09-041-2/+2
| | | | | | | Coverity scanning shows we end up passing an integer into the Row_setPidColumnWidth routine which requires a pid_t - update each platform to return the correct type (and never return -1 as a failure code, this was being ignored).
* Rename ProcessList to ProcessTable throughoutNathan Scott2023-08-311-2/+2
| | | | | | | | | | | | 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.
* Rename PCPMetric files, structures and related internal functionsNathan Scott2023-08-301-47/+47
| | | | | Simplify names to just Metric in this case as it is not mirroring core htop naming (which is the norm for that naming convention).
* Support dynamic screens with 'top-most' entities beyond processesSohaib Mohamed2023-08-301-1/+31
| | | | | | | | | | | | | | | | | | | | | | This implements our concept of 'dynamic screens' in htop, with a first use-case of pcp-htop displaying things like top-filesystem and top-cgroups under new screen tabs. However the idea is more general than use in pcp-htop and we've paved the way here for us to collectively build mroe general tabular screens in core htop, as well. From the pcp-htop side of things, dynamic screens are configured using text-based configuration files that define the mapping for PCP metrics to columns (and metric instances to rows). Metrics are defined either directly (via metric names) or indirectly via PCP derived metric specifications. Value scaling and the units displayed is automatic based on PCP metric units and data types. This commit represents a collaborative effort of several months, primarily between myself, Nathan and BenBE. Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com> Signed-off-by: Nathan Scott <nathans@redhat.com>
* Rework ZramMeter and remove MeterClass.comprisedValuesExplorer092023-08-291-1/+5
| | | | | | | | | | | | The 'comprisedValues' boolean property unnecessarily complicates the drawing algorithms of Bar meters and Graph meters. Since the only user of 'comprisedValues' is ZramMeter, it is better to rework the meter so that it no longer needs 'comprisedValues'. The 'values[ZRAM_METER_UNCOMPRESSED]' now stores the difference between uncompressed and compressed data size. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Replace isnan() with better comparisons (isgreater(), etc.)Explorer092023-08-181-8/+12
| | | | | | | | | | | | | | | | | | The standard isnan() function is defined to never throw FP exceptions even when the argument is a "signaling" NaN. This makes isnan() more expensive than (x != x) expression unless the compiler flag '-fno-signaling-nans' is given. Introduce functions isNaN(), isNonnegative(), isPositive(), sumPositiveValues() and compareRealNumbers(), and replace isnan() in htop's codebase with the new functions. These functions utilize isgreater() and isgreaterequal() comparisons, which do not throw FP exceptions on "quiet" NaNs, which htop uses extensively. With isnan() removed, there is no need to suppress the warning '-Wno-c11-extensions' in FreeBSD. Remove the code from 'configure.ac'. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Adapt platform code for the new Machine base classNathan Scott2023-05-081-16/+16
| | | | | 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-16/+18
| | | | | | | | | | | 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.
* {Memory,Swap}Meter: add "compressed memory" metricsIvan Shapovalov2023-04-231-0/+2
| | | | | | | | For now, the semantics are mostly fit for Linux zswap subsystem. For instance, we add the third swap usage metric that indicates the amount of memory that is accounted to swap but in fact stored elsewhere. This exactly matches the definition of frontswap/zswap, and is probably of little use to all other platforms.
* Improve CPU computation codeGuillaume Gomez2023-03-041-3/+2
|
* Improve code readability by using enum values instead of raw numbersGuillaume Gomez2023-03-041-7/+8
|
* Implement File Descriptor Meter support for PCPSohaib Mohamed2023-02-191-0/+15
| | | | Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
* PCP: add IRQ PSI meterNathan Scott2023-02-141-0/+4
|
* Improve code readability by creating constants for SWAP memory valuesGuillaume Gomez2023-01-081-2/+2
|
* Clean out Platform_getInodeFilenameнаб2023-01-081-6/+0
| | | | | | It's an artefact of the previous implementation of Platform_getProcessLocks for Linux, and is never used; there's no reason for it to have ever been exported
* Improve code readability by creating constants for memory valuesGuillaume Gomez2023-01-071-8/+8
|
* Reformat code baseBenny Baumann2022-10-241-1/+1
| | | | | | | | | | | | | | This includes: - Wrap function implementations - Pointer alignment for function signatures - Pointer alignment for variable declarations - Whitespace after keywords - Whitespace after comma - Whitespace around initializers - Whitespace around operators - Code indentation - Line break for single line statements - Misleading alignment
* Use pmLookupDescs(3) function if available from libpcpNathan Scott2022-09-141-17/+41
| | | | | This is a relative new, single-round-trip variant of the pmLookupDesc(3) function for metric descriptors lookup.
* Implement PCP support for minimum ZFS ARC sizeBenny Baumann2022-05-301-2/+8
|
* Use correct command field as default fieldChristian Göttsche2021-12-171-2/+2
| | | | | The default htop command process field has the enum identifier `COMM` but the name `Command` (`COMM` is the field name for /proc/<PID>/comm).
* Mark ScreenDefaults constChristian Göttsche2021-12-171-1/+1
|
* Drop unused Platform variablesChristian Göttsche2021-12-171-4/+0
|
* Introduce screen tabsHisham Muhammad2021-12-071-0/+15
| | | | This is a forward port (by nathans) of Hisham's original code.
* Early program termination only from main()Volodymyr Vasiutyk2021-10-311-11/+14
|
* 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/+8
| | | | | | | Be sure to free dynamic memory allocated for meters and columns strings, no-op on platforms other than pcp. Closes #774
* Add combined memory and swap meterChristian Göttsche2021-08-171-0/+2
| | | | Closes: #699
* PCP: ensure unsigned types used throughout CPU count detectionNathan Scott2021-08-171-4/+4
| | | | | | | This cannot be negative in these code locations, but for the purposes of static checking like Coverity scan make it clear and used the same unsigned type as ProcessList.h for the CPU count variable (matching PL activeCPUs and existingCPUs).
* PCP: PCPMetric.[ch] MdouleSohaib2021-08-161-223/+51
| | | | | Split the PCP Metric API (functions `Metric_*`) into their own module. as @BenBE suggested.
* Merge branch 'dynamic-columns' of https://github.com/smalinux/htop into ↵Nathan Scott2021-08-131-20/+58
|\ | | | | | | smalinux-dynamic-columns
| * PCP: support for 'dynamic columns' added at runtimeSohaib Mohamed2021-08-131-20/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+2
|/ | | | | | | | | | | | 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
* PCP: use the correct metric for shared memory calculationsNathan Scott2021-07-291-1/+1
|
* Code indentationBenny Baumann2021-07-151-5/+5
|
* Remove unnecessary include files from PCPDynamicMeter.cNathan Scott2021-07-091-10/+10
| | | | | Also resolve a few unintended style guide transgressions in the PCP platform code.
* Add more defensive checks to PCP paths if sampling failsNathan Scott2021-07-071-2/+9
|
* Add a new DynamicMeter class for runtime Meter extensionNathan Scott2021-07-071-9/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix a PCP diagnostics typo, add missing pmFreeResult null check.Nathan Scott2021-06-131-2/+3
|
* Resolve a couple of recent memory leaks in pcp-htopNathan Scott2021-06-131-0/+6
| | | | Makes the pcp-htop binary valgrind-clean once more.
* Update platform-specific header includes to use pcp paths.Nathan Scott2021-06-091-3/+3
| | | | Resolves a couple of remaining review notes from @BenBE.
* Update the PCP platform to use common Process fields and codeNathan Scott2021-06-091-0/+2
| | | | | | | Remove code now that we have common platform-independent command line wrangling (thanks BenBE!). Add PCP platform support for a handful of other recently arriving odds and ends - ELAPSED time, CWD, and so on.
* Various code tidyups based on review commentary from BenBENathan Scott2021-06-091-2/+4
|
* Resolve some Coverity scan misfires in PCP platform codeNathan Scott2021-06-091-37/+31
|
* Remove dynamic allocation of PCP metric atomvalues expansionNathan Scott2021-06-091-7/+0
| | | | This is no longer used and confuses Coverity scans, drop it.
* Add time handling interfaces for the pcp platformNathan Scott2021-06-091-10/+42
| | | | Related to https://github.com/htop-dev/htop/pull/574
* Implement command line and environment handling for pcp htop.Nathan Scott2021-06-091-3/+61
|

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