60 SUBDBG(
"SMPL_ARG.buf_size = %llu\n",
61 (
unsigned long long ) arg->
buf_size );
70 for (
i = 0;
i < num_sets;
i++ ) {
72 SUBDBG(
"SET[%d].set_id = %d\n",
i, set[
i].set_id );
74 SUBDBG(
"SET[%d].set_flags = %d\n",
i, set[
i].set_flags );
75 SUBDBG(
"SET[%d].set_timeout = %llu\n",
i,
76 (
unsigned long long ) set[
i].set_timeout );
86 for (
i = 0;
i < num_sets;
i++ ) {
88 SUBDBG(
"SETINFO[%d].set_id = %d\n",
i, setinfo[
i].set_id );
90 SUBDBG(
"SETINFO[%d].set_flags = %d\n",
i, setinfo[
i].set_flags );
91 SUBDBG(
"SETINFO[%d].set_ovfl_pmds[0] = %#016llx\n",
i,
92 (
unsigned long long ) setinfo[
i].set_ovfl_pmds[0] );
93 SUBDBG(
"SETINFO[%d].set_runs = %llu\n",
i,
94 (
unsigned long long ) setinfo[
i].set_runs );
95 SUBDBG(
"SETINFO[%d].set_timeout = %llu\n",
i,
96 (
unsigned long long ) setinfo[
i].set_timeout );
97 SUBDBG(
"SETINFO[%d].set_act_duration = %llu\n",
i,
98 (
unsigned long long ) setinfo[
i].set_act_duration );
100 SUBDBG(
"SETINFO[%d].set_avail_pmcs[0] = %#016llx\n",
i,
101 (
unsigned long long ) setinfo[
i].set_avail_pmcs[0] );
102 SUBDBG(
"SETINFO[%d].set_avail_pmds[0] = %#016llx\n",
i,
103 (
unsigned long long ) setinfo[
i].set_avail_pmds[0] );
115 SUBDBG(
"PC[%d].reg_num = %d\n",
i, pc[
i].reg_num );
116 SUBDBG(
"PC[%d].reg_set = %d\n",
i, pc[
i].reg_set );
117 SUBDBG(
"PC[%d].reg_flags = %#08x\n",
i, pc[
i].reg_flags );
118 SUBDBG(
"PC[%d].reg_value = %#016llx\n",
i,
119 (
unsigned long long ) pc[
i].reg_value );
131 SUBDBG(
"PD[%d].reg_num = %d\n",
i, pd[
i].reg_num );
132 SUBDBG(
"PD[%d].reg_set = %d\n",
i, pd[
i].reg_set );
133 SUBDBG(
"PD[%d].reg_flags = %#08x\n",
i, pd[
i].reg_flags );
134 SUBDBG(
"PD[%d].reg_value = %#016llx\n",
i,
135 (
unsigned long long ) pd[
i].reg_value );
136 SUBDBG(
"PD[%d].reg_long_reset = %llu\n",
i,
137 (
unsigned long long ) pd[
i].reg_long_reset );
138 SUBDBG(
"PD[%d].reg_short_reset = %llu\n",
i,
139 (
unsigned long long ) pd[
i].reg_short_reset );
140 SUBDBG(
"PD[%d].reg_last_reset_val = %llu\n",
i,
141 (
unsigned long long ) pd[
i].reg_last_reset_val );
142 SUBDBG(
"PD[%d].reg_ovfl_switch_cnt = %llu\n",
i,
143 (
unsigned long long ) pd[
i].reg_ovfl_switch_cnt );
144 SUBDBG(
"PD[%d].reg_reset_pmds[0] = %#016llx\n",
i,
145 (
unsigned long long ) pd[
i].reg_reset_pmds[0] );
146 SUBDBG(
"PD[%d].reg_smpl_pmds[0] = %#016llx\n",
i,
147 (
unsigned long long ) pd[
i].reg_smpl_pmds[0] );
148 SUBDBG(
"PD[%d].reg_smpl_eventid = %llu\n",
i,
149 (
unsigned long long ) pd[
i].reg_smpl_eventid );
150 SUBDBG(
"PD[%d].reg_random_mask = %llu\n",
i,
151 (
unsigned long long ) pd[
i].reg_random_mask );
152 SUBDBG(
"PD[%d].reg_random_seed = %d\n",
i, pd[
i].reg_random_seed );
159 SUBDBG(
"SMPL_HDR.hdr_count = %llu\n",
161 SUBDBG(
"SMPL_HDR.hdr_cur_offs = %llu\n",
163 SUBDBG(
"SMPL_HDR.hdr_overflows = %llu\n",
165 SUBDBG(
"SMPL_HDR.hdr_buf_size = %llu\n",
167 SUBDBG(
"SMPL_HDR.hdr_min_buf_space = %llu\n",
178 SUBDBG(
"SMPL.last_reset_val = %llu\n",
180 SUBDBG(
"SMPL.ip = %#llx\n", (
unsigned long long ) entry->
ip );
181 SUBDBG(
"SMPL.tstamp = %llu\n", (
unsigned long long ) entry->
tstamp );
188#define PFM_MAX_PMCDS 20
245 perror(
"pfm_write_pmds" );
257 perror(
"pfm_write_pmds" );
315 SUBDBG(
"Multiplexing interval requested is %llu ns.\n",
316 (
unsigned long long ) set[1].set_timeout );
320 SUBDBG(
"PFM_CREATE_EVTSETS(%d,%p,1)\n", ctx_fd, &set[1] );
323 PAPIERROR(
"pfm_create_evtsets(%d,%p,%d): %s", ctx_fd, &set[1], 1,
328 SUBDBG(
"Multiplexing interval returned is %llu ns.\n",
329 (
unsigned long long ) set[1].set_timeout );
343 unsigned long *timeout_ns )
350 memset( r_pmcs, 0,
sizeof ( *r_pmcs ) );
351 memset( r_pmds, 0,
sizeof ( *r_pmds ) );
353 memset( &ctx, 0,
sizeof ( ctx ) );
354 memset( &setf, 0,
sizeof ( setf ) );
359 SUBDBG(
"PFM_CREATE_CONTEXT(%p,%p,%p,%d)\n", &ctx, NULL, NULL, 0 );
362 PAPIERROR(
"detect_unavail_pmu_regs:pfm_create_context(): %s",
366 SUBDBG(
"PFM_CREATE_CONTEXT returned fd %d\n", myfd );
373 PAPIERROR(
"pfm_getinfo_evtsets(): %s", strerror( ret ) );
379 for ( j = 0; j < 64; j++ ) {
386 for ( j = 0; j < 64; j++ ) {
393 SUBDBG(
"CLOSE fd %d returned %d\n", myfd,
i );
416 unsigned int set = 0;
417 int donepc = 0, donepd = 0, ret, j;
427 (
"entry multiplexed %d, pfp_event_count %d, num_cntrs %d, num_sets %d\n",
438 memset( &tmpin, 0x0,
sizeof ( tmpin ) );
439 memset( &tmpout, 0x0,
sizeof ( tmpout ) );
441 SUBDBG(
"togo %d, done %d, dispatch_count %d, num_cntrs %d\n", togo,
450 for (
i = 0, j = done;
i < dispatch_count;
i++, j++ ) {
460 if ( dispatch_count == 0 ) {
466 (
"Dispatch failed because of counter conflict, trying again with %d counters.\n",
488 SUBDBG(
"PC%d (i%d) is reg num %d, value %llx, set %d\n", donepc,
i,
490 (
unsigned long long ) pc[donepc].reg_value,
491 pc[donepc].reg_set );
496#if defined(HAVE_PFM_REG_EVT_IDX)
500 SUBDBG(
"PD%d (i%d,j%d) is reg num %d, set %d\n", donepd,
i, j,
501 pd[donepd].reg_num, pd[donepd].reg_set );
507 if ( tmpout.
pfp_pmcs[j].reg_evt_idx !=
i )
514 SUBDBG(
"PD%d (i%d) is reg num %d, set %d\n", donepd,
i,
515 pd[donepd].reg_num, pd[donepd].reg_set );
519 togo -= dispatch_count;
520 done += dispatch_count;
524 dispatch_count = togo;
526 setinfos[set].
set_id = set;
535 for (
i = 0;
i < set;
i++ ) {
541 (
"exit multiplexed %d (ns switch time), pfp_pmc_count %d, num_sets %d\n",
553 ret = fcntl( ctx_fd, F_SETFD, FD_CLOEXEC );
555 PAPIERROR(
"cannot fcntl(FD_CLOEXEC) on %d: %s", ctx_fd,
560 ret = fcntl( ctx_fd, F_SETFL, fcntl( ctx_fd, F_GETFL, 0 ) | O_ASYNC );
562 PAPIERROR(
"cannot fcntl(O_ASYNC) on %d: %s", ctx_fd,
567 ret = fcntl( ctx_fd, F_SETOWN,
mygettid( ) );
569 PAPIERROR(
"cannot fcntl(F_SETOWN) on %d: %s", ctx_fd,
584 PAPIERROR(
"cannot fcntl(F_SETSIG,%d) on %d: %s",
600 if ( ( newctx == NULL ) || ( load_args == NULL ) )
602 memset( newctx, 0x0,
sizeof ( *newctx ) );
603 memset( load_args, 0,
sizeof ( *load_args ) );
607 ret = ptrace( PTRACE_ATTACH, tid, NULL, NULL );
609 ptrace( PTRACE_DETACH, tid, NULL, NULL );
610 PAPIERROR(
"Process/thread %d is not being ptraced", tid );
618 if ( ( ret == -1 ) && (
errno != EPERM ) ) {
619 PAPIERROR(
"Process/thread %d cannot be ptraced: %s", tid,
626 SUBDBG(
"PFM_CREATE_CONTEXT(%p,%p,%p,%d)\n", newctx, NULL, NULL, 0 );
628 PAPIERROR(
"attach:pfm_create_context(): %s", strerror(
errno ) );
633 SUBDBG(
"PFM_CREATE_CONTEXT returned fd %d\n", ret );
650 SUBDBG(
"CLOSE fd %d returned %d\n",
670 int mode = 0, did = 0;
733 FILE *
f = fopen(
file,
"r" );
739 if ( fscanf(
f,
"%s\n",
buf ) != 1 ) {
740 PAPIERROR(
"fscanf(%s, %%s\\n): Unable to scan 1 token",
file );
772 SUBDBG(
"Perfmon2 library versions...kernel: %s library: %s\n",
779 PAPIERROR(
"Version mismatch of libpfm: compiled %s "
780 "vs. installed %s\n",
800 unsigned long min_timeout_ns;
804 if ( syscall( __NR_clock_getres, CLOCK_REALTIME, &ts ) == -1 ) {
805 PAPIERROR(
"Could not detect proper HZ rate, multiplexing may fail\n" );
806 min_timeout_ns = 10000000;
834#ifdef PFMLIB_SPARC_ULTRA12_PMU
880#if defined(USE_PROC_PTTIMER)
886 memset( &newctx, 0,
sizeof ( newctx ) );
887 memset( &load_args, 0,
sizeof ( load_args ) );
894 SUBDBG(
"PFM_CREATE_CONTEXT returned fd %d\n", ret );
898 memcpy( &( (
pfm_context_t * ) thr_ctx )->ctx, &newctx,
sizeof ( newctx ) );
902 sizeof ( load_args ) );
966 long long **
events,
int flags )
971 long long tot_runs = 0LL;
986 SUBDBG(
"PMD[%d] = %lld (LLD),%llu (LLU)\n",
i,
987 (
unsigned long long ) ctl->
counts[
i],
1021 (
"Counter %d is in set %d ran %llu of %llu times, old count %lld.\n",
1024 (
unsigned long long ) tot_runs, ctl->
counts[
i] );
1027 ( ctl->
counts[
i] * tot_runs ) /
1031 SUBDBG(
"Set %lld didn't run!!!!\n",
1040#if defined(__crayxt)
1041int _papi_hwd_start_create_context = 0;
1052#if defined(__crayxt)
1053 if ( _papi_hwd_start_create_context ) {
1056 memset( &
tmp, 0,
sizeof (
tmp ) );
1058 PAPIERROR(
"_papi_hwd_init:pfm_create_context(): %s",
1059 strerror(
errno ) );
1074 PAPIERROR(
"pfm_create_evtsets(%d,%p,%d): errno=%d %s",
1077 perror(
"pfm_create_evtsets" );
1148 SUBDBG(
"PFM_UNLOAD_CONTEXT(%d) (tid %u)\n", ctl->
ctx_fd,
1151 PAPIERROR(
"pfm_unload_context(%d): %s", ctl->
ctx_fd, strerror( ret ) );
1166 &ctl->
set[1], ctl->
num_sets - 1, strerror( ret ) );
1172 SUBDBG(
"PFM_CREATE_EVTSETS(%d,%p,%d)\n", ctl->
ctx_fd, &set, 1 );
1240 ctl_state ), option );
1252 ctl_state ), option );
1297#if defined(USE_PROC_PTTIMER)
1298 close( ctx->stat_fd );
1303 SUBDBG(
"CLOSE fd %d returned %d\n", ctx->
ctx_fd, ret );
1313 unsigned int *native_index,
int *profile_index )
1315 int pos, esi_index,
count;
1326 if ( pd[
i].reg_num == pmd ) {
1327 SUBDBG(
"Physical PMD %d is Virtual PMD %d\n", pmd,
i );
1334 SUBDBG(
"(%p,%d,%p)\n", ESI, pmd, index );
1340 SUBDBG(
"Examining event at ESI index %d, PMD position %d\n", esi_index,
1344 *profile_index =
count;
1348 SUBDBG(
"Native event %d is at profile index %d, flags %d\n",
1349 *native_index, *profile_index, *flags );
1354 PAPIERROR(
"wrong count: %d vs. ESI->profile.event_counter %d",
count,
1359#if defined(__ia64__)
1361is_montecito_and_dear(
unsigned int native_index )
1370is_montecito_and_iear(
unsigned int native_index )
1379is_itanium2_and_dear(
unsigned int native_index )
1388is_itanium2_and_iear(
unsigned int native_index )
1398#define BPL (sizeof(uint64_t)<<3)
1403 bv[rnum >>
LBPL] |= 1UL << ( rnum & (
BPL - 1 ) );
1410#if defined(__ia64__)
1441 ( void ) native_index;
1452 ( void ) native_pfm_index;
1455 SUBDBG(
"process_smpl_entry(%d,%d,%p,%p)\n", native_pfm_index, flags, ent,
1460 if ( is_montecito_and_dear( native_pfm_index ) ) {
1464 unsigned long newent;
1478 sizeof ( data_addr ) );
1481 sizeof ( data_addr ) +
1482 sizeof ( latency ) );
1484 SUBDBG(
"PMD[32]: %#016llx\n",
1485 (
unsigned long long ) data_addr.
pmd_val );
1486 SUBDBG(
"PMD[33]: %#016llx\n",
1487 (
unsigned long long ) latency.
pmd_val );
1488 SUBDBG(
"PMD[36]: %#016llx\n",
1489 (
unsigned long long ) load_addr.
pmd_val );
1494 (
"Invalid DEAR sample found, dear_vl = %d, dear_stat = %#x\n",
1498 newent = (
unsigned long ) *ent;
1510 dear_bn ) << 4 ) | (
unsigned long ) load_addr.
1518 newent = (
unsigned long ) *ent;
1522 }
else if ( is_montecito_and_iear( native_pfm_index ) ) {
1525 unsigned long newent;
1538 sizeof ( icache_line_addr ) );
1540 SUBDBG(
"PMD[34]: %#016llx\n",
1541 (
unsigned long long ) icache_line_addr.
pmd_val );
1542 SUBDBG(
"PMD[35]: %#016llx\n",
1543 (
unsigned long long ) latency.
pmd_val );
1546 SUBDBG(
"Invalid IEAR sample found, iear_stat = %#x\n",
1549 newent = (
unsigned long ) *ent;
1563 newent = (
unsigned long ) *ent;
1567 }
else if ( is_itanium2_and_dear( native_pfm_index ) ) {
1571 unsigned long newent;
1585 sizeof ( data_addr ) );
1588 sizeof ( data_addr ) +
1589 sizeof ( latency ) );
1591 SUBDBG(
"PMD[2]: %#016llx\n",
1592 (
unsigned long long ) data_addr.
pmd_val );
1593 SUBDBG(
"PMD[3]: %#016llx\n", (
unsigned long long ) latency.
pmd_val );
1594 SUBDBG(
"PMD[17]: %#016llx\n",
1595 (
unsigned long long ) load_addr.
pmd_val );
1600 (
"Invalid DEAR sample found, dear_vl = %d, dear_stat = %#x\n",
1604 newent = (
unsigned long ) *ent;
1616 dear_bn ) << 4 ) | (
unsigned long ) load_addr.
1624 newent = (
unsigned long ) *ent;
1628 }
else if ( is_itanium2_and_iear( native_pfm_index ) ) {
1631 unsigned long newent;
1644 sizeof ( icache_line_addr ) );
1646 SUBDBG(
"PMD[0]: %#016llx\n",
1647 (
unsigned long long ) icache_line_addr.
pmd_val );
1648 SUBDBG(
"PMD[1]: %#016llx\n", (
unsigned long long ) latency.
pmd_val );
1651 SUBDBG(
"Invalid IEAR sample found, iear_stat = %#x\n",
1654 newent = (
unsigned long ) *ent;
1668 newent = (
unsigned long ) *ent;
1674 (
is_btb( native_pfm_index ) ) {
1683 *pc = (
vptr_t ) ( (
size_t ) ( ( *ent )->ip ) );
1692 ( void ) num_smpl_pmds;
1693 ( void ) entry_size;
1696 uint64_t entry,
count;
1699 int ret, profile_index, flags;
1700 unsigned int native_pfm_index;
1709 SUBDBG(
"This buffer has %llu samples in it.\n",
1710 (
unsigned long long )
count );
1712 SUBDBG(
"Processing sample entry %llu\n",
1713 (
unsigned long long ) entry );
1720 &flags, &native_pfm_index, &profile_index );
1727 weight, profile_index );
1742#ifdef HAVE_PFM_MSG_TYPE
1747 int ret, wanted_fd, fd = info->si_fd;
1753 PAPIERROR(
"thread == NULL in _papi_pfm_dispatch_timer!" );
1755 ret =
read( fd, &msg,
sizeof ( msg ) );
1761 if (
thread->running_eventset[
cidx] == NULL ) {
1763 (
"thread->running_eventset == NULL in _papi_pfm_dispatch_timer!" );
1765 ret =
read( fd, &msg,
sizeof ( msg ) );
1771 if (
thread->running_eventset[
cidx]->overflow.flags == 0 ) {
1773 (
"thread->running_eventset->overflow.flags == 0 in _papi_pfm_dispatch_timer!" );
1775 ret =
read( fd, &msg,
sizeof ( msg ) );
1784 if (
thread->running_eventset[
cidx]->overflow.
1790 if (
thread->running_eventset[
cidx]->overflow.flags ==
1794 ctl_state ) )->ctx_fd;
1798 if ( wanted_fd != fd ) {
1799 SUBDBG(
"expected fd %d, got %d in _papi_hwi_dispatch_timer!",
1802 ret =
read( fd, &msg,
sizeof ( msg ) );
1808 ret =
read( fd, &msg,
sizeof ( msg ) );
1810 if (
errno == EINTR ) {
1811 SUBDBG(
"read(%d) interrupted, retrying\n", fd );
1816 }
else if ( ret !=
sizeof ( msg ) ) {
1817 PAPIERROR(
"read(%d): short %d vs. %d bytes", fd, ret,
1828 PAPIERROR(
"unmatched thread id %lx vs. %lx",
1864 NULL, vector, 0, &
thread,
1870 PAPIERROR(
"pfm_restart(%d): %s", fd, strerror( ret ) );
1890 void *buf_addr = NULL;
1895 memset( &newctx, 0,
sizeof ( newctx ) );
1910 memset( &ctx->
smpl, 0, sizeof ( buf_arg ) );
1920 memset( &buf_arg, 0,
sizeof ( buf_arg ) );
1921 buf_arg.
buf_size = 2 * getpagesize( );
1924 &buf_arg, (
int )
sizeof ( buf_arg ) );
1927 sizeof ( buf_arg ) ) ) == -1 ) {
1929 PAPIERROR(
"_papi_hwd_set_profile:pfm_create_context(): %s",
1930 strerror(
errno ) );
1934 SUBDBG(
"PFM_CREATE_CONTEXT returned fd %d\n", ctx_fd );
1937 SUBDBG(
"MMAP(NULL,%lld,%d,%d,%d,0)\n",
1938 (
unsigned long long ) buf_arg.
buf_size, PROT_READ, MAP_PRIVATE,
1941 mmap( NULL, (
size_t ) buf_arg.
buf_size, PROT_READ, MAP_PRIVATE, ctx_fd,
1943 if ( buf_addr == MAP_FAILED ) {
1945 MAP_PRIVATE, ctx_fd, strerror(
errno ) );
1949 SUBDBG(
"Sample buffer is located at %p\n", buf_addr );
1952 SUBDBG(
"hdr_cur_offs=%llu version=%u.%u\n",
1958 PAPIERROR(
"invalid buffer format version %d",
1960 munmap( buf_addr, buf_arg.
buf_size );
1967 munmap( buf_addr, buf_arg.
buf_size );
1976 int pos, native_index;
2001 memcpy( &ctx->
smpl, &buf_arg, sizeof ( buf_arg ) );
2023 SUBDBG(
"Hardware counter %d used in overflow, threshold %d\n", j,
2102 memset( inp, 0,
sizeof ( *inp ) );
2103 memset( outp, 0,
sizeof ( *inp ) );
2104 memset( pc, 0,
sizeof ( ctl->
pc ) );
2105 memset( pd, 0,
sizeof ( ctl->
pd ) );
2106 memset( set, 0,
sizeof ( ctl->
set ) );
2107 memset( setinfo, 0,
sizeof ( ctl->
setinfo ) );
2128 for ( j = 0; j <
i; j++ )
2146 int last_reg_set = 0, reg_set_done = 0, offset = 0;
2152 SUBDBG(
"Called with count == 0\n" );
2159 memcpy( &tmpin, inp,
sizeof ( tmpin ) );
2160 memcpy( &tmpout, outp,
sizeof ( tmpout ) );
2164 (
"Stuffing native event index %d (code %#x) into input structure.\n",
2176 memcpy( inp, &tmpin,
sizeof ( tmpin ) );
2177 memcpy( outp, &tmpout,
sizeof ( tmpout ) );
2185 if ( pd[
i].reg_set != last_reg_set ) {
2186 offset += reg_set_done;
2192 SUBDBG(
"native event index %d (code %#x) is at PMD offset %d\n",
i,
2201 if ( ctl->
ctx == NULL ) {
2215 .description =
"Linux perfmon2 CPU counters",
2224 .kernel_multiplex = 1,
2225 .kernel_profile = 1,
2229 .fast_real_timer = 1,
2230 .fast_virtual_timer = 0,
2232 .attach_must_ptrace = 1,
#define GET_OVERFLOW_ADDRESS(ctx)
PAPI_os_info_t _papi_os_info
static int set_default_domain(EventSetInfo_t *zero, int domain)
ssize_t read(int fd, void *buf, size_t count)
struct papi_vectors * _papi_hwd[]
static pid_t mygettid(void)
volatile int buf[CACHE_FLUSH_BUFFER_SIZE_INTS]
#define PAPI_INSTR_ADDRESS
#define PAPI_PROFIL_INST_EAR
#define PAPI_DOM_SUPERVISOR
#define PAPI_VENDOR_INTEL
#define PAPI_OVERFLOW_FORCE_SW
#define PAPI_DATA_ADDRESS
#define PAPI_OVERFLOW_HARDWARE
#define PAPI_PROFIL_FORCE_SW
#define PAPI_HUGE_STR_LEN
#define PAPI_PROFIL_RANDOM
#define PAPI_PROFIL_DATA_EAR
#define PAPI_DEF_ITIMER_NS
char events[MAX_EVENTS][BUFSIZ]
#define PFM_VERSION_MAJOR(x)
#define PFM_SETFL_TIME_SWITCH
#define PFM_VERSION_MINOR(x)
#define PFM_REGFL_OVFL_NOTIFY
int init_proc_thread_timer(hwd_context_t *thr_ctx)
#define PAPI_NATIVE_AND_MASK
Return codes and api definitions.
#define SUBDBG(format, args...)
int fclose(FILE *__stream)
void PAPIERROR(char *format,...)
int _papi_libpfm_init(papi_vector_t *my_vector, int cidx)
int _papi_libpfm_ntv_code_to_name(unsigned int EventCode, char *ntv_name, int len)
int _papi_libpfm_ntv_enum_events(unsigned int *EventCode, int modifier)
int _papi_libpfm_ntv_name_to_code(const char *name, unsigned int *event_code)
int _papi_libpfm_ntv_code_to_descr(unsigned int EventCode, char *ntv_descr, int len)
int _papi_libpfm_ntv_code_to_bits(unsigned int EventCode, hwd_register_t *bits)
int _papi_libpfm_error(int pfm_error)
papi_mdi_t _papi_hwi_system_info
pfmlib_event_t pfm_register_t
static int set_irange(hwd_context_t *ctx, hwd_control_state_t *current_state, _papi_int_option_t *option)
static int set_drange(hwd_context_t *ctx, hwd_control_state_t *current_state, _papi_int_option_t *option)
static int _papi_pfm_set_profile(EventSetInfo_t *ESI, int EventIndex, int threshold)
static pfmlib_regmask_t _perfmon2_pfm_unavailable_pmcs
static int detect_timeout_and_unavail_pmu_regs(pfmlib_regmask_t *r_pmcs, pfmlib_regmask_t *r_pmds, unsigned long *timeout_ns)
static int _perfmon2_pfm_pmu_type
int _papi_pfm_read_pmds(pfm_context_t *ctx, pfm_control_state_t *ctl)
static int setup_ear_event(unsigned int native_index, pfarg_pmd_t *pd, int flags)
static int process_smpl_entry(unsigned int native_pfm_index, int flags, pfm_dfl_smpl_entry_t **ent, vptr_t *pc)
static void dump_pmc(pfm_control_state_t *ctl)
int _papi_pfm_stop(hwd_context_t *ctx0, hwd_control_state_t *ctl0)
static void dump_pmd(pfm_control_state_t *ctl)
papi_vector_t _perfmon2_vector
int _papi_pfm_read(hwd_context_t *ctx0, hwd_control_state_t *ctl0, long long **events, int flags)
static int find_profile_index(EventSetInfo_t *ESI, int pmd, int *flags, unsigned int *native_index, int *profile_index)
static int attach(hwd_control_state_t *ctl, unsigned long tid)
static int compute_kernel_args(hwd_control_state_t *ctl0)
static int set_granularity(hwd_control_state_t *this_state, int domain)
static int _papi_pfm_set_overflow(EventSetInfo_t *ESI, int EventIndex, int threshold)
static void dump_setinfo(pfarg_setinfo_t *setinfo, int num_sets)
static int check_multiplex_timeout(int ctx_fd, unsigned long *timeout_ns)
static int _papi_pfm_init_thread(hwd_context_t *thr_ctx)
static int process_smpl_buf(int num_smpl_pmds, int entry_size, ThreadInfo_t **thr)
int _papi_pfm_ctl(hwd_context_t *ctx, int code, _papi_int_option_t *option)
int tune_up_fd(int ctx_fd)
static void dump_smpl_arg(pfm_dfl_smpl_arg_t *arg)
int _papi_pfm_write_pmcs(pfm_context_t *ctx, pfm_control_state_t *ctl)
static int set_inherit(int arg)
static int _papi_pfm_init_control_state(hwd_control_state_t *ctl0)
int _papi_pfm_write(hwd_context_t *ctx, hwd_control_state_t *ctl, long long *from)
int _papi_pfm_reset(hwd_context_t *ctx, hwd_control_state_t *ctl)
static int _papi_pfm_allocate_registers(EventSetInfo_t *ESI)
int _papi_pfm_init_component(int cidx)
int _papi_pfm_shutdown_component()
static void pfm_bv_set(uint64_t *bv, uint16_t rnum)
static int round_requested_ns(int ns)
static int set_domain(hwd_control_state_t *ctl0, int domain)
static void dump_sets(pfarg_setdesc_t *set, int num_sets)
static int detach(hwd_context_t *ctx, hwd_control_state_t *ctl)
int _papi_pfm_shutdown(hwd_context_t *ctx0)
static int _papi_pfm_update_control_state(hwd_control_state_t *ctl0, NativeInfo_t *native, int count, hwd_context_t *ctx0)
int _papi_pfm_start(hwd_context_t *ctx0, hwd_control_state_t *ctl0)
int _papi_pfm_write_pmds(pfm_context_t *ctx, pfm_control_state_t *ctl)
static int get_string_from_file(char *file, char *str, int len)
static pfmlib_regmask_t _perfmon2_pfm_unavailable_pmds
static void _papi_pfm_dispatch_timer(int n, hwd_siginfo_t *info, void *uc)
static void dump_smpl(pfm_dfl_smpl_entry_t *entry)
static int _papi_pfm_stop_profiling(ThreadInfo_t *thread, EventSetInfo_t *ESI)
static void dump_smpl_hdr(pfm_dfl_smpl_hdr_t *hdr)
#define PFM_DFL_SMPL_NAME
os_err_t pfm_getinfo_evtsets(int fd, pfarg_setinfo_t *info, int count)
os_err_t pfm_stop(int fd)
os_err_t pfm_write_pmds(int fd, pfarg_pmd_t *pmds, int count)
os_err_t pfm_unload_context(int fd)
os_err_t pfm_write_pmcs(int fd, pfarg_pmc_t *pmcs, int count)
os_err_t pfm_delete_evtsets(int fd, pfarg_setdesc_t *setd, int count)
os_err_t pfm_start(int fd, pfarg_start_t *start)
os_err_t pfm_create_context(pfarg_ctx_t *ctx, char *smpl_name, void *smpl_arg, size_t smpl_size)
os_err_t pfm_restart(int fd)
os_err_t pfm_load_context(int fd, pfarg_load_t *load)
os_err_t pfm_create_evtsets(int fd, pfarg_setdesc_t *setd, int count)
os_err_t pfm_read_pmds(int fd, pfarg_pmd_t *pmds, int count)
#define PFMLIB_SPARC_ULTRA3I_PMU
#define PFMLIB_SPARC_ULTRA12_PMU
char * pfm_strerror(int code)
pfm_err_t pfm_dispatch_events(pfmlib_input_param_t *p, void *model_in, pfmlib_output_param_t *q, void *model_out)
static int pfm_regmask_set(pfmlib_regmask_t *h, unsigned int b)
#define PFMLIB_SPARC_ULTRA3PLUS_PMU
#define PFMLIB_SPARC_ULTRA3_PMU
#define PFMLIB_ITANIUM2_PMU
#define PFMLIB_MONTECITO_PMU
#define PFMLIB_SPARC_ULTRA4PLUS_PMU
#define PFMLIB_ERR_NOTSUPP
int pfm_ita2_is_iear(unsigned int i)
int pfm_ita2_is_dear(unsigned int i)
int pfm_mont_is_dear(unsigned int i)
int pfm_mont_is_iear(unsigned int i)
int pos[PAPI_EVENTS_IN_DERIVED_EVENT]
EventSetProfileInfo_t profile
struct _ThreadInfo * master
EventInfo_t * EventInfoArray
hwd_control_state_t * ctl_state
NativeInfo_t * NativeInfoArray
EventSetOverflowInfo_t overflow
unsigned int fast_counter_read
char support_version[PAPI_MIN_STR_LEN]
char kernel_version[PAPI_MIN_STR_LEN]
char name[PAPI_MAX_STR_LEN]
char disabled_reason[PAPI_HUGE_STR_LEN]
unsigned int fast_real_timer
char model_string[PAPI_MAX_STR_LEN]
hwd_ucontext_t * ucontext
PAPI_component_info_t cmp_info
uint64_t set_avail_pmcs[PFM_PMC_BV]
uint64_t set_avail_pmds[PFM_PMD_BV]
pfarg_setdesc_t set[PFMLIB_MAX_PMDS]
long long counts[PFMLIB_MAX_PMDS]
pfarg_setinfo_t setinfo[PFMLIB_MAX_PMDS]
pfmlib_output_param_t out
pfarg_pmd_t pd[PFMLIB_MAX_PMDS]
pfarg_pmc_t pc[PFMLIB_MAX_PMCS]
uint64_t hdr_min_buf_space
unsigned long msg_ovfl_pmds[4]
pfmlib_reg_t pfp_pmds[PFMLIB_MAX_PMDS]
pfmlib_reg_t pfp_pmcs[PFMLIB_MAX_PMCS]
unsigned int pfp_pmc_count
unsigned int pfp_pmd_count
unsigned long long reg_value
__syscall_slong_t tv_nsec
inline_static ThreadInfo_t * _papi_hwi_lookup_thread(int custom_tid)
_papi_int_domain_t domain
_papi_int_multiplex_t multiplex
_papi_int_granularity_t granularity
_papi_int_attach_t attach
_papi_int_itimer_t itimer
_papi_int_addr_range_t address_range
struct pfm_ita2_pmd_reg_t::@54 pmd0_ita2_reg
struct pfm_ita2_pmd_reg_t::@61 pmd17_ita2_reg
struct pfm_ita2_pmd_reg_t::@57 pmd3_ita2_reg
struct pfm_mont_pmd_reg_t::@75 pmd33_mont_reg
struct pfm_mont_pmd_reg_t::@76 pmd34_mont_reg
struct pfm_mont_pmd_reg_t::@78 pmd36_mont_reg
pfm_ovfl_msg_t pfm_ovfl_msg