---
name: "pmsetdebug"
section: "3"
platform: "linux"
package: "libpcp3-dev"
version: "4.3.2+really4.3.1-0.1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/pmClearDebug"
---

# pmsetdebug(3)

manipulate PCP debugging control options

Part of [pmClearDebug(3)](/pmClearDebug/3.md).

## NAME

**pmSetDebug**, **pmClearDebug** - manipulate PCP debugging control options

## C SYNOPSIS

**#include \<pcp/pmapi.h\>**

**int pmSetDebug(const char \****spec***);**\
 **int pmClearDebug(const char \****spec***);**

**cc ... -lpcp**

## DESCRIPTION

Within the libraries and applications of the Performance Co-Pilot (PCP) there is an extensive set of debugging options that may be enabled or disabled at run-time.

Both **pmSetDebug** and **pmClearDebug** parse *spec* assuming it to be a comma separated list of PCP debug option names.

The names of the available options may be found using the **-l** argument to [**pmdbg**(1)](/pmdbg/1.md).

As a special case, the name \`\`all'' is treated as a synonym for identifying all option names.

**pmSetDebug** will set the corresponding options, while **pmClearDebug** will clear the corresponding options.

Consecutive calls to either routine will be additive.  For example the following code fragments are equivalent in terms of the final configuration 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");
```

An earlier implementation of the PCP debug facilities used a bit-vector and for backwards compatibility the elements of *spec* may include decimal values corresponding to those bit-values. Refer to [**pmdbg**(1)](/pmdbg/1.md) for more details of this deprecated format.

## SEE ALSO

[**pmdbg**(1)](/pmdbg/1.md)

## DIAGNOSTICS

If successful, these routines return 0, otherwise the return is **PM\_ERR\_CONV** to indicate a parsing error.
