PMCLEANMAPDIR(3)
π PMCLEANMAPDIR π
okay bestie, welcome to __pmCleanMapDir(3) β a little library-functions-manual moment from the Performance Co-Pilot universe. yes it's a section 3 page. yes it's niche. no we are not skipping anything. let's get into it π«Ά
β¨ NAME β¨
__pmCleanMapDir β literally just here to remove old files from a map directory. that's the whole job. icon behavior π
πΈ C SYNOPSIS πΈ
#include "pmapi.h"
#include "libpcp.h"
int __pmCleanMapDir(const char *dirname, const char *special);
and when you link it:
cc ... -lpcp
she's compiled and she's ready π
π¨ CAVEAT π¨
bestie, read this part. this documentation is intended for internal Performance Co-Pilot (PCP) developer use.
these interfaces are not part of the PCP APIs that are guaranteed to remain fixed across releases. so they may not work, or may provide different semantics at some point in the future. no cap. it's giving "use at your own risk" energy π
π¦ DESCRIPTION π¦
so pmlogger(1) and pmie(1) keep directories full of map files, right? and those map files give you a mapping from a pmlogger(1) or pmie(1) process id (PID) over to the important parameters of those processes. very organized of them. very main character.
__pmCleanMapDir goes through and removes ``dead'' files in those directories. specifically, the directory entries in dirname should follow these rules β and if they don't, __pmCleanMapDir will just remove them. bye π
- the name should be numeric, else it should be equal special (if special is not
NULL) - for a numeric directory entry it should be a regular file and the name should be the PID of a running process
- for a match on special the directory entry should be a symbolic link and the last component of the link should be the ASCII encoding of the PID of a running process
and before any of these checks are even done, __pmCleanMapDir checks that dirname is indeed a directory, and that the user id and group id of the caller match the user id and group id of dirname. vibe check first, always π
β RETURN VALUES β
if a serious error occurs, __pmCleanMapDir returns a negative value β and that value is suitable for reporting with pmErrStr(3). so you know exactly what to do with it.
otherwise? the return value is the number of entries that have been removed. so satisfying. counting your little wins π₯
π DIAGNOSTICS π
verbose diagnostics describing the actions of __pmCleanMapDir will be reported on standard error if the debug option misc is set, e.g. via -D misc from the command line. so if you wanna see her whole thought process, you know the flag β¨
π SEE ALSO π
pmdbg(1), PMAPI(3) and pmErrStr(3).
and that's the whole page, bestie π
Performance Co-Pilot Β· PCP Β· PMCLEANMAPDIR(3) β mwah, go clean those map directories responsibly π§π
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.0.1-1.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.1.0-6.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu resolute: libpcp4-dev 7.1.1-1
- ubuntu stonking: libpcp4-dev 7.2.1-2build1
- Copyright (c) 2023 Ken McDonell. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms