PMSETDEBUG(3)
PMSETDEBUG(3) πβ¨
okay bestie, pull up a chair, we're doing the Library Functions Manual edition of the PCP debug saga and honestly? it's giving main character energy. this page is about four little functions β pmSetDebug, pmDebug, pmGetDebug, pmClearDebug β and their whole job is manipulating PCP debugging control options. that's it. that's the vibe. π
NAME πΈ
pmSetDebug, pmDebug, pmGetDebug, pmClearDebug β manipulate PCP debugging control options, no cap π
C SYNOPSIS π¦
#include <pcp/pmapi.h>
int pmSetDebug(const char *spec);
int pmDebug(const char *spec);
char *pmGetDebug(void);
int pmClearDebug(const char *spec);
cc ... -lpcp
literally just include the header, link the lib, and you're in. periodt. β
DESCRIPTION β¨
so within the libraries and applications of the Performance Co-Pilot (PCP) there's a whole extensive set of debugging options, right? and the whole point is you can enable or disable them at run-time. no recompile, no drama, we love that for us. π₯
pmSetDebug, pmDebug and pmClearDebug all parse spec assuming it to be a comma separated list of PCP debug option names. that's the whole assignment, bestie.
wanna know what option names actually exist? you find those using the -l argument to pmdbg(1). go look, it's right there. π
and here's a lil special case for you: the name `all` is treated as a synonym for identifying all option names. so when you say all, you mean ALL. every single one. π«
pmSetDebugwill set the corresponding options β¨pmClearDebugwill clear the corresponding options π§Ή
pmDebug is the tester girlie β it's used to test if options have been set, and it returns 1 if at least one of the options in spec has been set, else it returns 0. simple as that. π
the additive thing (iykyk) π«Ά
consecutive calls to either pmSetDebug or pmClearDebug will be additive. like, they stack. they build. they don't wipe the slate unless you tell them to.
so for example, these two code fragments are equivalent in terms of the final state of the debug options:
sts = pmClearDebug("all");
sts = pmSetDebug("appl0");
sts = pmSetDebug("pdu,fetch");
sts = pmSetDebug("fetch,profile,context");
sts = pmClearDebug("appl0");
sts = pmClearDebug("all");
sts = pmSetDebug("pdu,fetch,profile,context");
same ending, different journey. both iconic. π
the env var shortcut πΈ
for applications that use pmGetOptions(3) to process command line options and arguments, setting the environment variable $PCP_DEBUG gives you an alternative mechanism to set debug flags β as described in PCPIntro(1). so you can just vibe it in from the environment instead. π
pmGetDebug moment π
pmGetDebug returns the current set of enabled debug options as a comma separated list.
- if no options are set, the result is an empty string π«₯
- if every option is set, the result is
`all`π
β οΈ heads up bestie: the result is allocated bymalloc(3)and the caller is responsible for callingfree(3)when the result is no longer needed. do not forget. do not leak. the memory is YOURS now. π
DIAGNOSTICS π
if successful, the routines pmSetDebug, pmDebug and pmClearDebug return 0 or 1. otherwise the return is PM_ERR_CONV to indicate an error parsing spec. so if you see that, your spec was messy, not you. π
for pmGetDebug, a return value of NULL indicates a malloc(3) failure. that's the only reason. π
SEE ALSO π
PCPIntro(1), pmdbg(1), free(3) and malloc(3).
okay that's the whole page, you ate, you understood it, you're gonna go set some debug flags responsibly. mwah. π β¨
with love from the Performance Co-Pilot girlies β this was PCP, page PMSETDEBUG(3), and yeah bestie that's a wrap. π¦ππΈ
π¦ 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) 2017 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