---
name: "pmc_get_driver_stats"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/pmc_get_driver_stats"
---

# pmc\_get\_driver\_stats(3)

retrieve driver statistics

## NAME

**pmc\_get\_driver\_stats** – retrieve driver statistics

## LIBRARY

library “libpmc”

## SYNOPSIS

**#include \<pmc.h\>**

*int*\

**pmc\_get\_driver\_stats**(*struct pmc\_driverstats \*gms*);

## DESCRIPTION

The function **pmc\_get\_driver\_statistics**() retrieves a snapshot of the usage statistics maintained by [hwpmc(4)](/hwpmc/4.md) into the memory area pointed to by argument *gms*.

The returned structure includes the following fields:

- pm\_intr\_ignored

  The number of sampling interrupts ignored.

- pm\_intr\_processed

  The number of sampling interrupts processed.

- pm\_intr\_bufferfull

  The number of sampling interrupts dropped due to lack of space in the sample buffer.

- pm\_syscalls

  The number of system calls into [hwpmc(4)](/hwpmc/4.md).

- pm\_syscalls\_errors

  The number of system calls into [hwpmc(4)](/hwpmc/4.md) that failed.

- pm\_buffer\_requests

  The number of log buffer requests so far.

- pm\_buffer\_requests\_failed

  The number of log buffer requests that failed due to lack of buffers.

- pm\_log\_sweeps

  The number of sample buffer processing sweeps.

## RETURN VALUES

The **pmc\_get\_driver\_stats()** function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

## SEE ALSO

[pmc(3)](/pmc/3.md), [hwpmc(4)](/hwpmc/4.md)
