---
name: "pfm_self_stop"
section: "3"
platform: "linux"
package: "libpfm3-3.2-dev"
version: "3.2.070507-1.1"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/pfm_self_start"
---

# pfm\_self\_stop(3)

start and stop monitoring for a self-monitoring process

Part of [pfm\_self\_start(3)](/pfm_self_start/3.md).

## NAME

pfm\_self\_start, pfm\_self\_stop - start and stop monitoring for a self-monitoring process

## SYNOPSIS

```
#include <perfmon/pfmlib.h>

int pfm_self_start(int fd);
int pfm_self_stop(int fd);

```

## DESCRIPTION

These two functions can only be used by self-monitoring processes. They have no effect on system wide sessions.

The **pfm\_self\_start** function activates monitoring. This function  is equivalent to calling **perfmonctl()** with the **PFM\_START**  command and may end up calling it. On Linux/ia64 it is implemented as a lightweight call to set the **psr.up** bit.

The **pfm\_self\_stop** function deactivates monitoring This function is  equivalent to calling **perfmonctl()** with the **PFM\_STOP** command and may end up calling it.On Linux/ia64 it is implemented as a lightweight  call to clear the **psr.up** bit.

## RETURN

The function returns 0 if successful, otherwise -1 and the error code is set in errno.

## ERRORS

0 is always returned on Linux/ia64.

## AUTHOR

Stephane Eranian \<eranian@hpl.hp.com\>
