1PERFMONCTL(2) Linux Programmer's Manual PERFMONCTL(2)
2
3
4
6 perfmonctl - interface to IA-64 performance monitoring unit
7
9 #include <syscall.h>
10 #include <perfmon.h>
11
12 long perfmonctl(int fd, int cmd, void *arg, int narg);
13 Note: There is no glibc wrapper for this system call; see NOTES.
14
16 The IA-64-specific perfmonctl() system call provides an interface to
17 the PMU (performance monitoring unit). The PMU consists of PMD (per‐
18 formance monitoring data) registers and PMC (performance monitoring
19 control) registers, which gather hardware statistics.
20
21 perfmonctl() applies the operation cmd to the input arguments specified
22 by arg. The number of arguments is defined by narg. The fd argument
23 specifies the perfmon context to operate on.
24
25 Supported values for cmd are:
26
27 PFM_CREATE_CONTEXT
28 perfmonctl(int fd, PFM_CREATE_CONTEXT, pfarg_context_t *ctxt, 1);
29 Set up a context.
30
31 The fd parameter is ignored. A new perfmon context is created
32 as specified in ctxt and its file descriptor is returned in
33 ctxt->ctx_fd.
34
35 The file descriptor can be used in subsequent calls to perf‐
36 monctl() and can be used to read event notifications (type
37 pfm_msg_t) using read(2). The file descriptor is pollable using
38 select(2), poll(2), and epoll(7).
39
40 The context can be destroyed by calling close(2) on the file
41 descriptor.
42
43 PFM_WRITE_PMCS
44 perfmonctl(int fd, PFM_WRITE_PMCS, pfarg_reg_t *pmcs, n);
45 Set PMC registers.
46
47 PFM_WRITE_PMDS
48 perfmonctl(int fd, PFM_WRITE_PMDS, pfarg_reg_t *pmds, n);
49 Set PMD registers.
50
51 PFM_READ_PMDS
52 perfmonctl(int fd, PFM_READ_PMDS, pfarg_reg_t *pmds, n);
53 Read PMD registers.
54
55 PFM_START
56 perfmonctl(int fd, PFM_START, NULL, 0);
57 Start monitoring.
58
59 PFM_STOP
60 perfmonctl(int fd, PFM_STOP, NULL, 0);
61 Stop monitoring.
62
63 PFM_LOAD_CONTEXT
64 perfmonctl(int fd, PFM_LOAD_CONTEXT, pfarg_load_t *largs, 1);
65 Attach the context to a thread.
66
67 PFM_UNLOAD_CONTEXT
68 perfmonctl(int fd, PFM_UNLOAD_CONTEXT, NULL, 0);
69 Detach the context from a thread.
70
71 PFM_RESTART
72 perfmonctl(int fd, PFM_RESTART, NULL, 0);
73 Restart monitoring after receiving an overflow notification.
74
75 PFM_GET_FEATURES
76 perfmonctl(int fd, PFM_GET_FEATURES, pfarg_features_t *arg, 1);
77
78 PFM_DEBUG
79 perfmonctl(int fd, PFM_DEBUG, val, 0);
80 If val is nonzero, enable debugging mode, otherwise disable.
81
82 PFM_GET_PMC_RESET_VAL
83 perfmonctl(int fd, PFM_GET_PMC_RESET_VAL, pfarg_reg_t *req, n);
84 Reset PMC registers to default values.
85
87 perfmonctl() returns zero when the operation is successful. On error,
88 -1 is returned and errno is set to indicate the cause of the error.
89
91 perfmonctl() is available since Linux 2.4.
92
94 perfmonctl() is Linux-specific and is available only on the IA-64
95 architecture.
96
98 Glibc does not provide a wrapper for this system call; call it using
99 syscall(2).
100
102 gprof(1)
103
104 The perfmon2 interface specification
105
107 This page is part of release 4.15 of the Linux man-pages project. A
108 description of the project, information about reporting bugs, and the
109 latest version of this page, can be found at
110 https://www.kernel.org/doc/man-pages/.
111
112
113
114Linux 2017-09-15 PERFMONCTL(2)