PAPI 7.1.0.0
Loading...
Searching...
No Matches
perfmon_v2.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pfarg_ctx_t
 
struct  pfarg_pmc_t
 
struct  pfarg_pmd_t
 
struct  pfarg_start_t
 
struct  pfarg_load_t
 
struct  pfarg_setdesc_t
 
struct  pfarg_setinfo_t
 

Functions

os_err_t pfm_create_context (pfarg_ctx_t *ctx, char *smpl_name, void *smpl_arg, size_t smpl_size)
 
os_err_t pfm_write_pmcs (int fd, pfarg_pmc_t *pmcs, int count)
 
os_err_t pfm_write_pmds (int fd, pfarg_pmd_t *pmds, int count)
 
os_err_t pfm_read_pmds (int fd, pfarg_pmd_t *pmds, int count)
 
os_err_t pfm_load_context (int fd, pfarg_load_t *load)
 
os_err_t pfm_start (int fd, pfarg_start_t *start)
 
os_err_t pfm_stop (int fd)
 
os_err_t pfm_restart (int fd)
 
os_err_t pfm_create_evtsets (int fd, pfarg_setdesc_t *setd, int count)
 
os_err_t pfm_getinfo_evtsets (int fd, pfarg_setinfo_t *info, int count)
 
os_err_t pfm_delete_evtsets (int fd, pfarg_setdesc_t *setd, int count)
 
os_err_t pfm_unload_context (int fd)
 

Function Documentation

◆ pfm_create_context()

os_err_t pfm_create_context ( pfarg_ctx_t ctx,
char *  smpl_name,
void *  smpl_arg,
size_t  smpl_size 
)

Definition at line 483 of file pfmlib_os_linux_v2.c.

484{
485 if (_pfmlib_major_version < 3) {
486 /*
487 * In perfmon v2.2, the pfm_create_context() call had a
488 * different return value. It used to return errno, in v2.3
489 * it returns the file descriptor.
490 */
491 if (_pfmlib_minor_version < 3) {
492 int r;
493 pfarg_ctx22_t ctx22;
494
495 /* transfer the v2.3 contents to v2.2 for sys call */
496 memset (&ctx22, 0, sizeof(ctx22));
497 if (name != NULL) {
498 memcpy (ctx22.ctx_smpl_buf_id, name, 16);
499 }
500 ctx22.ctx_flags = ctx->ctx_flags;
501 /* ctx22.ctx_fd returned */
502 /* ctx22.ctx_smpl_buf_size returned */
503 memcpy (ctx22.ctx_reserved3, &ctx->ctx_reserved1, 64);
504
505 r = syscall (PFM_pfm_create_context, &ctx22, smpl_arg, smpl_size);
506
507 /* transfer the v2.2 contents back to v2.3 */
508 ctx->ctx_flags = ctx22.ctx_flags;
509 memcpy (&ctx->ctx_reserved1, ctx22.ctx_reserved3, 64);
510
511 return (r < 0 ? r : ctx22.ctx_fd);
512 } else {
513 return (int)syscall(PFM_pfm_create_context, ctx, name, smpl_arg, smpl_size);
514 }
515 }
516 return pfm_create_context_2v3(ctx, name, smpl_arg, smpl_size);
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)
const char * name
Definition: rocs.c:225
uint64_t ctx_reserved3[12]
unsigned char ctx_smpl_buf_id[16]
uint32_t ctx_flags
Definition: perfmon_v2.h:19
uint32_t ctx_reserved1
Definition: perfmon_v2.h:20
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pfm_create_evtsets()

os_err_t pfm_create_evtsets ( int  fd,
pfarg_setdesc_t setd,
int  count 
)

Definition at line 449 of file pfmlib_os_linux_v2.c.

450{
451 if (_pfmlib_major_version < 3)
452 return (int)syscall(PFM_pfm_create_evtsets, fd, setd, count);
453 return pfm_create_evtsets_2v3(fd, setd, count);
454}
static long count
static int pfm_create_evtsets_2v3(int fd, pfarg_setdesc_t *setd, int count)
#define PFM_pfm_create_evtsets
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pfm_delete_evtsets()

os_err_t pfm_delete_evtsets ( int  fd,
pfarg_setdesc_t setd,
int  count 
)

Definition at line 457 of file pfmlib_os_linux_v2.c.

458{
459 if (_pfmlib_major_version < 3)
460 return (int)syscall(PFM_pfm_delete_evtsets, fd, setd, count);
461 return pfm_delete_evtsets_2v3(fd, setd, count);
462}
static int pfm_delete_evtsets_2v3(int fd, pfarg_setdesc_t *setd, int count)
#define PFM_pfm_delete_evtsets
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pfm_getinfo_evtsets()

