Go to the source code of this file.
|
| static int | pfm_create_context_2v3 (pfarg_ctx_t *ctx, char *name, void *smpl_arg, size_t smpl_size) |
| |
| static int | pfm_write_pmcs_2v3 (int fd, pfarg_pmc_t *pmcs, int count) |
| |
| static int | pfm_write_pmds_2v3 (int fd, pfarg_pmd_t *pmds, int count) |
| |
| static int | pfm_read_pmds_2v3 (int fd, pfarg_pmd_t *pmds, int count) |
| |
| static int | pfm_load_context_2v3 (int fd, pfarg_load_t *load) |
| |
| static int | pfm_start_2v3 (int fd, pfarg_start_t *start) |
| |
| static int | pfm_stop_2v3 (int fd) |
| |
| static int | pfm_restart_2v3 (int fd) |
| |
| static int | pfm_create_evtsets_2v3 (int fd, pfarg_setdesc_t *setd, int count) |
| |
| static int | pfm_delete_evtsets_2v3 (int fd, pfarg_setdesc_t *setd, int count) |
| |
| static int | pfm_getinfo_evtsets_2v3 (int fd, pfarg_setinfo_t *info, int count) |
| |
| static int | pfm_unload_context_2v3 (int fd) |
| |
| int | pfm_load_context (int fd, pfarg_load_t *load) |
| |
| int | pfm_start (int fd, pfarg_start_t *start) |
| |
| int | pfm_stop (int fd) |
| |
| int | pfm_restart (int fd) |
| |
| int | pfm_create_evtsets (int fd, pfarg_setdesc_t *setd, int count) |
| |
| int | pfm_delete_evtsets (int fd, pfarg_setdesc_t *setd, int count) |
| |
| int | pfm_getinfo_evtsets (int fd, pfarg_setinfo_t *info, int count) |
| |
| int | pfm_unload_context (int fd) |
| |
| int | pfm_create_context (pfarg_ctx_t *ctx, char *name, void *smpl_arg, size_t smpl_size) |
| |
| int | pfm_write_pmcs (int fd, pfarg_pmc_t *pmcs, int count) |
| |
| int | pfm_write_pmds (int fd, pfarg_pmd_t *pmds, int count) |
| |
| int | pfm_read_pmds (int fd, pfarg_pmd_t *pmds, int count) |
| |
◆ PFM_pfm_create_context
◆ PFM_pfm_create_evtsets
◆ PFM_pfm_delete_evtsets
◆ PFM_pfm_getinfo_evtsets
◆ PFM_pfm_load_context
◆ PFM_pfm_read_pmds
◆ PFM_pfm_restart
◆ PFM_pfm_start
◆ PFM_pfm_stop
◆ PFM_pfm_unload_context
◆ PFM_pfm_write_pmcs
◆ PFM_pfm_write_pmds
◆ pfm_create_context()
Definition at line 483 of file pfmlib_os_linux_v2.c.
484{
486
487
488
489
490
492 int r;
494
495
496 memset (&ctx22, 0, sizeof(ctx22));
499 }
501
502
504
506
507
510
511 return (r < 0 ? r : ctx22.
ctx_fd);
512 } else {
514 }
515 }
517}
int _pfmlib_major_version
int _pfmlib_minor_version
#define PFM_pfm_create_context
static int pfm_create_context_2v3(pfarg_ctx_t *ctx, char *name, void *smpl_arg, size_t smpl_size)
uint64_t ctx_reserved3[12]
unsigned char ctx_smpl_buf_id[16]
◆ pfm_create_context_2v3()
| static int pfm_create_context_2v3 |
( |
pfarg_ctx_t * |
ctx, |
|
|
char * |
name, |
|
|
void * |
smpl_arg, |
|
|
size_t |
smpl_size |
|
) |
| |
|
static |
Definition at line 72 of file pfmlib_os_linux_v2.c.
73{
75 uint32_t fl;
76
77
78
79
80 if (!ctx) {
82 return -1;
83 }
84
85
86
87
88
90 if (
name || smpl_arg || smpl_size)
92
94}
os_err_t pfm_create(int flags, pfarg_sinfo_t *sif,...)
◆ pfm_create_evtsets()
Definition at line 449 of file pfmlib_os_linux_v2.c.
450{
454}
static int pfm_create_evtsets_2v3(int fd, pfarg_setdesc_t *setd, int count)
#define PFM_pfm_create_evtsets
◆ pfm_create_evtsets_2v3()
Definition at line 257 of file pfmlib_os_linux_v2.c.
258{
259
261}
os_err_t pfm_create_sets(int fd, int flags, pfarg_set_desc_t *s, size_t sz)
◆ pfm_delete_evtsets()
Definition at line 457 of file pfmlib_os_linux_v2.c.
458{
462}
static int pfm_delete_evtsets_2v3(int fd, pfarg_setdesc_t *setd, int count)
#define PFM_pfm_delete_evtsets
◆ pfm_delete_evtsets_2v3()
Definition at line 264 of file pfmlib_os_linux_v2.c.
265{
268 return -1;
269}
void __pfm_vbprintf(const char *fmt,...)
◆ pfm_getinfo_evtsets()
Definition at line 465 of file pfmlib_os_linux_v2.c.
466{
469
471}
static int pfm_getinfo_evtsets_2v3(int fd, pfarg_setinfo_t *info, int count)
#define PFM_pfm_getinfo_evtsets
◆ pfm_getinfo_evtsets_2v3()
Definition at line 272 of file pfmlib_os_linux_v2.c.
273{
276 int fdx,
i, ret, errno_save;
277
278 if (!info) {
280 return -1;
281 }
282
283
284
285
286
287 memset(&cinfo, -1, sizeof(cinfo));
288
289
290
291
292
294 if (fdx > -1)
296
297 sif = calloc(
count,
sizeof(*sif));
298 if (!sif) {
300 return -1;
301 }
302
304 sif[
i].set_id = info[
i].set_id;
305
308 if (ret)
310
313
314 memcpy(info[
i].set_ovfl_pmds,
315 sif[
i].set_ovfl_pmds,
316 sizeof(info[
i].set_ovfl_pmds));
317
321
322 memcpy(info[
i].set_avail_pmcs,
324 sizeof(info[
i].set_avail_pmcs));
325
326 memcpy(info[
i].set_avail_pmds,
328 sizeof(info[
i].set_avail_pmds));
329 }
331 free(sif);
333 return ret;
334}
os_err_t pfm_getinfo_sets(int fd, int flags, pfarg_set_info_t *s, size_t sz)
uint64_t set_act_duration
uint64_t sif_avail_pmds[PFM_PMD_BV]
uint64_t sif_avail_pmcs[PFM_PMC_BV]
◆ pfm_load_context()
Definition at line 417 of file pfmlib_os_linux_v2.c.
418{
422}
static int pfm_load_context_2v3(int fd, pfarg_load_t *load)
#define PFM_pfm_load_context
◆ pfm_load_context_2v3()
Definition at line 225 of file pfmlib_os_linux_v2.c.
226{
227 if (!load) {
229 return -1;
230 }
232}
os_err_t pfm_attach(int fd, int flags, int target)
◆ pfm_read_pmds()
Definition at line 536 of file pfmlib_os_linux_v2.c.
537{
541}
#define PFM_pfm_read_pmds
static int pfm_read_pmds_2v3(int fd, pfarg_pmd_t *pmds, int count)
◆ pfm_read_pmds_2v3()
Definition at line 177 of file pfmlib_os_linux_v2.c.
178{
180 int errno_save;
182 size_t sz;
183
184 sz =
count *
sizeof(*pmas);
185
186 if (!pmds)
188
189 pmas = calloc(
count,
sizeof(*pmas));
190 if (!pmas) {
192 return -1;
193 }
194
200 }
201
203
205
208
212
214
215
216
217
218 }
219 free(pmas);
221 return ret;
222}
os_err_t pfm_read(int fd, int flags, int type, void *reg, size_t n)
os_err_t pfm_write(int fd, int flags, int type, void *reg, size_t n)
uint64_t reg_ovfl_switch_cnt
uint64_t reg_last_reset_val
◆ pfm_restart()
◆ pfm_restart_2v3()
| static int pfm_restart_2v3 |
( |
int |
fd | ) |
|
|
static |
Definition at line 251 of file pfmlib_os_linux_v2.c.
252{
254}
os_err_t pfm_set_state(int fd, int flags, int state)
◆ pfm_start()
Definition at line 425 of file pfmlib_os_linux_v2.c.
426{
430}
static struct timeval start
static int pfm_start_2v3(int fd, pfarg_start_t *start)
◆ pfm_start_2v3()
◆ pfm_stop()
◆ pfm_stop_2v3()
| static int pfm_stop_2v3 |
( |
int |
fd | ) |
|
|
static |
◆ pfm_unload_context()
| int pfm_unload_context |
( |
int |
fd | ) |
|
Definition at line 474 of file pfmlib_os_linux_v2.c.
475{
478
480}
#define PFM_pfm_unload_context
static int pfm_unload_context_2v3(int fd)
◆ pfm_unload_context_2v3()
| static int pfm_unload_context_2v3 |
( |
int |
fd | ) |
|
|
static |
◆ pfm_write_pmcs()
Definition at line 520 of file pfmlib_os_linux_v2.c.
521{
525}
static int pfm_write_pmcs_2v3(int fd, pfarg_pmc_t *pmcs, int count)
#define PFM_pfm_write_pmcs
◆ pfm_write_pmcs_2v3()
Definition at line 97 of file pfmlib_os_linux_v2.c.
98{
100 int errno_save;
102 size_t sz;
103
105
106 if (!pmcs)
108
109 pmrs = calloc(
count,
sizeof(*pmrs));
110 if (!pmrs) {
112 return -1;
113 }
114
120 }
121
124 free(pmrs);
126 return ret;
127}
◆ pfm_write_pmds()
Definition at line 528 of file pfmlib_os_linux_v2.c.
529{
533}
#define PFM_pfm_write_pmds
static int pfm_write_pmds_2v3(int fd, pfarg_pmd_t *pmds, int count)
◆ pfm_write_pmds_2v3()
Definition at line 130 of file pfmlib_os_linux_v2.c.
131{
133 size_t sz;
134 int errno_save;
136
137 sz =
count *
sizeof(*pmas);
138
139 if (!pmds)
141
142 pmas = calloc(
count,
sizeof(*pmas));
143 if (!pmas) {
145 return -1;
146 }
147
153
156
157
159
160 memcpy(pmas[
i].reg_smpl_pmds, pmds[
i].reg_smpl_pmds,
sizeof(pmds[
i].reg_smpl_pmds));
161 memcpy(pmas[
i].reg_reset_pmds, pmds[
i].reg_reset_pmds,
sizeof(pmds[
i].reg_reset_pmds));
162
165 }
166
168
170 free(pmas);
172
173 return ret;
174}
uint64_t reg_smpl_eventid
uint64_t reg_smpl_eventid