PCP: support for 'dynamic columns' added at runtime

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.
This commit is contained in:
Sohaib Mohamed
2021-07-11 03:11:29 +02:00
committed by Nathan Scott
parent ed82ce6456
commit 6f2021f3d9
59 changed files with 1065 additions and 176 deletions

10
pcp/columns/container Normal file
View File

@ -0,0 +1,10 @@
#
# pcp-htop(1) configuration file - see pcp-htop(5)
#
[container]
heading = Container
caption = CONTAINER
width = -12
metric = proc.id.container
description = Name of processes container via cgroup heuristics

10
pcp/columns/delayacct Normal file
View File

@ -0,0 +1,10 @@
#
# pcp-htop(1) configuration file - see pcp-htop(5)
#
[blkio]
heading = BLKIOD
caption = BLKIO_TIME
width = 6
metric = proc.psinfo.delayacct_blkio_time
description = Aggregated block I/O delays

10
pcp/columns/fdcount Normal file
View File

@ -0,0 +1,10 @@
#
# pcp-htop(1) configuration file - see pcp-htop(5)
#
[fds]
heading = FDS
caption = FDCOUNT
width = 4
metric = proc.fd.count
description = Open file descriptors

17
pcp/columns/guest Normal file
View File

@ -0,0 +1,17 @@
#
# pcp-htop(1) configuration file - see pcp-htop(5)
#
[guest]
heading = GUEST
caption = GUEST_TIME
width = 6
metric = proc.psinfo.guest_time
description = Guest time for the process
[cguest]
heading = CGUEST
caption = CGUEST_TIME
width = 6
metric = proc.psinfo.guest_time + proc.psinfo.cguest_time
description = Cumulative guest time for the process and its children

39
pcp/columns/memory Normal file
View File

@ -0,0 +1,39 @@
#
# pcp-htop(1) configuration file - see pcp-htop(5)
#
[vmdata]
heading = VDATA
width = 6
metric = proc.memory.vmdata
description = Virtual memory used for data
[vmstack]
heading = VSTACK
width = -6
metric = proc.memory.vmstack
description = Virtual memory used for stack
[vmexe]
heading = VEXEC
width = 6
metric = proc.memory.vmexe
description = Virtual memory used for non-library executable code
[vmlib]
heading = VLIBS
width = 6
metric = proc.memory.vmlib
description = Virtual memory used for libraries
[vmswap]
heading = VSWAP
width = 6
metric = proc.memory.vmswap
description = Virtual memory size currently swapped out
[vmlock]
heading = VLOCK
width = 6
metric = proc.memory.vmlock
description = Locked virtual memory

10
pcp/columns/sched Normal file
View File

@ -0,0 +1,10 @@
#
# pcp-htop(1) configuration file - see pcp-htop(5)
#
[rundelay]
heading = RUNQ
caption = RUN_DELAY
width = 4
metric = proc.schedstat.run_delay
description = Run queue time

15
pcp/columns/swap Normal file
View File

@ -0,0 +1,15 @@
#
# pcp-htop(1) configuration file - see pcp-htop(5)
#
[swap]
heading = SWAP
width = 5
metric = proc.psinfo.nswap
description = Count of swap operations for the process
[cswap]
heading = CSWAP
width = 5
metric = proc.psinfo.nswap + proc.psinfo.cnswap
description = Cumulative swap operations for the process and its children

31
pcp/columns/tcp Normal file
View File

@ -0,0 +1,31 @@
#
# pcp-htop(1) configuration file - see pcp-htop(5)
#
[tcp_send_calls]
heading = TCPS
caption = TCP_SEND
width = 6
metric = bcc.proc.net.tcp.send.calls
description = Count of TCP send calls
[tcp_send_bytes]
heading = TCPSB
caption = TCP_SEND_BYTES
width = 6
metric = bcc.proc.net.tcp.send.bytes
description = Cumulative bytes sent via TCP
[tcp_recv_calls]
heading = TCPR
caption = TCP_RECV
width = 6
metric = bcc.proc.net.tcp.recv.calls
description = Count of TCP recv calls
[tcp_recv_bytes]
heading = TCPRB
caption = TCP_RECV_BYTES
width = 6
metric = bcc.proc.net.tcp.recv.bytes
description = Cumulative bytes received via TCP

31
pcp/columns/udp Normal file
View File

@ -0,0 +1,31 @@
#
# pcp-htop(1) configuration file - see pcp-htop(5)
#
[udp_send_calls]
heading = UDPS
caption = UDP_SEND
width = 6
metric = bcc.proc.net.udp.send.calls
description = Count of UDP send calls
[udp_send_bytes]
heading = UDPSB
caption = UDP_SEND_BYTES
width = 6
metric = bcc.proc.net.udp.send.bytes
description = Cumulative bytes sent via UDP
[udp_recv_calls]
heading = UDPR
caption = UDP_RECV
width = 6
metric = bcc.proc.net.udp.recv.calls
description = Count of UDP recv calls
[udp_recv_bytes]
heading = UDPRB
caption = UDP_RECV_BYTES
width = 6
metric = bcc.proc.net.udp.recv.bytes
description = Cumulative bytes received via UDP

17
pcp/columns/wchan Normal file
View File

@ -0,0 +1,17 @@
#
# pcp-htop(1) configuration file - see pcp-htop(5)
#
[wchan]
heading = WCHAN
caption = WCHAN_ADDRESS
width = 8
metric = proc.psinfo.wchan
description = Wait channel, kernel address process is blocked or sleeping on
[wchans]
heading = WCHANS
caption = WCHAN_SYMBOL
width = -12
metric = proc.psinfo.wchan_s
description = Wait channel, kernel symbol process is blocked or sleeping on