Add a platform for Performance Co-Pilot (PCP) metrics#536
Closed
natoscott wants to merge 20 commits intohtop-dev:masterfrom
Closed
Add a platform for Performance Co-Pilot (PCP) metrics#536natoscott wants to merge 20 commits intohtop-dev:masterfrom
natoscott wants to merge 20 commits intohtop-dev:masterfrom
Conversation
fasterit
reviewed
Feb 18, 2021
natoscott
added a commit
to natoscott/htop
that referenced
this pull request
Mar 17, 2021
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 htop-dev#536
natoscott
added a commit
to natoscott/htop
that referenced
this pull request
Mar 22, 2021
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 htop-dev#536
natoscott
added a commit
to natoscott/htop
that referenced
this pull request
Mar 23, 2021
One review request relating to the PCP platform is to have a clearly separate binary from the regular htop so that we have no confusion as to what is being requested to run, to aid debugging, and a bunch of other good reasons. This commit renames htop.c to CommandLine.c and provides a minimal htop main function for 'native' platforms to use. The PCP version of this will setup libpcp.so and then call the same CommandLine_run function as regular htop. Related to htop-dev#536
natoscott
added a commit
to natoscott/htop
that referenced
this pull request
Mar 23, 2021
One review request relating to the PCP platform is to have a clearly separate binary from the regular htop so that we have no confusion as to what is being requested to run, to aid debugging, and a bunch of other good reasons. This commit renames htop.c to CommandLine.c and provides a minimal htop main function for 'native' platforms to use. The PCP version of this will setup libpcp.so and then call the same CommandLine_run function as regular htop. Related to htop-dev#536
natoscott
added a commit
to natoscott/htop
that referenced
this pull request
Mar 25, 2021
One review request relating to the PCP platform is to have a clearly separate binary from the regular htop so that we have no confusion as to what is being requested to run, to aid debugging, and a bunch of other good reasons. This commit renames htop.c to CommandLine.c and provides a minimal htop main function for 'native' platforms to use. The PCP version of this will setup libpcp.so and then call the same CommandLine_run function as regular htop. Related to htop-dev#536
BenBE
requested changes
Apr 9, 2021
f9789a5 to
14b67a3
Compare
This introduces an initial platform for extracting metrics using the PCP performance metrics API - PMAPI(3). It can be used via the --enable-pcp=yes configure option. So far I've added support for live localhost metrics only, and only using pre-defined metrics already found in htop. If available, all sampling is performed by pmcd(1) - else, we fallback to htop doing the metric sampling itself (all below the PMAPI). When pmcd is used, it may be configured to run children with elevated privileges, so htop does not need to be setuid (authentication with pmcd is available). Additionally, the PMAPI allows us to support archives (for historical analysis and for automated regression tests in htop). We'll need platform-specific command line argument additions, which isn't yet feasible in htop (not difficult to add though). The goal of this first version is minimal impact in terms of modifying the htop codebase, to introduce key ideas in PCP (metric namespace, metadata, APIs and so on) and give us something to discuss, experiment with and build on.
Updates for recent NetworkIO Meter changes, adds support for the SysArch and HostName Meters. The SysArch change is based on work originally by Sohaib Mohamed.
Fixes CI builds which are on an old version of PCP.
Uses the mem.util.shared metric (Shmem from meminfo).
This is no longer used and confuses Coverity scans, drop it.
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.
Resolves a couple of remaining review notes from @BenBE.
BenBE
requested changes
Jun 7, 2021
BenBE
reviewed
Jun 8, 2021
Resolves a couple of remaining review notes from @BenBE.
BenBE
approved these changes
Jun 8, 2021
Member
Author
|
Merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This introduces a htop 'platform' for extracting metrics using the PCP performance metrics API - PMAPI(3). It can be used via the --enable-pcp=yes configure option.
So far I've added support for live localhost metrics only, and only using pre-defined metrics already found in htop. If available, all sampling is performed by pmcd(1) - else, we fallback to htop doing the metric sampling itself (all handled below the PMAPI interfaces used here). When pmcd is used, it's usually run children with elevated privileges so this htop platform does not ever need to be setuid, nor does htop itself need to run as root (authentication with pmcd is available).
Additionally, the PMAPI allows us to support archives for historical analysis and for automated regression tests in htop. We'll need platform-specific command line argument additions, which isn't yet feasible in htop (not difficult to add though).
The goal of this first version is minimal impact in terms of modifying the htop code base, to introduce key ideas in PCP (metric namespace, metadata, APIs and so on) and give us something to discuss, experiment with and build on.