NAME |SYNOPSIS |DESCRIPTION |RETURN VALUE |STANDARDS |HISTORY |SEE ALSO |COLOPHON | |
perfmonctl(2) System Calls Manualperfmonctl(2)perfmonctl - interface to IA-64 performance monitoring unit
#include <syscall.h>#include <perfmon.h>long perfmonctl(int narg;intfd, intcmd, voidarg[narg], intnarg);Note: There is no glibc wrapper for this system call; see HISTORY.
The IA-64-specificperfmonctl() system call provides an interface to the PMU (performance monitoring unit). The PMU consists of PMD (performance monitoring data) registers and PMC (performance monitoring control) registers, which gather hardware statistics.perfmonctl() applies the operationcmd to the input arguments specified byarg. The number of arguments is defined bynarg. Thefd argument specifies the perfmon context to operate on. Supported values forcmd are:PFM_CREATE_CONTEXTperfmonctl(intfd, PFM_CREATE_CONTEXT, pfarg_context_t *ctxt, 1); Set up a context. Thefd parameter is ignored. A new perfmon context is created as specified inctxt and its file descriptor is returned inctxt->ctx_fd. The file descriptor can be used in subsequent calls toperfmonctl() and can be used to read event notifications (typepfm_msg_t) usingread(2). The file descriptor is pollable usingselect(2),poll(2), andepoll(7). The context can be destroyed by callingclose(2) on the file descriptor.PFM_WRITE_PMCSperfmonctl(intfd, PFM_WRITE_PMCS, pfarg_reg_t *pmcs, n); Set PMC registers.PFM_WRITE_PMDSperfmonctl(intfd, PFM_WRITE_PMDS, pfarg_reg_t *pmds, n); Set PMD registers.PFM_READ_PMDSperfmonctl(intfd, PFM_READ_PMDS, pfarg_reg_t *pmds, n); Read PMD registers.PFM_STARTperfmonctl(intfd, PFM_START, NULL, 0); Start monitoring.PFM_STOPperfmonctl(intfd, PFM_STOP, NULL, 0); Stop monitoring.PFM_LOAD_CONTEXTperfmonctl(intfd, PFM_LOAD_CONTEXT, pfarg_load_t *largs, 1); Attach the context to a thread.PFM_UNLOAD_CONTEXTperfmonctl(intfd, PFM_UNLOAD_CONTEXT, NULL, 0); Detach the context from a thread.PFM_RESTARTperfmonctl(intfd, PFM_RESTART, NULL, 0); Restart monitoring after receiving an overflow notification.PFM_GET_FEATURESperfmonctl(intfd, PFM_GET_FEATURES, pfarg_features_t *arg, 1);PFM_DEBUGperfmonctl(intfd, PFM_DEBUG,val, 0); Ifval is nonzero, enable debugging mode, otherwise disable.PFM_GET_PMC_RESET_VALperfmonctl(intfd, PFM_GET_PMC_RESET_VAL, pfarg_reg_t *req, n); Reset PMC registers to default values.
perfmonctl() returns zero when the operation is successful. On error, -1 is returned anderrno is set to indicate the error.
Linux on IA-64.
Added in Linux 2.4; removed in Linux 5.10. This system call was broken for many years, and ultimately removed in Linux 5.10. glibc does not provide a wrapper for this system call; on kernels where it exists, call it usingsyscall(2).
gprof(1) The perfmon2 interface specification
This page is part of theman-pages (Linux kernel and C library user-space interface documentation) project. Information about the project can be found at ⟨https://www.kernel.org/doc/man-pages/⟩. If you have a bug report for this manual page, see ⟨https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING⟩. This page was obtained from the tarball man-pages-6.15.tar.gz fetched from ⟨https://mirrors.edge.kernel.org/pub/linux/docs/man-pages/⟩ on 2025-08-11. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up- to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which isnot part of the original manual page), send a mail to man-pages@man7.orgLinux man-pages 6.15 2025-06-28perfmonctl(2)Pages that refer to this page:syscalls(2)
HTML rendering created 2025-09-06 byMichael Kerrisk, author ofThe Linux Programming Interface. For details of in-depthLinux/UNIX system programming training courses that I teach, lookhere. Hosting byjambit GmbH. | ![]() |