os_err_t pfm_getinfo_evtsets ( int  fd,
pfarg_setinfo_t info,
int  count 
)

Definition at line 465 of file pfmlib_os_linux_v2.c.

466{
467 if (_pfmlib_major_version < 3)
468 return (int)syscall(PFM_pfm_getinfo_evtsets, fd, info, count);
469
470 return pfm_getinfo_evtsets_2v3(fd, info, count);
471}
static int pfm_getinfo_evtsets_2v3(int fd, pfarg_setinfo_t *info, int count)
#define PFM_pfm_getinfo_evtsets
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pfm_load_context()

os_err_t pfm_load_context ( int  fd,
pfarg_load_t load 
)

Definition at line 417 of file pfmlib_os_linux_v2.c.

418{
419 if (_pfmlib_major_version < 3)
420 return (int)syscall(PFM_pfm_load_context, fd, load);
421 return pfm_load_context_2v3(fd, load);
422}
static int pfm_load_context_2v3(int fd, pfarg_load_t *load)
#define PFM_pfm_load_context
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pfm_read_pmds()

os_err_t pfm_read_pmds ( int  fd,
pfarg_pmd_t pmds,
int  count 
)

Definition at line 536 of file pfmlib_os_linux_v2.c.

537{
538 if (_pfmlib_major_version < 3)
539 return (int)syscall(PFM_pfm_read_pmds, fd, pmds, count);
540 return pfm_read_pmds_2v3(fd, pmds, count);
541}
#define PFM_pfm_read_pmds
static int pfm_read_pmds_2v3(int fd, pfarg_pmd_t *pmds, int count)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pfm_restart()

os_err_t pfm_restart ( int  fd)

Definition at line 441 of file pfmlib_os_linux_v2.c.

442{
443 if (_pfmlib_major_version < 3)
444 return (int)syscall(PFM_pfm_restart, fd);
445 return pfm_restart_2v3(fd);
446}
static int pfm_restart_2v3(int fd)
#define PFM_pfm_restart
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pfm_start()

os_err_t pfm_start ( int  fd,
pfarg_start_t start 
)

Definition at line 425 of file pfmlib_os_linux_v2.c.

426{
427 if (_pfmlib_major_version < 3)
428 return (int)syscall(PFM_pfm_start, fd, start);
429 return pfm_start_2v3(fd, start);
430}
static struct timeval start
#define PFM_pfm_start
static int pfm_start_2v3(int fd, pfarg_start_t *start)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pfm_stop()

os_err_t pfm_stop ( int  fd)

Definition at line 433 of file pfmlib_os_linux_v2.c.

434{
435 if (_pfmlib_major_version < 3)
436 return (int)syscall(PFM_pfm_stop, fd);
437 return pfm_stop_2v3(fd);
438}
static int pfm_stop_2v3(int fd)
#define PFM_pfm_stop
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pfm_unload_context()

os_err_t pfm_unload_context ( int  fd)

Definition at line 474 of file pfmlib_os_linux_v2.c.

475{
476 if (_pfmlib_major_version < 3)
477 return (int)syscall(PFM_pfm_unload_context, fd);
478
479 return pfm_unload_context_2v3(fd);
480}
#define PFM_pfm_unload_context
static int pfm_unload_context_2v3(int fd)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pfm_write_pmcs()

os_err_t pfm_write_pmcs ( int  fd,
pfarg_pmc_t pmcs,
int  count 
)

Definition at line 520 of file pfmlib_os_linux_v2.c.

521{
522 if (_pfmlib_major_version < 3)
523 return (int)syscall(PFM_pfm_write_pmcs, fd, pmcs, count);
524 return pfm_write_pmcs_2v3(fd, pmcs, count);
525}
static int pfm_write_pmcs_2v3(int fd, pfarg_pmc_t *pmcs, int count)
#define PFM_pfm_write_pmcs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pfm_write_pmds()

os_err_t pfm_write_pmds ( int  fd,
pfarg_pmd_t pmds,
int  count 
)

Definition at line 528 of file pfmlib_os_linux_v2.c.

529{
530 if (_pfmlib_major_version < 3)
531 return (int)syscall(PFM_pfm_write_pmds, fd, pmds, count);
532 return pfm_write_pmds_2v3(fd, pmds, count);
533}
#define PFM_pfm_write_pmds
static int pfm_write_pmds_2v3(int fd, pfarg_pmd_t *pmds, int count)
Here is the call graph for this function:
Here is the caller graph for this function: