PAPI  5.3.2.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
perfmon-ia64.c File Reference
Include dependency graph for perfmon-ia64.c:

Go to the source code of this file.

Macros

#define OVFL_SIGNAL   SIGPROF
 
#define PFMW_PEVT_EVTCOUNT(evt)   (evt->inp.pfp_event_count)
 
#define PFMW_PEVT_EVENT(evt, idx)   (evt->inp.pfp_events[idx].event)
 
#define PFMW_PEVT_PLM(evt, idx)   (evt->inp.pfp_events[idx].plm)
 
#define PFMW_PEVT_DFLPLM(evt)   (evt->inp.pfp_dfl_plm)
 
#define PFMW_PEVT_PFPPC(evt)   (evt->pc)
 
#define PFMW_PEVT_PFPPD(evt)   (evt->pd)
 
#define PFMW_PEVT_PFPPC_COUNT(evt)   (evt->outp.pfp_pmc_count)
 
#define PFMW_PEVT_PFPPC_REG_NUM(evt, idx)   (evt->outp.pfp_pmcs[idx].reg_num)
 
#define PFMW_PEVT_PFPPC_REG_VAL(evt, idx)   (evt->pc[idx].reg_value)
 
#define PFMW_PEVT_PFPPC_REG_FLG(evt, idx)   (evt->pc[idx].reg_flags)
 
#define PFMW_ARCH_REG_PMCVAL(reg)   (reg.pmc_val)
 
#define PFMW_ARCH_REG_PMDVAL(reg)   (reg.pmd_val)
 
#define PFMON_MONT_MAX_IBRS   8
 
#define PFMON_MONT_MAX_DBRS   8
 
#define PFMON_ITA2_MAX_IBRS   8
 
#define PFMON_ITA2_MAX_DBRS   8
 

Typedefs

typedef pfm_default_smpl_hdr_t pfmw_smpl_hdr_t
 
typedef pfm_default_smpl_entry_t pfmw_smpl_entry_t
 

Functions

static void pfmw_start (hwd_context_t *ctx)
 
static void pfmw_stop (hwd_context_t *ctx)
 
static int pfmw_perfmonctl (pid_t tid, int fd, int cmd, void *arg, int narg)
 
static int pfmw_destroy_context (hwd_context_t *thr_ctx)
 
static int pfmw_dispatch_events (pfmw_param_t *evt)
 
static int pfmw_create_ctx_common (hwd_context_t *ctx)
 
static int pfmw_create_context (hwd_context_t *thr_ctx)
 
static int set_pmds_to_write (EventSetInfo_t *ESI, int index, unsigned long value)
 
static int _pfm_decode_native_event (unsigned int EventCode, unsigned int *event, unsigned int *umask)
 
static int pfmw_recreate_context (EventSetInfo_t *ESI, hwd_context_t *thr_ctx, void **smpl_vaddr, int EventIndex)
 
static int pfmw_get_event_name (char *name, unsigned int idx)
 
static void pfmw_get_event_description (unsigned int idx, char *dest, int len)
 
static int pfmw_is_dear (unsigned int i)
 
static int pfmw_is_iear (unsigned int i)
 
static int pfmw_support_darr (unsigned int i)
 
static int pfmw_support_iarr (unsigned int i)
 
static int pfmw_support_opcm (unsigned int i)
 
static void check_ibrp_events (hwd_control_state_t *current_state)
 
static int install_irange (hwd_context_t *pctx, hwd_control_state_t *current_state)
 
static int install_drange (hwd_context_t *pctx, hwd_control_state_t *current_state)
 
static int set_drange (hwd_context_t *ctx, hwd_control_state_t *current_state, _papi_int_option_t *option)
 
static int set_irange (hwd_context_t *ctx, hwd_control_state_t *current_state, _papi_int_option_t *option)
 
static int pfmw_get_num_counters (int *num)
 
static int pfmw_get_num_events (int *num)
 
static int _ia64_modify_event (unsigned int event, int modifier)
 
static int encode_native_event_raw (unsigned int event, unsigned int mask)
 
static int prepare_umask (unsigned int foo, unsigned int *values)
 
int _papi_pfm_ntv_enum_events (unsigned int *EventCode, int modifier)
 
static int _papi_pfm_ntv_name_to_code (char *name, unsigned int *event_code)
 
int _papi_pfm_ntv_code_to_name (unsigned int EventCode, char *ntv_name, int len)
 
int _papi_pfm_ntv_code_to_descr (unsigned int EventCode, char *ntv_descr, int len)
 
int generate_preset_search_map (hwi_search_t **maploc, itanium_preset_search_t *oldmap, int num_cnt)
 
static char * search_cpu_info (FILE *f, char *search_str, char *line)
 
int _ia64_ita_set_domain (hwd_control_state_t *this_state, int domain)
 
int _ia64_ita2_set_domain (hwd_control_state_t *this_state, int domain)
 
int _ia64_mont_set_domain (hwd_control_state_t *this_state, int domain)
 
int _ia64_set_domain (hwd_control_state_t *this_state, int domain)
 
static int set_granularity (hwd_control_state_t *this_state, int domain)
 
int _ia64_ita_read (hwd_context_t *ctx, hwd_control_state_t *machdep, long long **events, int flags)
 
int _ia64_ita23_read (hwd_context_t *ctx, hwd_control_state_t *machdep, long long **events, int flags)
 
int _ia64_read (hwd_context_t *ctx, hwd_control_state_t *machdep, long long **events, int flags)
 
static int set_inherit (int arg)
 
static int set_default_domain (hwd_control_state_t *this_state, int domain)
 
static int set_default_granularity (hwd_control_state_t *this_state, int granularity)
 
int _ia64_init_component (int cidx)
 
int _ia64_init (hwd_context_t *zero)
 
int _ia64_reset (hwd_context_t *ctx, hwd_control_state_t *machdep)
 
int _ia64_start (hwd_context_t *ctx, hwd_control_state_t *current_state)
 
int _ia64_stop (hwd_context_t *ctx, hwd_control_state_t *zero)
 
static int round_requested_ns (int ns)
 
int _ia64_ctl (hwd_context_t *zero, int code, _papi_int_option_t *option)
 
int _ia64_shutdown (hwd_context_t *ctx)
 
static int ia64_ita_process_profile_buffer (ThreadInfo_t *thread, EventSetInfo_t *ESI)
 
static int ia64_ita2_process_profile_buffer (ThreadInfo_t *thread, EventSetInfo_t *ESI)
 
static int ia64_mont_process_profile_buffer (ThreadInfo_t *thread, EventSetInfo_t *ESI)
 
static int ia64_process_profile_buffer (ThreadInfo_t *thread, EventSetInfo_t *ESI)
 
static void ia64_dispatch_sigprof (int n, hwd_siginfo_t *info, hwd_ucontext_t *sc)
 
void _ia64_dispatch_timer (int signal, hwd_siginfo_t *info, void *context)
 
static int set_notify (EventSetInfo_t *ESI, int index, int value)
 
int _ia64_stop_profiling (ThreadInfo_t *thread, EventSetInfo_t *ESI)
 
int _ia64_set_profile (EventSetInfo_t *ESI, int EventIndex, int threshold)
 
int _ia64_set_overflow (EventSetInfo_t *ESI, int EventIndex, int threshold)
 
int _ia64_ntv_code_to_name (unsigned int EventCode, char *ntv_name, int len)
 
int _ia64_ntv_code_to_descr (unsigned int EventCode, char *ntv_descr, int len)
 
int _ia64_ntv_enum_events (unsigned int *EventCode, int modifier)
 
int _ia64_ita_init_control_state (hwd_control_state_t *this_state)
 
int _ia64_ita2_init_control_state (hwd_control_state_t *this_state)
 
int _ia64_mont_init_control_state (hwd_control_state_t *this_state)
 
int _ia64_init_control_state (hwd_control_state_t *this_state)
 
void _ia64_remove_native (hwd_control_state_t *this_state, NativeInfo_t *nativeInfo)
 
int _ia64_mont_update_control_state (hwd_control_state_t *this_state, NativeInfo_t *native, int count, hwd_context_t *zero)
 
int _ia64_ita_update_control_state (hwd_control_state_t *this_state, NativeInfo_t *native, int count, hwd_context_t *zero)
 
int _ia64_update_control_state (hwd_control_state_t *this_state, NativeInfo_t *native, int count, hwd_context_t *zero)
 

Variables

int _perfmon2_pfm_pmu_type = -1
 
papi_vector_t _ia64_vector
 
hwi_search_tpreset_search_map
 
unsigned int PAPI_NATIVE_EVENT_AND_MASK = 0x000003ff
 
unsigned int PAPI_NATIVE_EVENT_SHIFT = 0
 
unsigned int PAPI_NATIVE_UMASK_AND_MASK = 0x03fffc00
 
unsigned int PAPI_NATIVE_UMASK_MAX = 16
 
unsigned int PAPI_NATIVE_UMASK_SHIFT = 10
 
static itanium_preset_search_t ia1_preset_search_map []
 
static itanium_preset_search_t ia2_preset_search_map []
 
static itanium_preset_search_t ia3_preset_search_map []
 

Macro Definition Documentation

#define OVFL_SIGNAL   SIGPROF

Definition at line 46 of file perfmon-ia64.c.

#define PFMON_ITA2_MAX_DBRS   8

Definition at line 64 of file perfmon-ia64.c.

#define PFMON_ITA2_MAX_IBRS   8

Definition at line 63 of file perfmon-ia64.c.

#define PFMON_MONT_MAX_DBRS   8

Definition at line 61 of file perfmon-ia64.c.

#define PFMON_MONT_MAX_IBRS   8

Definition at line 60 of file perfmon-ia64.c.

#define PFMW_ARCH_REG_PMCVAL (   reg)    (reg.pmc_val)

Definition at line 57 of file perfmon-ia64.c.

#define PFMW_ARCH_REG_PMDVAL (   reg)    (reg.pmd_val)

Definition at line 58 of file perfmon-ia64.c.

#define PFMW_PEVT_DFLPLM (   evt)    (evt->inp.pfp_dfl_plm)

Definition at line 50 of file perfmon-ia64.c.

#define PFMW_PEVT_EVENT (   evt,
  idx 
)    (evt->inp.pfp_events[idx].event)

Definition at line 48 of file perfmon-ia64.c.

#define PFMW_PEVT_EVTCOUNT (   evt)    (evt->inp.pfp_event_count)

Definition at line 47 of file perfmon-ia64.c.

#define PFMW_PEVT_PFPPC (   evt)    (evt->pc)

Definition at line 51 of file perfmon-ia64.c.

#define PFMW_PEVT_PFPPC_COUNT (   evt)    (evt->outp.pfp_pmc_count)

Definition at line 53 of file perfmon-ia64.c.

#define PFMW_PEVT_PFPPC_REG_FLG (   evt,
  idx 
)    (evt->pc[idx].reg_flags)

Definition at line 56 of file perfmon-ia64.c.

#define PFMW_PEVT_PFPPC_REG_NUM (   evt,
  idx 
)    (evt->outp.pfp_pmcs[idx].reg_num)

Definition at line 54 of file perfmon-ia64.c.

#define PFMW_PEVT_PFPPC_REG_VAL (   evt,
  idx 
)    (evt->pc[idx].reg_value)

Definition at line 55 of file perfmon-ia64.c.

#define PFMW_PEVT_PFPPD (   evt)    (evt->pd)

Definition at line 52 of file perfmon-ia64.c.

#define PFMW_PEVT_PLM (   evt,
  idx 
)    (evt->inp.pfp_events[idx].plm)

Definition at line 49 of file perfmon-ia64.c.

Typedef Documentation

typedef pfm_default_smpl_entry_t pfmw_smpl_entry_t

Definition at line 84 of file perfmon-ia64.c.

typedef pfm_default_smpl_hdr_t pfmw_smpl_hdr_t

Definition at line 83 of file perfmon-ia64.c.

Function Documentation

int _ia64_ctl ( hwd_context_t zero,
int  code,
_papi_int_option_t option 
)

Definition at line 2233 of file perfmon-ia64.c.

2234 {
2235  int ret;
2236  switch ( code ) {
2237  case PAPI_DEFDOM:
2238  return ( set_default_domain( option->domain.ESI->ctl_state,
2239  option->domain.domain ) );
2240  case PAPI_DOMAIN:
2241  return ( _ia64_set_domain
2242  ( option->domain.ESI->ctl_state, option->domain.domain ) );
2243  case PAPI_DEFGRN:
2244  return ( set_default_granularity
2245  ( option->granularity.ESI->ctl_state,
2246  option->granularity.granularity ) );
2247  case PAPI_GRANUL:
2248  return ( set_granularity( option->granularity.ESI->ctl_state,
2249  option->granularity.granularity ) );
2250 #if 0
2251  case PAPI_INHERIT:
2252  return ( set_inherit( option->inherit.inherit ) );
2253 #endif
2254  case PAPI_DATA_ADDRESS:
2255  ret =
2257  option->address_range.domain );
2258  if ( ret != PAPI_OK )
2259  return ( ret );
2260  set_drange( zero, option->address_range.ESI->ctl_state, option );
2261  return ( PAPI_OK );
2262  case PAPI_INSTR_ADDRESS:
2263  ret =
2265  option->address_range.domain );
2266  if ( ret != PAPI_OK )
2267  return ( ret );
2268  set_irange( zero, option->address_range.ESI->ctl_state, option );
2269  return ( PAPI_OK );
2270  case PAPI_DEF_ITIMER:{
2271  /* flags are currently ignored, eventually the flags will be able
2272  to specify whether or not we use POSIX itimers (clock_gettimer) */
2273  if ( ( option->itimer.itimer_num == ITIMER_REAL ) &&
2274  ( option->itimer.itimer_sig != SIGALRM ) )
2275  return PAPI_EINVAL;
2276  if ( ( option->itimer.itimer_num == ITIMER_VIRTUAL ) &&
2277  ( option->itimer.itimer_sig != SIGVTALRM ) )
2278  return PAPI_EINVAL;
2279  if ( ( option->itimer.itimer_num == ITIMER_PROF ) &&
2280  ( option->itimer.itimer_sig != SIGPROF ) )
2281  return PAPI_EINVAL;
2282  if ( option->itimer.ns > 0 )
2283  option->itimer.ns = round_requested_ns( option->itimer.ns );
2284  /* At this point, we assume the user knows what he or
2285  she is doing, they maybe doing something arch specific */
2286  return PAPI_OK;
2287  }
2288  case PAPI_DEF_MPX_NS:{
2289  option->multiplex.ns = round_requested_ns( option->multiplex.ns );
2290  return ( PAPI_OK );
2291  }
2292  case PAPI_DEF_ITIMER_NS:{
2293  option->itimer.ns = round_requested_ns( option->itimer.ns );
2294  return ( PAPI_OK );
2295  }
2296  default:
2297  return ( PAPI_EINVAL );
2298  }
2299 }
_papi_int_inherit_t inherit
#define PAPI_DEF_ITIMER_NS
Definition: papi.h:453
EventSetInfo_t * ESI
#define PAPI_INSTR_ADDRESS
Definition: papi.h:451
_papi_int_addr_range_t address_range
#define PAPI_DATA_ADDRESS
Definition: papi.h:450
static int set_irange(hwd_context_t *ctx, hwd_control_state_t *current_state, _papi_int_option_t *option)
Definition: perfmon-ia64.c:919
return PAPI_OK
Definition: linux-nvml.c:458
return PAPI_EINVAL
Definition: linux-nvml.c:408
#define PAPI_INHERIT
Definition: papi.h:456
_papi_int_itimer_t itimer
long long ret
Definition: iozone.c:1346
static int round_requested_ns(int ns)
#define PAPI_DEFDOM
Definition: fpapi.h:49
_papi_int_granularity_t granularity
EventSetInfo_t * ESI
static int set_inherit(int arg)
#define PAPI_DOMAIN
Definition: fpapi.h:50
#define PAPI_DEFGRN
Definition: fpapi.h:51
#define PAPI_GRANUL
Definition: fpapi.h:52
_papi_int_multiplex_t multiplex
#define PAPI_DEF_MPX_NS
Definition: fpapi.h:53
int _ia64_set_domain(hwd_control_state_t *this_state, int domain)
static int set_default_domain(hwd_control_state_t *this_state, int domain)
static int set_drange(hwd_context_t *ctx, hwd_control_state_t *current_state, _papi_int_option_t *option)
Definition: perfmon-ia64.c:767
#define PAPI_DEF_ITIMER
Definition: papi.h:452
_papi_int_domain_t domain
static int set_default_granularity(hwd_control_state_t *this_state, int granularity)
hwd_control_state_t * ctl_state
static int set_granularity(hwd_control_state_t *this_state, int domain)
EventSetInfo_t * ESI

Here is the call graph for this function:

void _ia64_dispatch_timer ( int  signal,
hwd_siginfo_t info,
void context 
)

Definition at line 2666 of file perfmon-ia64.c.

2667 {
2668  ia64_dispatch_sigprof( signal, info, context );
2669 }
static void ia64_dispatch_sigprof(int n, hwd_siginfo_t *info, hwd_ucontext_t *sc)
signal(SIGINT, signal_handler)

Here is the call graph for this function:

int _ia64_init ( hwd_context_t zero)

Definition at line 2129 of file perfmon-ia64.c.

2130 {
2131 #if defined(USE_PROC_PTTIMER)
2132  {
2133  char buf[LINE_MAX];
2134  int fd;
2135  sprintf( buf, "/proc/%d/task/%d/stat", getpid( ), mygettid( ) );
2136  fd = open( buf, O_RDONLY );
2137  if ( fd == -1 ) {
2138  PAPIERROR( "open(%s)", buf );
2139  return ( PAPI_ESYS );
2140  }
2141  zero->stat_fd = fd;
2142  }
2143 #endif
2144  return ( pfmw_create_context( zero ) );
2145 }
sprintf(splash[splash_line++],"\tIozone: Performance Test of File I/O\n")
int fd
Definition: iozone.c:1291
static int pfmw_create_context(hwd_context_t *thr_ctx)
Definition: perfmon-ia64.c:233
static pid_t mygettid(void)
Definition: darwin-common.h:11
int open(const char *pathname, int flags, mode_t mode)
Definition: appio.c:184
char buf[200]
Definition: iozone.c:19609
void PAPIERROR(char *format,...)
#define PAPI_ESYS
Definition: fpapi.h:108

Here is the call graph for this function:

int _ia64_init_component ( int  cidx)

Definition at line 2019 of file perfmon-ia64.c.

2020 {
2021  ( void ) cidx; /*unused */
2022  int i, retval, type;
2023  unsigned int version;
2024  pfmlib_options_t pfmlib_options;
2025  itanium_preset_search_t *ia_preset_search_map = NULL;
2026 
2027  /* Always initialize globals dynamically to handle forks properly. */
2028 
2029  preset_search_map = NULL;
2030 
2031  /* Opened once for all threads. */
2032  if ( pfm_initialize( ) != PFMLIB_SUCCESS )
2033  return ( PAPI_ESYS );
2034 
2035  if ( pfm_get_version( &version ) != PFMLIB_SUCCESS )
2036  return PAPI_ECMP;
2037 
2038  if ( PFM_VERSION_MAJOR( version ) != PFM_VERSION_MAJOR( PFMLIB_VERSION ) ) {
2039  PAPIERROR( "Version mismatch of libpfm: compiled %#x vs. installed %#x",
2040  PFM_VERSION_MAJOR( PFMLIB_VERSION ),
2041  PFM_VERSION_MAJOR( version ) );
2042  return PAPI_ECMP;
2043  }
2044 
2045  memset( &pfmlib_options, 0, sizeof ( pfmlib_options ) );
2046 #ifdef DEBUG
2047  if ( ISLEVEL( DEBUG_SUBSTRATE ) ) {
2048  pfmlib_options.pfm_debug = 1;
2049  pfmlib_options.pfm_verbose = 1;
2050  }
2051 #endif
2052 
2053  if ( pfm_set_options( &pfmlib_options ) )
2054  return ( PAPI_ESYS );
2055 
2056  if ( pfm_get_pmu_type( &type ) != PFMLIB_SUCCESS )
2057  return ( PAPI_ESYS );
2058 
2059  _perfmon2_pfm_pmu_type = type;
2060 
2061  /* Setup presets */
2062 
2063  switch ( type ) {
2064  case PFMLIB_ITANIUM_PMU:
2065  ia_preset_search_map = ia1_preset_search_map;
2066  break;
2067  case PFMLIB_ITANIUM2_PMU:
2068  ia_preset_search_map = ia2_preset_search_map;
2069  break;
2070  case PFMLIB_MONTECITO_PMU:
2071  ia_preset_search_map = ia3_preset_search_map;
2072  break;
2073  default:
2074  PAPIERROR( "PMU type %d is not supported by this component", type );
2075  return ( PAPI_EBUG );
2076  }
2077 
2078  int ncnt, nnev;
2079 
2080  retval = pfmw_get_num_events( &nnev );
2081  if ( retval != PAPI_OK )
2082  return ( retval );
2083 
2084  retval = pfmw_get_num_counters( &ncnt );
2085  if ( retval != PAPI_OK )
2086  return ( retval );
2087 
2089  "%08x", PFMLIB_VERSION );
2091  "%08x", 2 << 16 ); /* 2.0 */
2092 
2096 
2097  _ia64_vector.cmp_info.clock_ticks = sysconf( _SC_CLK_TCK );
2098  /* Put the signal handler in use to consume PFM_END_MSG's */
2101 
2102  retval = mmtimer_setup();
2103  if ( retval )
2104  return ( retval );
2105 
2106  retval =
2107  generate_preset_search_map( &preset_search_map, ia_preset_search_map,
2109  if ( retval )
2110  return ( retval );
2111 
2113  if ( retval )
2114  return ( retval );
2115 
2116  /* get_memory_info has a CPU model argument that is not used,
2117  * faking it here with hw_info.model which is not set by this
2118  * component
2119  */
2122  if ( retval )
2123  return ( retval );
2124 
2125  return ( PAPI_OK );
2126 }
sprintf(splash[splash_line++],"\tIozone: Performance Test of File I/O\n")
memset(eventId, 0, size)
static itanium_preset_search_t ia1_preset_search_map[]
static int pfmw_get_num_counters(int *num)
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
char kernel_version[PAPI_MIN_STR_LEN]
Definition: papi.h:631
static itanium_preset_search_t ia3_preset_search_map[]
static int pfmw_get_num_events(int *num)
int _papi_hwi_setup_all_presets(hwi_search_t *findem, int cidx)
Definition: papi_preset.c:37
int i
Definition: fileop.c:140
int _linux_get_memory_info(PAPI_hw_info_t *hwinfo, int cpu_type)
Definition: linux-memory.c:912
static int cidx
Definition: event_info.c:40
#define PAPI_ECMP
Definition: fpapi.h:109
void PAPIERROR(char *format,...)
int _papi_hwi_start_signal(int signal, int need_context, int cidx)
Definition: extras.c:401
int mmtimer_setup(void)
Definition: linux-timer.c:116
char version[]
Definition: fileop.c:134
#define PAPI_ESYS
Definition: fpapi.h:108
hwi_search_t * preset_search_map
papi_mdi_t _papi_hwi_system_info
Definition: papi_internal.c:57
PAPI_hw_info_t hw_info
static itanium_preset_search_t ia2_preset_search_map[]
int generate_preset_search_map(hwi_search_t **maploc, itanium_preset_search_t *oldmap, int num_cnt)
#define PAPI_EBUG
Definition: fpapi.h:111
int model
Definition: papi.h:784
#define ISLEVEL(a)
Definition: papi_debug.h:54
char support_version[PAPI_MIN_STR_LEN]
Definition: papi.h:630
ssize_t retval
Definition: libasync.c:338
#define DEBUG_SUBSTRATE
Definition: papi_debug.h:27

Here is the call graph for this function:

int _ia64_init_control_state ( hwd_control_state_t this_state)

Definition at line 2932 of file perfmon-ia64.c.

2933 {
2934  switch ( _perfmon2_pfm_pmu_type ) {
2935  case PFMLIB_ITANIUM_PMU:
2936  return ( _ia64_ita_init_control_state( this_state ) );
2937  break;
2938  case PFMLIB_ITANIUM2_PMU:
2939  return ( _ia64_ita2_init_control_state( this_state ) );
2940  break;
2941  case PFMLIB_MONTECITO_PMU:
2942  return ( _ia64_mont_init_control_state( this_state ) );
2943  break;
2944  default:
2945  PAPIERROR( "PMU type %d is not supported by this component",
2947  return ( PAPI_EBUG );
2948  }
2949 }
int _ia64_ita_init_control_state(hwd_control_state_t *this_state)
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
void PAPIERROR(char *format,...)
#define PAPI_EBUG
Definition: fpapi.h:111
int _ia64_ita2_init_control_state(hwd_control_state_t *this_state)
int _ia64_mont_init_control_state(hwd_control_state_t *this_state)

Here is the call graph for this function:

int _ia64_ita23_read ( hwd_context_t ctx,
hwd_control_state_t machdep,
long long **  events,
int  flags 
)

Definition at line 1935 of file perfmon-ia64.c.

1937 {
1938  ( void ) flags; /*unused */
1939  int i;
1940  pfarg_reg_t readem[_ia64_vector.cmp_info.num_cntrs];
1941 
1942  pfmw_stop( ( ia64_context_t * ) ctx );
1943  memset( readem, 0x0, sizeof readem );
1944 
1945 /* read the 4 counters, the high level function will process the
1946  mapping for papi event to hardware counter
1947 */
1948  for ( i = 0; i < _ia64_vector.cmp_info.num_cntrs; i++ ) {
1949  readem[i].reg_num = PMU_FIRST_COUNTER + i;
1950  }
1951 
1952  if ( pfmw_perfmonctl
1953  ( ( ( ia64_context_t * ) ctx )->tid, ( ( ia64_context_t * ) ctx )->fd,
1954  PFM_READ_PMDS, readem, _ia64_vector.cmp_info.num_cntrs ) == -1 ) {
1955  SUBDBG( "perfmonctl error READ_PMDS errno %d\n", errno );
1956  pfmw_start( ( ia64_context_t * ) ctx );
1957  return PAPI_ESYS;
1958  }
1959 
1960  for ( i = 0; i < _ia64_vector.cmp_info.num_cntrs; i++ ) {
1961  ( ( ia64_control_state_t * ) machdep )->counters[i] =
1962  readem[i].reg_value;
1963  SUBDBG( "read counters is %ld\n", readem[i].reg_value );
1964  }
1965 
1966  *events = ( ( ia64_control_state_t * ) machdep )->counters;
1967  pfmw_start( ( ia64_context_t * ) ctx );
1968  return PAPI_OK;
1969 }
memset(eventId, 0, size)
int errno
static void pfmw_stop(hwd_context_t *ctx)
Definition: perfmon-ia64.c:93
static void pfmw_start(hwd_context_t *ctx)
Definition: perfmon-ia64.c:87
long long flags
Definition: iozone.c:12330
int fd
Definition: iozone.c:1291
static int pfmw_perfmonctl(pid_t tid, int fd, int cmd, void *arg, int narg)
Definition: perfmon-ia64.c:99
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
int i
Definition: fileop.c:140
void *long long tid
Definition: iozone.c:18586
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
#define PMU_FIRST_COUNTER
Definition: perfmon-ia64.h:96
char events[MAX_EVENTS][BUFSIZ]
#define PAPI_ESYS
Definition: fpapi.h:108

Here is the call graph for this function:

Here is the caller graph for this function:

int _ia64_ita2_init_control_state ( hwd_control_state_t this_state)

Definition at line 2888 of file perfmon-ia64.c.

2889 {
2890  pfmw_param_t *evt;
2891  pfmw_ita2_param_t *param;
2893 
2894  ptr = ( ia64_control_state_t * ) this_state;
2895  evt = &( ptr->evt );
2896 
2897  param = &( ptr->ita_lib_param.ita2_param );
2898  memset( evt, 0, sizeof ( pfmw_param_t ) );
2899  memset( param, 0, sizeof ( pfmw_ita2_param_t ) );
2900 
2902 /* set library parameter pointer */
2903  evt->mod_inp = &( param->ita2_input_param );
2904  evt->mod_outp = &( param->ita2_output_param );
2905 
2906  return ( PAPI_OK );
2907 }
pfmw_ita_param_t ita_lib_param
Definition: perfmon-ia64.h:114
memset(eventId, 0, size)
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
void * mod_outp
Definition: perfmon-ia64.h:76
int _ia64_ita2_set_domain(hwd_control_state_t *this_state, int domain)
pfmw_ita2_param_t ita2_param
Definition: perfmon-ia64.h:101
pfmlib_ita2_output_param_t ita2_output_param
Definition: perfmon-ia64.h:89
pfmlib_ita2_input_param_t ita2_input_param
Definition: perfmon-ia64.h:88
void * mod_inp
Definition: perfmon-ia64.h:75
char * ptr
Definition: iozone.c:23586

Here is the call graph for this function:

Here is the caller graph for this function:

int _ia64_ita2_set_domain ( hwd_control_state_t this_state,
int  domain 
)

Definition at line 1764 of file perfmon-ia64.c.

1765 {
1766  int mode = 0, did = 0, i;
1767  pfmw_param_t *evt = &this_state->evt;
1768 
1769  if ( domain & PAPI_DOM_USER ) {
1770  did = 1;
1771  mode |= PFM_PLM3;
1772  }
1773 
1774  if ( domain & PAPI_DOM_KERNEL ) {
1775  did = 1;
1776  mode |= PFM_PLM0;
1777  }
1778 
1779  if ( !did )
1780  return ( PAPI_EINVAL );
1781 
1782  PFMW_PEVT_DFLPLM( evt ) = mode;
1783 
1784  /* Bug fix in case we don't call pfmw_dispatch_events after this code */
1785  /* Who did this? This sucks, we should always call it here -PJM */
1786 
1787  for ( i = 0; i < _ia64_vector.cmp_info.num_cntrs; i++ ) {
1788  if ( PFMW_PEVT_PFPPC_REG_NUM( evt, i ) ) {
1789  pfm_ita2_pmc_reg_t value;
1790  SUBDBG( "slot %d, register %lud active, config value %#lx\n",
1791  i, ( unsigned long ) ( PFMW_PEVT_PFPPC_REG_NUM( evt, i ) ),
1792  PFMW_PEVT_PFPPC_REG_VAL( evt, i ) );
1793 
1794  PFMW_ARCH_REG_PMCVAL( value ) = PFMW_PEVT_PFPPC_REG_VAL( evt, i );
1795  value.pmc_ita2_counter_reg.pmc_plm = mode;
1796  PFMW_PEVT_PFPPC_REG_VAL( evt, i ) = PFMW_ARCH_REG_PMCVAL( value );
1797 
1798  SUBDBG( "new config value %#lx\n",
1799  PFMW_PEVT_PFPPC_REG_VAL( evt, i ) );
1800  }
1801  }
1802 
1803  return ( PAPI_OK );
1804 }
#define PFMW_PEVT_DFLPLM(evt)
Definition: perfmon-ia64.c:50
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
#define PAPI_DOM_KERNEL
Definition: fpapi.h:22
return PAPI_EINVAL
Definition: linux-nvml.c:408
#define PFMW_PEVT_PFPPC_REG_VAL(evt, idx)
Definition: perfmon-ia64.c:55
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
void double value
Definition: iozone.c:18781
#define PFMW_ARCH_REG_PMCVAL(reg)
Definition: perfmon-ia64.c:57
int i
Definition: fileop.c:140
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
#define PFMW_PEVT_PFPPC_REG_NUM(evt, idx)
Definition: perfmon-ia64.c:54
#define PAPI_DOM_USER
Definition: fpapi.h:21

Here is the caller graph for this function:

int _ia64_ita_init_control_state ( hwd_control_state_t this_state)

Definition at line 2868 of file perfmon-ia64.c.

2869 {
2870  pfmw_param_t *evt;
2871  pfmw_ita1_param_t *param;
2873 
2874  ptr = ( ia64_control_state_t * ) this_state;
2875  evt = &( ptr->evt );
2876 
2877  param = &( ptr->ita_lib_param.ita_param );
2878  memset( evt, 0, sizeof ( pfmw_param_t ) );
2879  memset( param, 0, sizeof ( pfmw_ita1_param_t ) );
2880 
2882 /* set library parameter pointer */
2883 
2884  return ( PAPI_OK );
2885 }
pfmw_ita_param_t ita_lib_param
Definition: perfmon-ia64.h:114
memset(eventId, 0, size)
pfmw_ita1_param_t ita_param
Definition: perfmon-ia64.h:100
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
int pfmw_ita1_param_t
Definition: perfmon-ia64.h:93
int _ia64_ita_set_domain(hwd_control_state_t *this_state, int domain)
char * ptr
Definition: iozone.c:23586

Here is the call graph for this function:

Here is the caller graph for this function:

int _ia64_ita_read ( hwd_context_t ctx,
hwd_control_state_t machdep,
long long **  events,
int  flags 
)

Definition at line 1888 of file perfmon-ia64.c.

1890 {
1891  ( void ) flags; /*unused */
1892  unsigned int i;
1893  pfarg_reg_t readem[_ia64_vector.cmp_info.num_cntrs];
1894 
1895  pfmw_stop( ( ia64_context_t * ) ctx );
1896  memset( readem, 0x0, sizeof readem );
1897 
1898 /* read the 4 counters, the high level function will process the
1899  mapping for papi event to hardware counter
1900 */
1901  for ( i = 0; i < ( unsigned int ) _ia64_vector.cmp_info.num_cntrs; i++ ) {
1902  readem[i].reg_num = PMU_FIRST_COUNTER + i;
1903  }
1904 
1905  if ( pfmw_perfmonctl
1906  ( ( ( ia64_context_t * ) ctx )->tid, ( ( ia64_context_t * ) ctx )->fd,
1907  PFM_READ_PMDS, readem, _ia64_vector.cmp_info.num_cntrs ) == -1 ) {
1908  SUBDBG( "perfmonctl error READ_PMDS errno %d\n", errno );
1909  pfmw_start( ( ia64_context_t * ) ctx );
1910  return PAPI_ESYS;
1911  }
1912 
1913  for ( i = 0; i < ( unsigned int ) _ia64_vector.cmp_info.num_cntrs; i++ ) {
1914  ( ( ia64_control_state_t * ) machdep )->counters[i] =
1915  readem[i].reg_value;
1916  SUBDBG( "read counters is %ld\n", readem[i].reg_value );
1917  }
1918 
1919  pfmw_param_t *pevt = &( ( ( ia64_control_state_t * ) machdep )->evt );
1920  pfm_ita_pmc_reg_t flop_hack;
1921  /* special case, We need to scale FP_OPS_HI */
1922  for ( i = 0; i < PFMW_PEVT_EVTCOUNT( pevt ); i++ ) {
1923  PFMW_ARCH_REG_PMCVAL( flop_hack ) = PFMW_PEVT_PFPPC_REG_VAL( pevt, i );
1924  if ( flop_hack.pmc_ita_count_reg.pmc_es == 0xa )
1925  ( ( ia64_control_state_t * ) machdep )->counters[i] *= 4;
1926  }
1927 
1928  *events = ( ( ia64_control_state_t * ) machdep )->counters;
1929  pfmw_start( ( ia64_context_t * ) ctx );
1930  return PAPI_OK;
1931 }
memset(eventId, 0, size)
int errno
static void pfmw_stop(hwd_context_t *ctx)
Definition: perfmon-ia64.c:93
static void pfmw_start(hwd_context_t *ctx)
Definition: perfmon-ia64.c:87
long long flags
Definition: iozone.c:12330
int fd
Definition: iozone.c:1291
static int pfmw_perfmonctl(pid_t tid, int fd, int cmd, void *arg, int narg)
Definition: perfmon-ia64.c:99
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
#define PFMW_PEVT_PFPPC_REG_VAL(evt, idx)
Definition: perfmon-ia64.c:55
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
#define PFMW_ARCH_REG_PMCVAL(reg)
Definition: perfmon-ia64.c:57
int i
Definition: fileop.c:140
void *long long tid
Definition: iozone.c:18586
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
#define PMU_FIRST_COUNTER
Definition: perfmon-ia64.h:96
char events[MAX_EVENTS][BUFSIZ]
#define PAPI_ESYS
Definition: fpapi.h:108
#define PFMW_PEVT_EVTCOUNT(evt)
Definition: perfmon-ia64.c:47
int
Definition: iozone.c:18528

Here is the call graph for this function:

Here is the caller graph for this function:

int _ia64_ita_set_domain ( hwd_control_state_t this_state,
int  domain 
)

Definition at line 1721 of file perfmon-ia64.c.

1722 {
1723  int mode = 0, did = 0, i;
1724  pfmw_param_t *evt = &( ( ia64_control_state_t * ) this_state )->evt;
1725 
1726  if ( domain & PAPI_DOM_USER ) {
1727  did = 1;
1728  mode |= PFM_PLM3;
1729  }
1730 
1731  if ( domain & PAPI_DOM_KERNEL ) {
1732  did = 1;
1733  mode |= PFM_PLM0;
1734  }
1735 
1736  if ( !did )
1737  return ( PAPI_EINVAL );
1738 
1739  PFMW_PEVT_DFLPLM( evt ) = mode;
1740 
1741  /* Bug fix in case we don't call pfmw_dispatch_events after this code */
1742  /* Who did this? This sucks, we should always call it here -PJM */
1743 
1744  for ( i = 0; i < _ia64_vector.cmp_info.num_cntrs; i++ ) {
1745  if ( PFMW_PEVT_PFPPC_REG_NUM( evt, i ) ) {
1746  pfm_ita_pmc_reg_t value;
1747  SUBDBG( "slot %d, register %lud active, config value %#lx\n",
1748  i, ( unsigned long ) ( PFMW_PEVT_PFPPC_REG_NUM( evt, i ) ),
1749  PFMW_PEVT_PFPPC_REG_VAL( evt, i ) );
1750 
1751  PFMW_ARCH_REG_PMCVAL( value ) = PFMW_PEVT_PFPPC_REG_VAL( evt, i );
1752  value.pmc_ita_count_reg.pmc_plm = mode;
1753  PFMW_PEVT_PFPPC_REG_VAL( evt, i ) = PFMW_ARCH_REG_PMCVAL( value );
1754 
1755  SUBDBG( "new config value %#lx\n",
1756  PFMW_PEVT_PFPPC_REG_VAL( evt, i ) );
1757  }
1758  }
1759 
1760  return PAPI_OK;
1761 }
#define PFMW_PEVT_DFLPLM(evt)
Definition: perfmon-ia64.c:50
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
#define PAPI_DOM_KERNEL
Definition: fpapi.h:22
return PAPI_EINVAL
Definition: linux-nvml.c:408
#define PFMW_PEVT_PFPPC_REG_VAL(evt, idx)
Definition: perfmon-ia64.c:55
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
void double value
Definition: iozone.c:18781
#define PFMW_ARCH_REG_PMCVAL(reg)
Definition: perfmon-ia64.c:57
int i
Definition: fileop.c:140
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
#define PFMW_PEVT_PFPPC_REG_NUM(evt, idx)
Definition: perfmon-ia64.c:54
#define PAPI_DOM_USER
Definition: fpapi.h:21

Here is the caller graph for this function:

int _ia64_ita_update_control_state ( hwd_control_state_t this_state,
NativeInfo_t native,
int  count,
hwd_context_t zero 
)

Definition at line 3042 of file perfmon-ia64.c.

3045 {
3046  ( void ) zero; /*unused */
3047  int index, org_cnt;
3048  unsigned int i;
3049  pfmw_param_t *evt = &this_state->evt;
3050  pfmw_param_t copy_evt;
3051 
3052  if ( count == 0 ) {
3053  for ( i = 0; i < ( unsigned int ) _ia64_vector.cmp_info.num_cntrs; i++ )
3054  PFMW_PEVT_EVENT( evt, i ) = 0;
3055  PFMW_PEVT_EVTCOUNT( evt ) = 0;
3056  memset( PFMW_PEVT_PFPPC( evt ), 0, sizeof ( PFMW_PEVT_PFPPC( evt ) ) );
3057  memset( &evt->inp.pfp_unavail_pmcs, 0, sizeof ( pfmlib_regmask_t ) );
3058  return ( PAPI_OK );
3059  }
3060 
3061 /* save the old data */
3062  org_cnt = PFMW_PEVT_EVTCOUNT( evt );
3063 
3064  memcpy( &copy_evt, evt, sizeof ( pfmw_param_t ) );
3065  for ( i = 0; i < ( unsigned int ) _ia64_vector.cmp_info.num_cntrs; i++ )
3066  PFMW_PEVT_EVENT( evt, i ) = 0;
3067  PFMW_PEVT_EVTCOUNT( evt ) = 0;
3068  memset( PFMW_PEVT_PFPPC( evt ), 0, sizeof ( PFMW_PEVT_PFPPC( evt ) ) );
3069  memset( &evt->inp.pfp_unavail_pmcs, 0, sizeof ( pfmlib_regmask_t ) );
3070 
3071  SUBDBG( " original count is %d\n", org_cnt );
3072 
3073 /* add new native events to the evt structure */
3074  for ( i = 0; i < ( unsigned int ) count; i++ ) {
3075  index = native[i].ni_event & PAPI_NATIVE_AND_MASK;
3076  PFMW_PEVT_EVENT( evt, i ) = index;
3077  }
3078  PFMW_PEVT_EVTCOUNT( evt ) = count;
3079  /* Recalcuate the pfmlib_param_t structure, may also signal conflict */
3080  if ( pfmw_dispatch_events( evt ) ) {
3081  SUBDBG( "pfmw_dispatch_events fail\n" );
3082  /* recover the old data */
3083  PFMW_PEVT_EVTCOUNT( evt ) = org_cnt;
3084  /*for (i = 0; i < _ia64_vector.cmp_info.num_cntrs; i++)
3085  PFMW_PEVT_EVENT(evt,i) = events[i];
3086  */
3087  memcpy( evt, &copy_evt, sizeof ( pfmw_param_t ) );
3088  return ( PAPI_ECNFLCT );
3089  }
3090  SUBDBG( "event_count=%d\n", PFMW_PEVT_EVTCOUNT( evt ) );
3091 
3092  for ( i = 0; i < PFMW_PEVT_EVTCOUNT( evt ); i++ ) {
3093  native[i].ni_position = PFMW_PEVT_PFPPC_REG_NUM( evt, i )
3095  SUBDBG( "event_code is %d, reg_num is %d\n",
3096  native[i].ni_event & PAPI_NATIVE_AND_MASK,
3097  native[i].ni_position );
3098  }
3099 
3100  return ( PAPI_OK );
3101 }
pfmlib_input_param_t inp
Definition: perfmon-ia64.h:73
memset(eventId, 0, size)
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
int count
Definition: iozone.c:22422
void
Definition: iozone.c:18627
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
#define PAPI_ECNFLCT
Definition: fpapi.h:113
int i
Definition: fileop.c:140
#define PFMW_PEVT_PFPPC(evt)
Definition: perfmon-ia64.c:51
#define PFMW_PEVT_EVENT(evt, idx)
Definition: perfmon-ia64.c:48
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
#define PMU_FIRST_COUNTER
Definition: perfmon-ia64.h:96
static int pfmw_dispatch_events(pfmw_param_t *evt)
Definition: perfmon-ia64.c:117
again struct sockaddr sizeof(struct sockaddr_in))
#define PFMW_PEVT_PFPPC_REG_NUM(evt, idx)
Definition: perfmon-ia64.c:54
#define PFMW_PEVT_EVTCOUNT(evt)
Definition: perfmon-ia64.c:47
int
Definition: iozone.c:18528
#define PAPI_NATIVE_AND_MASK

Here is the call graph for this function:

Here is the caller graph for this function:

static int _ia64_modify_event ( unsigned int  event,
int  modifier 
)
static

Definition at line 2826 of file perfmon-ia64.c.

2827 {
2828  switch ( modifier ) {
2829  case PAPI_NTV_ENUM_IARR:
2830  return ( pfmw_support_iarr( event ) );
2831  case PAPI_NTV_ENUM_DARR:
2832  return ( pfmw_support_darr( event ) );
2833  case PAPI_NTV_ENUM_OPCM:
2834  return ( pfmw_support_opcm( event ) );
2835  case PAPI_NTV_ENUM_DEAR:
2836  return ( pfmw_is_dear( event ) );
2837  case PAPI_NTV_ENUM_IEAR:
2838  return ( pfmw_is_iear( event ) );
2839  default:
2840  return ( 1 );
2841  }
2842 }
device[deviceId] domain[domainId] event
Definition: linux-cuda.c:306
static int pfmw_is_dear(unsigned int i)
Definition: perfmon-ia64.c:405
static int pfmw_is_iear(unsigned int i)
Definition: perfmon-ia64.c:425
static int pfmw_support_darr(unsigned int i)
Definition: perfmon-ia64.c:445
static int pfmw_support_iarr(unsigned int i)
Definition: perfmon-ia64.c:465
static int pfmw_support_opcm(unsigned int i)
Definition: perfmon-ia64.c:485

Here is the call graph for this function:

Here is the caller graph for this function:

int _ia64_mont_init_control_state ( hwd_control_state_t this_state)

Definition at line 2910 of file perfmon-ia64.c.

2911 {
2912  pfmw_param_t *evt;
2913  pfmw_mont_param_t *param;
2915 
2916  ptr = ( ia64_control_state_t * ) this_state;
2917  evt = &( ptr->evt );
2918 
2919  param = &( ptr->ita_lib_param.mont_param );
2920  memset( evt, 0, sizeof ( pfmw_param_t ) );
2921  memset( param, 0, sizeof ( pfmw_mont_param_t ) );
2922 
2924 /* set library parameter pointer */
2925  evt->mod_inp = &( param->mont_input_param );
2926  evt->mod_outp = &( param->mont_output_param );
2927 
2928  return ( PAPI_OK );
2929 }
pfmw_ita_param_t ita_lib_param
Definition: perfmon-ia64.h:114
memset(eventId, 0, size)
int _ia64_mont_set_domain(hwd_control_state_t *this_state, int domain)
pfmlib_mont_input_param_t mont_input_param
Definition: perfmon-ia64.h:81
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
void * mod_outp
Definition: perfmon-ia64.h:76
pfmlib_mont_output_param_t mont_output_param
Definition: perfmon-ia64.h:82
pfmw_mont_param_t mont_param
Definition: perfmon-ia64.h:102
void * mod_inp
Definition: perfmon-ia64.h:75
char * ptr
Definition: iozone.c:23586

Here is the call graph for this function:

Here is the caller graph for this function:

int _ia64_mont_set_domain ( hwd_control_state_t this_state,
int  domain 
)

Definition at line 1807 of file perfmon-ia64.c.

1808 {
1809  int mode = 0, did = 0, i;
1810  pfmw_param_t *evt = &( ( ia64_control_state_t * ) this_state )->evt;
1811 
1812  if ( domain & PAPI_DOM_USER ) {
1813  did = 1;
1814  mode |= PFM_PLM3;
1815  }
1816 
1817  if ( domain & PAPI_DOM_KERNEL ) {
1818  did = 1;
1819  mode |= PFM_PLM0;
1820  }
1821 
1822  if ( !did )
1823  return ( PAPI_EINVAL );
1824 
1825  PFMW_PEVT_DFLPLM( evt ) = mode;
1826 
1827  /* Bug fix in case we don't call pfmw_dispatch_events after this code */
1828  /* Who did this? This sucks, we should always call it here -PJM */
1829 
1830  for ( i = 0; i < _ia64_vector.cmp_info.num_cntrs; i++ ) {
1831  if ( PFMW_PEVT_PFPPC_REG_NUM( evt, i ) ) {
1832  pfm_mont_pmc_reg_t value;
1833  SUBDBG( "slot %d, register %lud active, config value %#lx\n",
1834  i, ( unsigned long ) ( PFMW_PEVT_PFPPC_REG_NUM( evt, i ) ),
1835  PFMW_PEVT_PFPPC_REG_VAL( evt, i ) );
1836 
1837  PFMW_ARCH_REG_PMCVAL( value ) = PFMW_PEVT_PFPPC_REG_VAL( evt, i );
1838  value.pmc_mont_counter_reg.pmc_plm = mode;
1839  PFMW_PEVT_PFPPC_REG_VAL( evt, i ) = PFMW_ARCH_REG_PMCVAL( value );
1840 
1841  SUBDBG( "new config value %#lx\n",
1842  PFMW_PEVT_PFPPC_REG_VAL( evt, i ) );
1843  }
1844  }
1845 
1846  return ( PAPI_OK );
1847 }
#define PFMW_PEVT_DFLPLM(evt)
Definition: perfmon-ia64.c:50
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
#define PAPI_DOM_KERNEL
Definition: fpapi.h:22
return PAPI_EINVAL
Definition: linux-nvml.c:408
#define PFMW_PEVT_PFPPC_REG_VAL(evt, idx)
Definition: perfmon-ia64.c:55
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
void double value
Definition: iozone.c:18781
#define PFMW_ARCH_REG_PMCVAL(reg)
Definition: perfmon-ia64.c:57
int i
Definition: fileop.c:140
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
#define PFMW_PEVT_PFPPC_REG_NUM(evt, idx)
Definition: perfmon-ia64.c:54
#define PAPI_DOM_USER
Definition: fpapi.h:21

Here is the caller graph for this function:

int _ia64_mont_update_control_state ( hwd_control_state_t this_state,
NativeInfo_t native,
int  count,
hwd_context_t zero 
)

Definition at line 2961 of file perfmon-ia64.c.

2964 {
2965  ( void ) zero; /*unused */
2966  int org_cnt;
2967  pfmw_param_t *evt = &this_state->evt;
2968  pfmw_param_t copy_evt;
2969  unsigned int i, j, event, umask, EventCode;
2970  pfmlib_event_t gete;
2971  char name[128];
2972 
2973  if ( count == 0 ) {
2974  for ( i = 0; i < ( unsigned int ) _ia64_vector.cmp_info.num_cntrs; i++ )
2975  PFMW_PEVT_EVENT( evt, i ) = 0;
2976  PFMW_PEVT_EVTCOUNT( evt ) = 0;
2977  memset( PFMW_PEVT_PFPPC( evt ), 0, sizeof ( PFMW_PEVT_PFPPC( evt ) ) );
2978  memset( &evt->inp.pfp_unavail_pmcs, 0, sizeof ( pfmlib_regmask_t ) );
2979  return ( PAPI_OK );
2980  }
2981 
2982 /* save the old data */
2983  org_cnt = PFMW_PEVT_EVTCOUNT( evt );
2984 
2985  memcpy( &copy_evt, evt, sizeof ( pfmw_param_t ) );
2986 
2987  for ( i = 0; i < ( unsigned int ) _ia64_vector.cmp_info.num_cntrs; i++ )
2988  PFMW_PEVT_EVENT( evt, i ) = 0;
2989  PFMW_PEVT_EVTCOUNT( evt ) = 0;
2990  memset( PFMW_PEVT_PFPPC( evt ), 0, sizeof ( PFMW_PEVT_PFPPC( evt ) ) );
2991  memset( &evt->inp.pfp_unavail_pmcs, 0, sizeof ( pfmlib_regmask_t ) );
2992 
2993  SUBDBG( " original count is %d\n", org_cnt );
2994 
2995 /* add new native events to the evt structure */
2996  for ( i = 0; i < ( unsigned int ) count; i++ ) {
2997  memset( &gete, 0, sizeof ( gete ) );
2998  EventCode = native[i].ni_event;
2999  _papi_pfm_ntv_code_to_name( EventCode, name, 128 );
3000  if ( _pfm_decode_native_event( EventCode, &event, &umask ) != PAPI_OK )
3001  return ( PAPI_ENOEVNT );
3002 
3003  SUBDBG( " evtcode=%#x evtindex=%d name: %s\n", EventCode, event,
3004  name );
3005 
3006  PFMW_PEVT_EVENT( evt, i ) = event;
3007  evt->inp.pfp_events[i].num_masks = 0;
3008  gete.event = event;
3009  gete.num_masks = prepare_umask( umask, gete.unit_masks );
3010  if ( gete.num_masks ) {
3011  evt->inp.pfp_events[i].num_masks = gete.num_masks;
3012  for ( j = 0; j < gete.num_masks; j++ )
3013  evt->inp.pfp_events[i].unit_masks[j] = gete.unit_masks[j];
3014  }
3015  }
3016  PFMW_PEVT_EVTCOUNT( evt ) = count;
3017  /* Recalcuate the pfmlib_param_t structure, may also signal conflict */
3018  if ( pfmw_dispatch_events( evt ) ) {
3019  SUBDBG( "pfmw_dispatch_events fail\n" );
3020  /* recover the old data */
3021  PFMW_PEVT_EVTCOUNT( evt ) = org_cnt;
3022  /*for (i = 0; i < _ia64_vector.cmp_info.num_cntrs; i++)
3023  PFMW_PEVT_EVENT(evt,i) = events[i];
3024  */
3025  memcpy( evt, &copy_evt, sizeof ( pfmw_param_t ) );
3026  return ( PAPI_ECNFLCT );
3027  }
3028  SUBDBG( "event_count=%d\n", PFMW_PEVT_EVTCOUNT( evt ) );
3029 
3030  for ( i = 0; i < PFMW_PEVT_EVTCOUNT( evt ); i++ ) {
3031  native[i].ni_position = PFMW_PEVT_PFPPC_REG_NUM( evt, i )
3033  SUBDBG( "event_code is %d, reg_num is %d\n",
3034  native[i].ni_event & PAPI_NATIVE_AND_MASK,
3035  native[i].ni_position );
3036  }
3037 
3038  return ( PAPI_OK );
3039 }
pfmlib_input_param_t inp
Definition: perfmon-ia64.h:73
memset(eventId, 0, size)
static int prepare_umask(unsigned int foo, unsigned int *values)
#define PAPI_ENOEVNT
Definition: fpapi.h:112
device[deviceId] domain[domainId] event
Definition: linux-cuda.c:306
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
int count
Definition: iozone.c:22422
void
Definition: iozone.c:18627
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
#define PAPI_ECNFLCT
Definition: fpapi.h:113
int _papi_pfm_ntv_code_to_name(unsigned int EventCode, char *ntv_name, int len)
int i
Definition: fileop.c:140
#define PFMW_PEVT_PFPPC(evt)
Definition: perfmon-ia64.c:51
#define PFMW_PEVT_EVENT(evt, idx)
Definition: perfmon-ia64.c:48
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
#define PMU_FIRST_COUNTER
Definition: perfmon-ia64.h:96
static int pfmw_dispatch_events(pfmw_param_t *evt)
Definition: perfmon-ia64.c:117
again struct sockaddr sizeof(struct sockaddr_in))
#define PFMW_PEVT_PFPPC_REG_NUM(evt, idx)
Definition: perfmon-ia64.c:54
#define PFMW_PEVT_EVTCOUNT(evt)
Definition: perfmon-ia64.c:47
char * name
Definition: iozone.c:23648
int
Definition: iozone.c:18528
#define PAPI_NATIVE_AND_MASK
long j
Definition: iozone.c:19135
static int _pfm_decode_native_event(unsigned int EventCode, unsigned int *event, unsigned int *umask)

Here is the call graph for this function:

Here is the caller graph for this function:

int _ia64_ntv_code_to_descr ( unsigned int  EventCode,
char *  ntv_descr,
int  len 
)

Definition at line 2810 of file perfmon-ia64.c.

2811 {
2812  if ( _perfmon2_pfm_pmu_type == PFMLIB_MONTECITO_PMU )
2813  return ( _papi_pfm_ntv_code_to_descr( EventCode, ntv_descr, len ) );
2814  else {
2815 #if defined(HAVE_PFM_GET_EVENT_DESCRIPTION)
2816  pfmw_get_event_description( EventCode ^ PAPI_NATIVE_MASK, ntv_descr,
2817  len );
2818  return ( PAPI_OK );
2819 #else
2820  return ( _ia64_ntv_code_to_name( EventCode, ntv_descr, len ) );
2821 #endif
2822  }
2823 }
#define PAPI_NATIVE_MASK
static void pfmw_get_event_description(unsigned int idx, char *dest, int len)
Definition: perfmon-ia64.c:393
int _papi_pfm_ntv_code_to_descr(unsigned int EventCode, char *ntv_descr, int len)
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
return PAPI_OK
Definition: linux-nvml.c:458
int _ia64_ntv_code_to_name(unsigned int EventCode, char *ntv_name, int len)

Here is the call graph for this function:

int _ia64_ntv_code_to_name ( unsigned int  EventCode,
char *  ntv_name,
int  len 
)

Definition at line 2791 of file perfmon-ia64.c.

2792 {
2793  if ( _perfmon2_pfm_pmu_type == PFMLIB_MONTECITO_PMU )
2794  return ( _papi_pfm_ntv_code_to_name( EventCode, ntv_name, len ) );
2795  else {
2796  char name[PAPI_MAX_STR_LEN];
2797  int ret = 0;
2798 
2799  pfmw_get_event_name( name, EventCode ^ PAPI_NATIVE_MASK );
2800 
2801  if ( ret != PAPI_OK )
2802  return ( PAPI_ENOEVNT );
2803 
2804  strncpy( ntv_name, name, len );
2805  return ( PAPI_OK );
2806  }
2807 }
#define PAPI_NATIVE_MASK
#define PAPI_MAX_STR_LEN
Definition: fpapi.h:43
#define PAPI_ENOEVNT
Definition: fpapi.h:112
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
return PAPI_OK
Definition: linux-nvml.c:458
int _papi_pfm_ntv_code_to_name(unsigned int EventCode, char *ntv_name, int len)
long long ret
Definition: iozone.c:1346
char * name
Definition: iozone.c:23648
static int pfmw_get_event_name(char *name, unsigned int idx)
Definition: perfmon-ia64.c:379

Here is the call graph for this function:

Here is the caller graph for this function:

int _ia64_ntv_enum_events ( unsigned int EventCode,
int  modifier 
)

Definition at line 2845 of file perfmon-ia64.c.

2846 {
2847  if ( _perfmon2_pfm_pmu_type == PFMLIB_MONTECITO_PMU )
2848  return ( _papi_pfm_ntv_enum_events( EventCode, modifier ) );
2849  else {
2850  int index = *EventCode & PAPI_NATIVE_AND_MASK;
2851 
2852  if ( modifier == PAPI_ENUM_FIRST ) {
2853  *EventCode = PAPI_NATIVE_MASK;
2854  return ( PAPI_OK );
2855  }
2856 
2857  while ( index++ < _ia64_vector.cmp_info.num_native_events - 1 ) {
2858  *EventCode += 1;
2859  if ( _ia64_modify_event
2860  ( ( *EventCode ^ PAPI_NATIVE_MASK ), modifier ) )
2861  return ( PAPI_OK );
2862  }
2863  return ( PAPI_ENOEVNT );
2864  }
2865 }
#define PAPI_NATIVE_MASK
#define PAPI_ENOEVNT
Definition: fpapi.h:112
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
int _papi_pfm_ntv_enum_events(unsigned int *EventCode, int modifier)
static int _ia64_modify_event(unsigned int event, int modifier)
#define PAPI_NATIVE_AND_MASK

Here is the call graph for this function:

int _ia64_read ( hwd_context_t ctx,
hwd_control_state_t machdep,
long long **  events,
int  flags 
)

Definition at line 1972 of file perfmon-ia64.c.

1974 {
1975  switch ( _perfmon2_pfm_pmu_type ) {
1976  case PFMLIB_ITANIUM_PMU:
1977  return ( _ia64_ita_read( ctx, machdep, events, flags ) );
1978  break;
1979  case PFMLIB_ITANIUM2_PMU:
1980  return ( _ia64_ita23_read( ctx, machdep, events, flags ) );
1981  break;
1982  case PFMLIB_MONTECITO_PMU:
1983  return ( _ia64_ita23_read( ctx, machdep, events, flags ) );
1984  break;
1985  default:
1986  PAPIERROR( "PMU type %d is not supported by this component",
1988  return ( PAPI_EBUG );
1989  }
1990 }
long long flags
Definition: iozone.c:12330
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
void PAPIERROR(char *format,...)
char events[MAX_EVENTS][BUFSIZ]
int _ia64_ita23_read(hwd_context_t *ctx, hwd_control_state_t *machdep, long long **events, int flags)
#define PAPI_EBUG
Definition: fpapi.h:111
int _ia64_ita_read(hwd_context_t *ctx, hwd_control_state_t *machdep, long long **events, int flags)

Here is the call graph for this function:

void _ia64_remove_native ( hwd_control_state_t this_state,
NativeInfo_t nativeInfo 
)

Definition at line 2952 of file perfmon-ia64.c.

2954 {
2955  ( void ) this_state; /*unused */
2956  ( void ) nativeInfo; /*unused */
2957  return;
2958 }
void
Definition: iozone.c:18627
int _ia64_reset ( hwd_context_t ctx,
hwd_control_state_t machdep 
)

Definition at line 2149 of file perfmon-ia64.c.

2150 {
2151  pfmw_param_t *pevt = &( machdep->evt );
2152  pfarg_reg_t writeem[MAX_COUNTERS];
2153  int i;
2154 
2155  pfmw_stop( ctx );
2156  memset( writeem, 0, sizeof writeem );
2157  for ( i = 0; i < _ia64_vector.cmp_info.num_cntrs; i++ ) {
2158  /* Writing doesn't matter, we're just zeroing the counter. */
2159  writeem[i].reg_num = PMU_FIRST_COUNTER + i;
2160  if ( PFMW_PEVT_PFPPC_REG_FLG( pevt, i ) & PFM_REGFL_OVFL_NOTIFY )
2161  writeem[i].reg_value = machdep->pd[i].reg_long_reset;
2162  }
2163  if ( pfmw_perfmonctl
2164  ( ctx->tid, ctx->fd, PFM_WRITE_PMDS, writeem,
2165  _ia64_vector.cmp_info.num_cntrs ) == -1 ) {
2166  PAPIERROR( "perfmonctl(PFM_WRITE_PMDS) errno %d", errno );
2167  return PAPI_ESYS;
2168  }
2169  pfmw_start( ctx );
2170  return ( PAPI_OK );
2171 }
memset(eventId, 0, size)
int errno
static void pfmw_stop(hwd_context_t *ctx)
Definition: perfmon-ia64.c:93
static void pfmw_start(hwd_context_t *ctx)
Definition: perfmon-ia64.c:87
#define MAX_COUNTERS
Definition: perfctr-x86.h:8
static int pfmw_perfmonctl(pid_t tid, int fd, int cmd, void *arg, int narg)
Definition: perfmon-ia64.c:99
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
#define PFMW_PEVT_PFPPC_REG_FLG(evt, idx)
Definition: perfmon-ia64.c:56
int i
Definition: fileop.c:140
void PAPIERROR(char *format,...)
#define PMU_FIRST_COUNTER
Definition: perfmon-ia64.h:96
#define PAPI_ESYS
Definition: fpapi.h:108

Here is the call graph for this function:

int _ia64_set_domain ( hwd_control_state_t this_state,
int  domain 
)

Definition at line 1850 of file perfmon-ia64.c.

1851 {
1852  switch ( _perfmon2_pfm_pmu_type ) {
1853  case PFMLIB_ITANIUM_PMU:
1854  return ( _ia64_ita_set_domain( this_state, domain ) );
1855  break;
1856  case PFMLIB_ITANIUM2_PMU:
1857  return ( _ia64_ita2_set_domain( this_state, domain ) );
1858  break;
1859  case PFMLIB_MONTECITO_PMU:
1860  return ( _ia64_mont_set_domain( this_state, domain ) );
1861  break;
1862  default:
1863  PAPIERROR( "PMU type %d is not supported by this component",
1865  return ( PAPI_EBUG );
1866  }
1867 }
int _ia64_mont_set_domain(hwd_control_state_t *this_state, int domain)
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
int _ia64_ita_set_domain(hwd_control_state_t *this_state, int domain)
int _ia64_ita2_set_domain(hwd_control_state_t *this_state, int domain)
void PAPIERROR(char *format,...)
#define PAPI_EBUG
Definition: fpapi.h:111

Here is the call graph for this function:

Here is the caller graph for this function:

int _ia64_set_overflow ( EventSetInfo_t ESI,
int  EventIndex,
int  threshold 
)

Definition at line 2743 of file perfmon-ia64.c.

2744 {
2745  hwd_control_state_t *this_state = ESI->ctl_state;
2746  int j, retval = PAPI_OK, *pos;
2748 
2749  pos = ESI->EventInfoArray[EventIndex].pos;
2750  j = pos[0];
2751  SUBDBG( "Hardware counter %d used in overflow, threshold %d\n", j,
2752  threshold );
2753 
2754  if ( threshold == 0 ) {
2755  /* Remove the signal handler */
2756 
2758  if ( retval != PAPI_OK )
2759  return ( retval );
2760 
2761  /* Remove the overflow notifier on the proper event. */
2762 
2763  set_notify( ESI, EventIndex, 0 );
2764 
2765  this_state->pd[j].reg_value = 0;
2766  this_state->pd[j].reg_long_reset = 0;
2767  this_state->pd[j].reg_short_reset = 0;
2768  } else {
2769  retval =
2771  cidx );
2772  if ( retval != PAPI_OK )
2773  return ( retval );
2774 
2775  /* Set the overflow notifier on the proper event. Remember that selector */
2776 
2777  set_notify( ESI, EventIndex, PFM_REGFL_OVFL_NOTIFY );
2778 
2779  this_state->pd[j].reg_value =
2780  ( ~0UL ) - ( unsigned long ) threshold + 1;
2781  this_state->pd[j].reg_short_reset =
2782  ( ~0UL ) - ( unsigned long ) threshold + 1;
2783  this_state->pd[j].reg_long_reset =
2784  ( ~0UL ) - ( unsigned long ) threshold + 1;
2785 
2786  }
2787  return ( retval );
2788 }
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
static int cidx
Definition: event_info.c:40
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
int _papi_hwi_start_signal(int signal, int need_context, int cidx)
Definition: extras.c:401
int _papi_hwi_stop_signal(int signal)
Definition: extras.c:441
EventInfo_t * EventInfoArray
int threshold
int pos[PAPI_EVENTS_IN_DERIVED_EVENT]
hwd_control_state_t * ctl_state
long j
Definition: iozone.c:19135
ssize_t retval
Definition: libasync.c:338
static int set_notify(EventSetInfo_t *ESI, int index, int value)

Here is the call graph for this function:

int _ia64_set_profile ( EventSetInfo_t ESI,
int  EventIndex,
int  threshold 
)

Definition at line 2715 of file perfmon-ia64.c.

2716 {
2718  hwd_control_state_t *this_state = ESI->ctl_state;
2719  hwd_context_t *ctx = ESI->master->context[cidx];
2720  int ret;
2721 
2722  ret = _ia64_vector.set_overflow( ESI, EventIndex, threshold );
2723  if ( ret != PAPI_OK )
2724  return ret;
2725  ret = pfmw_destroy_context( ctx );
2726  if ( ret != PAPI_OK )
2727  return ret;
2728  if ( threshold == 0 )
2729  ret = pfmw_create_context( ctx );
2730  else
2731  ret =
2732  pfmw_recreate_context( ESI, ctx, &this_state->smpl_vaddr,
2733  EventIndex );
2734 
2735 //#warning "This should be handled in the high level layers"
2736  ESI->state ^= PAPI_OVERFLOWING;
2738 
2739  return ( ret );
2740 }
static int pfmw_recreate_context(EventSetInfo_t *ESI, hwd_context_t *thr_ctx, void **smpl_vaddr, int EventIndex)
Definition: perfmon-ia64.c:281
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
static int pfmw_create_context(hwd_context_t *thr_ctx)
Definition: perfmon-ia64.c:233
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
#define PAPI_OVERFLOWING
Definition: fpapi.h:33
long long ret
Definition: iozone.c:1346
static int pfmw_destroy_context(hwd_context_t *thr_ctx)
Definition: perfmon-ia64.c:106
EventSetOverflowInfo_t overflow
#define PAPI_OVERFLOW_HARDWARE
Definition: papi.h:410
struct _ThreadInfo * master
static int cidx
Definition: event_info.c:40
int threshold
hwd_control_state_t * ctl_state
int(* set_overflow)(EventSetInfo_t *, int, int)
Definition: papi_vector.h:40

Here is the call graph for this function:

int _ia64_shutdown ( hwd_context_t ctx)

Definition at line 2302 of file perfmon-ia64.c.

2303 {
2304 #if defined(USE_PROC_PTTIMER)
2305  close( ctx->stat_fd );
2306 #endif
2307 
2308  return ( pfmw_destroy_context( ctx ) );
2309 }
int close(int fd)
Definition: appio.c:175
static int pfmw_destroy_context(hwd_context_t *thr_ctx)
Definition: perfmon-ia64.c:106

Here is the call graph for this function:

int _ia64_start ( hwd_context_t ctx,
hwd_control_state_t current_state 
)

Definition at line 2174 of file perfmon-ia64.c.

2175 {
2176  int i;
2177  pfmw_param_t *pevt = &( current_state->evt );
2178 
2179  pfmw_stop( ctx );
2180 
2181 /* write PMCS */
2182  if ( pfmw_perfmonctl( ctx->tid, ctx->fd, PFM_WRITE_PMCS,
2183  PFMW_PEVT_PFPPC( pevt ),
2184  PFMW_PEVT_PFPPC_COUNT( pevt ) ) == -1 ) {
2185  PAPIERROR( "perfmonctl(PFM_WRITE_PMCS) errno %d", errno );
2186  return ( PAPI_ESYS );
2187  }
2188  if ( pfmw_perfmonctl
2189  ( ctx->tid, ctx->fd, PFM_WRITE_PMDS, PFMW_PEVT_PFPPD( pevt ),
2190  PFMW_PEVT_EVTCOUNT( pevt ) ) == -1 ) {
2191  PAPIERROR( "perfmonctl(PFM_WRITE_PMDS) errno %d", errno );
2192  return ( PAPI_ESYS );
2193  }
2194 
2195 /* set the initial value of the hardware counter , if PAPI_overflow or
2196  PAPI_profil are called, then the initial value is the threshold
2197 */
2198  for ( i = 0; i < _ia64_vector.cmp_info.num_cntrs; i++ )
2199  current_state->pd[i].reg_num = PMU_FIRST_COUNTER + i;
2200 
2201  if ( pfmw_perfmonctl( ctx->tid, ctx->fd,
2202  PFM_WRITE_PMDS, current_state->pd,
2203  _ia64_vector.cmp_info.num_cntrs ) == -1 ) {
2204  PAPIERROR( "perfmonctl(WRITE_PMDS) errno %d", errno );
2205  return ( PAPI_ESYS );
2206  }
2207 
2208  pfmw_start( ctx );
2209 
2210  return PAPI_OK;
2211 }
int errno
static void pfmw_stop(hwd_context_t *ctx)
Definition: perfmon-ia64.c:93
static void pfmw_start(hwd_context_t *ctx)
Definition: perfmon-ia64.c:87
static int pfmw_perfmonctl(pid_t tid, int fd, int cmd, void *arg, int narg)
Definition: perfmon-ia64.c:99
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
#define PFMW_PEVT_PFPPD(evt)
Definition: perfmon-ia64.c:52
int i
Definition: fileop.c:140
#define PFMW_PEVT_PFPPC(evt)
Definition: perfmon-ia64.c:51
void PAPIERROR(char *format,...)
#define PMU_FIRST_COUNTER
Definition: perfmon-ia64.h:96
#define PAPI_ESYS
Definition: fpapi.h:108
#define PFMW_PEVT_EVTCOUNT(evt)
Definition: perfmon-ia64.c:47
#define PFMW_PEVT_PFPPC_COUNT(evt)
Definition: perfmon-ia64.c:53
if(gettimeofday(&tp,(struct timezone *) NULL)==-1) perror("gettimeofday")

Here is the call graph for this function:

int _ia64_stop ( hwd_context_t ctx,
hwd_control_state_t zero 
)

Definition at line 2214 of file perfmon-ia64.c.

2215 {
2216  ( void ) zero; /*unused */
2217  pfmw_stop( ctx );
2218  return PAPI_OK;
2219 }
static void pfmw_stop(hwd_context_t *ctx)
Definition: perfmon-ia64.c:93
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627

Here is the call graph for this function:

int _ia64_stop_profiling ( ThreadInfo_t thread,
EventSetInfo_t ESI 
)

Definition at line 2705 of file perfmon-ia64.c.

2706 {
2708 
2709  pfmw_stop( thread->context[cidx] );
2710  return ( ia64_process_profile_buffer( thread, ESI ) );
2711 }
static void pfmw_stop(hwd_context_t *ctx)
Definition: perfmon-ia64.c:93
static int ia64_process_profile_buffer(ThreadInfo_t *thread, EventSetInfo_t *ESI)
papi_vector_t _ia64_vector
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
static int cidx
Definition: event_info.c:40
hwd_context_t ** context
Definition: threads.h:28

Here is the call graph for this function:

int _ia64_update_control_state ( hwd_control_state_t this_state,
NativeInfo_t native,
int  count,
hwd_context_t zero 
)

Definition at line 3104 of file perfmon-ia64.c.

3107 {
3108  switch ( _perfmon2_pfm_pmu_type ) {
3109  case PFMLIB_ITANIUM_PMU:
3111  ( this_state, native, count, zero ) );
3112  break;
3113  case PFMLIB_ITANIUM2_PMU:
3115  ( this_state, native, count, zero ) );
3116  break;
3117  case PFMLIB_MONTECITO_PMU:
3119  ( this_state, native, count, zero ) );
3120  break;
3121  default:
3122  PAPIERROR( "PMU type %d is not supported by this component",
3124  return ( PAPI_EBUG );
3125  }
3126 }
int _ia64_mont_update_control_state(hwd_control_state_t *this_state, NativeInfo_t *native, int count, hwd_context_t *zero)
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
int count
Definition: iozone.c:22422
void PAPIERROR(char *format,...)
int _ia64_ita_update_control_state(hwd_control_state_t *this_state, NativeInfo_t *native, int count, hwd_context_t *zero)
#define PAPI_EBUG
Definition: fpapi.h:111

Here is the call graph for this function:

int _papi_pfm_ntv_code_to_descr ( unsigned int  EventCode,
char *  ntv_descr,
int  len 
)

Definition at line 1534 of file perfmon-ia64.c.

1535 {
1536  unsigned int event, umask;
1537  char *eventd, **maskd, *tmp;
1538  int i, ret, total_len = 0;
1539  pfmlib_event_t gete;
1540 
1541  memset( &gete, 0, sizeof ( gete ) );
1542 
1543  if ( _pfm_decode_native_event( EventCode, &event, &umask ) != PAPI_OK )
1544  return ( PAPI_ENOEVNT );
1545 
1546  ret = pfm_get_event_description( event, &eventd );
1547  if ( ret != PFMLIB_SUCCESS ) {
1548  PAPIERROR( "pfm_get_event_description(%d,%p): %s",
1549  event, &eventd, pfm_strerror( ret ) );
1550  return ( PAPI_ENOEVNT );
1551  }
1552 
1553  if ( ( gete.num_masks = prepare_umask( umask, gete.unit_masks ) ) ) {
1554  maskd = ( char ** ) malloc( gete.num_masks * sizeof ( char * ) );
1555  if ( maskd == NULL ) {
1556  free( eventd );
1557  return ( PAPI_ENOMEM );
1558  }
1559  for ( i = 0; i < ( int ) gete.num_masks; i++ ) {
1560  ret =
1561  pfm_get_event_mask_description( event, gete.unit_masks[i],
1562  &maskd[i] );
1563  if ( ret != PFMLIB_SUCCESS ) {
1564  PAPIERROR( "pfm_get_event_mask_description(%d,%d,%p): %s",
1565  event, umask, &maskd, pfm_strerror( ret ) );
1566  free( eventd );
1567  for ( ; i >= 0; i-- )
1568  free( maskd[i] );
1569  free( maskd );
1570  return ( PAPI_EINVAL );
1571  }
1572  total_len += strlen( maskd[i] );
1573  }
1574  tmp =
1575  ( char * ) malloc( strlen( eventd ) + strlen( ", masks:" ) +
1576  total_len + gete.num_masks + 1 );
1577  if ( tmp == NULL ) {
1578  for ( i = gete.num_masks - 1; i >= 0; i-- )
1579  free( maskd[i] );
1580  free( maskd );
1581  free( eventd );
1582  }
1583  tmp[0] = '\0';
1584  strcat( tmp, eventd );
1585  strcat( tmp, ", masks:" );
1586  for ( i = 0; i < ( int ) gete.num_masks; i++ ) {
1587  if ( i != 0 )
1588  strcat( tmp, "," );
1589  strcat( tmp, maskd[i] );
1590  free( maskd[i] );
1591  }
1592  free( maskd );
1593  } else {
1594  tmp = ( char * ) malloc( strlen( eventd ) + 1 );
1595  if ( tmp == NULL ) {
1596  free( eventd );
1597  return ( PAPI_ENOMEM );
1598  }
1599  tmp[0] = '\0';
1600  strcat( tmp, eventd );
1601  free( eventd );
1602  }
1603  strncpy( ntv_descr, tmp, len );
1604  if ( strlen( tmp ) > ( unsigned int ) len - 1 )
1605  ret = PAPI_EBUF;
1606  else
1607  ret = PAPI_OK;
1608  free( tmp );
1609  return ( ret );
1610 }
memset(eventId, 0, size)
static int prepare_umask(unsigned int foo, unsigned int *values)
#define PAPI_ENOMEM
Definition: fpapi.h:107
#define PAPI_ENOEVNT
Definition: fpapi.h:112
device[deviceId] domain[domainId] event
Definition: linux-cuda.c:306
return PAPI_OK
Definition: linux-nvml.c:458
return PAPI_EINVAL
Definition: linux-nvml.c:408
long long ret
Definition: iozone.c:1346
int i
Definition: fileop.c:140
free(dummyfile[xx])
void PAPIERROR(char *format,...)
strcat(command, mountname)
again struct sockaddr sizeof(struct sockaddr_in))
int
Definition: iozone.c:18528
#define PAPI_EBUF
Definition: fpapi.h:125
long long tmp
Definition: iozone.c:12031
static int _pfm_decode_native_event(unsigned int EventCode, unsigned int *event, unsigned int *umask)

Here is the call graph for this function:

Here is the caller graph for this function:

int _papi_pfm_ntv_code_to_name ( unsigned int  EventCode,
char *  ntv_name,
int  len 
)

Definition at line 1502 of file perfmon-ia64.c.

1503 {
1504  int ret;
1505  unsigned int event, umask;
1506  pfmlib_event_t gete;
1507 
1508  memset( &gete, 0, sizeof ( gete ) );
1509 
1510  if ( _pfm_decode_native_event( EventCode, &event, &umask ) != PAPI_OK )
1511  return ( PAPI_ENOEVNT );
1512 
1513  gete.event = event;
1514  gete.num_masks = prepare_umask( umask, gete.unit_masks );
1515  if ( gete.num_masks == 0 )
1516  ret = pfm_get_event_name( gete.event, ntv_name, len );
1517  else
1518  ret = pfm_get_full_event_name( &gete, ntv_name, len );
1519  if ( ret != PFMLIB_SUCCESS ) {
1520  char tmp[PAPI_2MAX_STR_LEN];
1521  pfm_get_event_name( gete.event, tmp, sizeof ( tmp ) );
1522  PAPIERROR
1523  ( "pfm_get_full_event_name(%p(event %d,%s,%d masks),%p,%d): %d -- %s",
1524  &gete, gete.event, tmp, gete.num_masks, ntv_name, len, ret,
1525  pfm_strerror( ret ) );
1526  if ( ret == PFMLIB_ERR_FULL )
1527  return PAPI_EBUF;
1528  return PAPI_ECMP;
1529  }
1530  return PAPI_OK;
1531 }
memset(eventId, 0, size)
static int prepare_umask(unsigned int foo, unsigned int *values)
#define PAPI_ENOEVNT
Definition: fpapi.h:112
device[deviceId] domain[domainId] event
Definition: linux-cuda.c:306
return PAPI_OK
Definition: linux-nvml.c:458
long long ret
Definition: iozone.c:1346
#define PAPI_2MAX_STR_LEN
Definition: papi.h:464
#define PAPI_ECMP
Definition: fpapi.h:109
void PAPIERROR(char *format,...)
again struct sockaddr sizeof(struct sockaddr_in))
#define PAPI_EBUF
Definition: fpapi.h:125
long long tmp
Definition: iozone.c:12031
static int _pfm_decode_native_event(unsigned int EventCode, unsigned int *event, unsigned int *umask)

Here is the call graph for this function:

Here is the caller graph for this function:

int _papi_pfm_ntv_enum_events ( unsigned int EventCode,
int  modifier 
)

Definition at line 1402 of file perfmon-ia64.c.

1403 {
1404  unsigned int event, umask, num_masks;
1405  int ret;
1406 
1407  if ( modifier == PAPI_ENUM_FIRST ) {
1408  *EventCode = PAPI_NATIVE_MASK; /* assumes first native event is always 0x4000000 */
1409  return ( PAPI_OK );
1410  }
1411 
1412  if ( _pfm_decode_native_event( *EventCode, &event, &umask ) != PAPI_OK )
1413  return ( PAPI_ENOEVNT );
1414 
1415  ret = pfm_get_num_event_masks( event, &num_masks );
1416  SUBDBG( "pfm_get_num_event_masks: event=%d num_masks=%d\n", event,
1417  num_masks );
1418  if ( ret != PFMLIB_SUCCESS ) {
1419  PAPIERROR( "pfm_get_num_event_masks(%d,%p): %s", event, &num_masks,
1420  pfm_strerror( ret ) );
1421  return ( PAPI_ENOEVNT );
1422  }
1423  if ( num_masks > PAPI_NATIVE_UMASK_MAX )
1424  num_masks = PAPI_NATIVE_UMASK_MAX;
1425  SUBDBG( "This is umask %d of %d\n", umask, num_masks );
1426 
1427  if ( modifier == PAPI_ENUM_EVENTS ) {
1428  if ( event < ( unsigned int ) _ia64_vector.cmp_info.num_native_events - 1 ) {
1429  *EventCode = encode_native_event_raw( event + 1, 0 );
1430  return ( PAPI_OK );
1431  }
1432  return ( PAPI_ENOEVNT );
1433  } else if ( modifier == PAPI_NTV_ENUM_UMASK_COMBOS ) {
1434  if ( umask + 1 < ( unsigned ) ( 1 << num_masks ) ) {
1435  *EventCode = encode_native_event_raw( event, umask + 1 );
1436  return ( PAPI_OK );
1437  }
1438  return ( PAPI_ENOEVNT );
1439  } else if ( modifier == PAPI_NTV_ENUM_UMASKS ) {
1440  int thisbit = ffs( umask );
1441 
1442  SUBDBG( "First bit is %d in %08x\b\n", thisbit - 1, umask );
1443  thisbit = 1 << thisbit;
1444 
1445  if ( thisbit & ( ( 1 << num_masks ) - 1 ) ) {
1446  *EventCode = encode_native_event_raw( event, thisbit );
1447  return ( PAPI_OK );
1448  }
1449  return ( PAPI_ENOEVNT );
1450  } else {
1451  while ( event++ <
1452  ( unsigned int ) _ia64_vector.cmp_info.num_native_events - 1 ) {
1453  *EventCode = encode_native_event_raw( event + 1, 0 );
1454  if ( _ia64_modify_event( event + 1, modifier ) )
1455  return ( PAPI_OK );
1456  }
1457  return ( PAPI_ENOEVNT );
1458  }
1459 }
#define PAPI_NATIVE_MASK
#define PAPI_ENOEVNT
Definition: fpapi.h:112
device[deviceId] domain[domainId] event
Definition: linux-cuda.c:306
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
long long ret
Definition: iozone.c:1346
unsigned int PAPI_NATIVE_UMASK_MAX
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
void PAPIERROR(char *format,...)
static int encode_native_event_raw(unsigned int event, unsigned int mask)
static int _ia64_modify_event(unsigned int event, int modifier)
static int _pfm_decode_native_event(unsigned int EventCode, unsigned int *event, unsigned int *umask)

Here is the call graph for this function:

Here is the caller graph for this function:

static int _papi_pfm_ntv_name_to_code ( char *  name,
unsigned int event_code 
)
static

Definition at line 1462 of file perfmon-ia64.c.

1463 {
1464  pfmlib_event_t event;
1465  unsigned int i, mask = 0;
1466  int ret;
1467 
1468  SUBDBG( "pfm_find_full_event(%s,%p)\n", name, &event );
1469  ret = pfm_find_full_event( name, &event );
1470  if ( ret == PFMLIB_SUCCESS ) {
1471  /* we can only capture PAPI_NATIVE_UMASK_MAX or fewer masks */
1472  if ( event.num_masks > PAPI_NATIVE_UMASK_MAX ) {
1473  SUBDBG( "num_masks (%d) > max masks (%d)\n", event.num_masks,
1475  return ( PAPI_ENOEVNT );
1476  } else {
1477  /* no mask index can exceed PAPI_NATIVE_UMASK_MAX */
1478  for ( i = 0; i < event.num_masks; i++ ) {
1479  if ( event.unit_masks[i] > PAPI_NATIVE_UMASK_MAX ) {
1480  SUBDBG( "mask index (%d) > max masks (%d)\n",
1481  event.unit_masks[i], PAPI_NATIVE_UMASK_MAX );
1482  return ( PAPI_ENOEVNT );
1483  }
1484  mask |= 1 << event.unit_masks[i];
1485  }
1486  *event_code = encode_native_event_raw( event.event, mask );
1487  SUBDBG( "event_code: %#x event: %d num_masks: %d\n", *event_code,
1488  event.event, event.num_masks );
1489  return ( PAPI_OK );
1490  }
1491  } else if ( ret == PFMLIB_ERR_UMASK ) {
1492  ret = pfm_find_event( name, &event.event );
1493  if ( ret == PFMLIB_SUCCESS ) {
1494  *event_code = encode_native_event_raw( event.event, 0 );
1495  return ( PAPI_OK );
1496  }
1497  }
1498  return ( PAPI_ENOEVNT );
1499 }
#define PAPI_ENOEVNT
Definition: fpapi.h:112
device[deviceId] domain[domainId] event
Definition: linux-cuda.c:306
return PAPI_OK
Definition: linux-nvml.c:458
long long ret
Definition: iozone.c:1346
unsigned int PAPI_NATIVE_UMASK_MAX
int i
Definition: fileop.c:140
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
static int encode_native_event_raw(unsigned int event, unsigned int mask)
char * name
Definition: iozone.c:23648

Here is the call graph for this function:

Here is the caller graph for this function:

static int _pfm_decode_native_event ( unsigned int  EventCode,
unsigned int event,
unsigned int umask 
)
static

Definition at line 1352 of file perfmon-ia64.c.

1354 {
1355  unsigned int tevent, major, minor;
1356 
1357  tevent = EventCode & PAPI_NATIVE_AND_MASK;
1358  major = ( tevent & PAPI_NATIVE_EVENT_AND_MASK ) >> PAPI_NATIVE_EVENT_SHIFT;
1359  if ( major >= ( unsigned int ) _ia64_vector.cmp_info.num_native_events )
1360  return ( PAPI_ENOEVNT );
1361 
1362  minor = ( tevent & PAPI_NATIVE_UMASK_AND_MASK ) >> PAPI_NATIVE_UMASK_SHIFT;
1363  *event = major;
1364  *umask = minor;
1365  SUBDBG( "EventCode %#08x is event %d, umask %#x\n", EventCode, major,
1366  minor );
1367  return ( PAPI_OK );
1368 }
#define PAPI_ENOEVNT
Definition: fpapi.h:112
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
unsigned int PAPI_NATIVE_UMASK_SHIFT
unsigned int PAPI_NATIVE_EVENT_AND_MASK
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
unsigned int PAPI_NATIVE_UMASK_AND_MASK
#define PAPI_NATIVE_AND_MASK
unsigned int PAPI_NATIVE_EVENT_SHIFT

Here is the caller graph for this function:

static void check_ibrp_events ( hwd_control_state_t current_state)
static

Definition at line 505 of file perfmon-ia64.c.

506 {
507  ia64_control_state_t *this_state = ( ia64_control_state_t * ) current_state;
508  pfmw_param_t *evt = &( this_state->evt );
509  unsigned long umasks_retired[4];
510  unsigned long umask;
511  unsigned int j, i, seen_retired, ibrp, idx;
512  int code;
513  int retired_code, incr;
514  pfmlib_ita2_output_param_t *ita2_output_param;
515  pfmlib_mont_output_param_t *mont_output_param;
516 
517 #if defined(PFMLIB_ITANIUM2_PMU) || defined(PFMLIB_MONTECITO_PMU)
518 char *retired_events[] = {
519  "IA64_TAGGED_INST_RETIRED_IBRP0_PMC8",
520  "IA64_TAGGED_INST_RETIRED_IBRP1_PMC9",
521  "IA64_TAGGED_INST_RETIRED_IBRP2_PMC8",
522  "IA64_TAGGED_INST_RETIRED_IBRP3_PMC9",
523  NULL
524 };
525 #endif
526 
527  switch ( _perfmon2_pfm_pmu_type ) {
528  case PFMLIB_ITANIUM2_PMU:
529  ita2_output_param =
530  &( this_state->ita_lib_param.ita2_param.ita2_output_param );
531  /*
532  * in fine mode, it is enough to use the event
533  * which only monitors the first debug register
534  * pair. The two pairs making up the range
535  * are guaranteed to be consecutive in rr_br[].
536  */
537  incr = pfm_ita2_irange_is_fine( &evt->outp, ita2_output_param ) ? 4 : 2;
538 
539  for ( i = 0; retired_events[i]; i++ ) {
540  pfm_find_event( retired_events[i], &idx );
541  pfm_ita2_get_event_umask( idx, umasks_retired + i );
542  }
543 
544  pfm_get_event_code( idx, &retired_code );
545 
546  /*
547  * print a warning message when the using IA64_TAGGED_INST_RETIRED_IBRP* which does
548  * not completely cover the all the debug register pairs used to make up the range.
549  * This could otherwise lead to misinterpretation of the results.
550  */
551  for ( i = 0; i < ita2_output_param->pfp_ita2_irange.rr_nbr_used;
552  i += incr ) {
553 
554  ibrp = ita2_output_param->pfp_ita2_irange.rr_br[i].reg_num >> 1;
555 
556  seen_retired = 0;
557  for ( j = 0; j < evt->inp.pfp_event_count; j++ ) {
558  pfm_get_event_code( evt->inp.pfp_events[j].event, &code );
559  if ( code != retired_code )
560  continue;
561  seen_retired = 1;
562  pfm_ita2_get_event_umask( evt->inp.pfp_events[j].event,
563  &umask );
564  if ( umask == umasks_retired[ibrp] )
565  break;
566  }
567  if ( seen_retired && j == evt->inp.pfp_event_count )
568  printf
569  ( "warning: code range uses IBR pair %d which is not monitored using %s\n",
570  ibrp, retired_events[ibrp] );
571  }
572 
573  break;
574  case PFMLIB_MONTECITO_PMU:
575  mont_output_param =
576  &( this_state->ita_lib_param.mont_param.mont_output_param );
577  /*
578  * in fine mode, it is enough to use the event
579  * which only monitors the first debug register
580  * pair. The two pairs making up the range
581  * are guaranteed to be consecutive in rr_br[].
582  */
583  incr = pfm_mont_irange_is_fine( &evt->outp, mont_output_param ) ? 4 : 2;
584 
585  for ( i = 0; retired_events[i]; i++ ) {
586  pfm_find_event( retired_events[i], &idx );
587  pfm_mont_get_event_umask( idx, umasks_retired + i );
588  }
589 
590  pfm_get_event_code( idx, &retired_code );
591 
592  /*
593  * print a warning message when the using IA64_TAGGED_INST_RETIRED_IBRP* which does
594  * not completely cover the all the debug register pairs used to make up the range.
595  * This could otherwise lead to misinterpretation of the results.
596  */
597  for ( i = 0; i < mont_output_param->pfp_mont_irange.rr_nbr_used;
598  i += incr ) {
599 
600  ibrp = mont_output_param->pfp_mont_irange.rr_br[i].reg_num >> 1;
601 
602  seen_retired = 0;
603  for ( j = 0; j < evt->inp.pfp_event_count; j++ ) {
604  pfm_get_event_code( evt->inp.pfp_events[j].event, &code );
605  if ( code != retired_code )
606  continue;
607  seen_retired = 1;
608  pfm_mont_get_event_umask( evt->inp.pfp_events[j].event,
609  &umask );
610  if ( umask == umasks_retired[ibrp] )
611  break;
612  }
613  if ( seen_retired && j == evt->inp.pfp_event_count )
614  printf
615  ( "warning: code range uses IBR pair %d which is not monitored using %s\n",
616  ibrp, retired_events[ibrp] );
617  }
618  break;
619  default:
620  PAPIERROR( "PMU type %d is not supported by this component",
622  }
623 }
pfmlib_input_param_t inp
Definition: perfmon-ia64.h:73
pfmw_ita_param_t ita_lib_param
Definition: perfmon-ia64.h:114
pfmlib_output_param_t outp
Definition: perfmon-ia64.h:74
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
int incr
Definition: fileop.c:82
#define printf
Definition: papi_test.h:125
int i
Definition: fileop.c:140
pfmw_ita2_param_t ita2_param
Definition: perfmon-ia64.h:101
void PAPIERROR(char *format,...)
pfmlib_ita2_output_param_t ita2_output_param
Definition: perfmon-ia64.h:89
pfmlib_mont_output_param_t mont_output_param
Definition: perfmon-ia64.h:82
pfmw_mont_param_t mont_param
Definition: perfmon-ia64.h:102
long j
Definition: iozone.c:19135

Here is the call graph for this function:

Here is the caller graph for this function:

static int encode_native_event_raw ( unsigned int  event,
unsigned int  mask 
)
static

Definition at line 1374 of file perfmon-ia64.c.

1375 {
1376  unsigned int tmp = event << PAPI_NATIVE_EVENT_SHIFT;
1377  SUBDBG( "Old native index was %#08x with %#08x mask\n", tmp, mask );
1378  tmp = tmp | ( mask << PAPI_NATIVE_UMASK_SHIFT );
1379  SUBDBG( "New encoding is %#08x\n", tmp | PAPI_NATIVE_MASK );
1380  return ( tmp | PAPI_NATIVE_MASK );
1381 }
#define PAPI_NATIVE_MASK
unsigned int PAPI_NATIVE_UMASK_SHIFT
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
unsigned int PAPI_NATIVE_EVENT_SHIFT
long long tmp
Definition: iozone.c:12031

Here is the caller graph for this function:

int generate_preset_search_map ( hwi_search_t **  maploc,
itanium_preset_search_t oldmap,
int  num_cnt 
)

Definition at line 1629 of file perfmon-ia64.c.

1631 {
1632  ( void ) num_cnt; /*unused */
1633  int pnum, i = 0, cnt;
1634  char **findme;
1635  hwi_search_t *psmap;
1636 
1637  /* Count up the presets */
1638  while ( oldmap[i].preset )
1639  i++;
1640  /* Add null entry */
1641  i++;
1642 
1643  psmap = ( hwi_search_t * ) papi_malloc( i * sizeof ( hwi_search_t ) );
1644  if ( psmap == NULL )
1645  return ( PAPI_ENOMEM );
1646  memset( psmap, 0x0, i * sizeof ( hwi_search_t ) );
1647 
1648  pnum = 0; /* preset event counter */
1649  for ( i = 0; i <= PAPI_MAX_PRESET_EVENTS; i++ ) {
1650  if ( oldmap[i].preset == 0 )
1651  break;
1652  pnum++;
1653  psmap[i].event_code = oldmap[i].preset;
1654  psmap[i].data.derived = oldmap[i].derived;
1655  strcpy( psmap[i].data.operation, oldmap[i].operation );
1656  findme = oldmap[i].findme;
1657  cnt = 0;
1658  while ( *findme != NULL ) {
1659  if ( cnt == MAX_COUNTER_TERMS ) {
1660  PAPIERROR( "Count (%d) == MAX_COUNTER_TERMS (%d)\n", cnt,
1662  papi_free( psmap );
1663  return ( PAPI_EBUG );
1664  }
1665  if ( _perfmon2_pfm_pmu_type == PFMLIB_MONTECITO_PMU ) {
1667  ( *findme,
1668  ( unsigned int * ) &psmap[i].data.native[cnt] ) !=
1669  PAPI_OK ) {
1670  PAPIERROR( "_papi_pfm_ntv_name_to_code(%s) failed\n",
1671  *findme );
1672  papi_free( psmap );
1673  return ( PAPI_EBUG );
1674  } else
1675  psmap[i].data.native[cnt] ^= PAPI_NATIVE_MASK;
1676  } else {
1677  if ( pfm_find_event_byname
1678  ( *findme,
1679  ( unsigned int * ) &psmap[i].data.native[cnt] ) !=
1680  PFMLIB_SUCCESS ) {
1681  PAPIERROR( "pfm_find_event_byname(%s) failed\n", *findme );
1682  papi_free( psmap );
1683  return ( PAPI_EBUG );
1684  } else
1685  psmap[i].data.native[cnt] ^= PAPI_NATIVE_MASK;
1686  }
1687 
1688  findme++;
1689  cnt++;
1690  }
1691  psmap[i].data.native[cnt] = PAPI_NULL;
1692  }
1693 
1694  *maploc = psmap;
1695  return ( PAPI_OK );
1696 }
memset(eventId, 0, size)
#define PAPI_NATIVE_MASK
#define PAPI_ENOMEM
Definition: fpapi.h:107
#define PAPI_NULL
Definition: fpapi.h:13
#define papi_free(a)
Definition: papi_memory.h:35
unsigned int event_code
Definition: papi_preset.h:14
#define papi_malloc(a)
Definition: papi_memory.h:34
char operation[MAX_COUNTERS *5]
Definition: perfmon-ia64.h:136
static int _papi_pfm_ntv_name_to_code(char *name, unsigned int *event_code)
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
return PAPI_OK
Definition: linux-nvml.c:458
static int preset
Definition: event_info.c:38
void
Definition: iozone.c:18627
int i
Definition: fileop.c:140
int native[PAPI_EVENTS_IN_DERIVED_EVENT]
Definition: papi_preset.h:16
#define MAX_COUNTER_TERMS
Definition: aix.h:44
void PAPIERROR(char *format,...)
char operation[PAPI_2MAX_STR_LEN]
Definition: papi_preset.h:17
char * findme[MAX_COUNTERS]
Definition: perfmon-ia64.h:135
strcpy(filename, default_filename)
#define PAPI_MAX_PRESET_EVENTS
Definition: fpapi.h:16
#define PAPI_EBUG
Definition: fpapi.h:111

Here is the call graph for this function:

Here is the caller graph for this function:

static void ia64_dispatch_sigprof ( int  n,
hwd_siginfo_t info,
hwd_ucontext_t sc 
)
static

Definition at line 2578 of file perfmon-ia64.c.

2579 {
2580  ( void ) n; /*unused */
2581  _papi_hwi_context_t ctx;
2583  caddr_t address;
2585 
2586 #if defined(DEBUG)
2587  if ( thread == NULL ) {
2588  PAPIERROR( "thread == NULL in _papi_hwd_dispatch_timer!" );
2589  return;
2590  }
2591 #endif
2592 
2593  ctx.si = info;
2594  ctx.ucontext = sc;
2595  address = GET_OVERFLOW_ADDRESS( ( ctx ) );
2596 
2597  if ( ( thread == NULL ) || ( thread->running_eventset[cidx] == NULL ) ) {
2598  SUBDBG( "%p, %p\n", thread, thread->running_eventset[cidx] );
2599  return;
2600  }
2601 
2602  if ( thread->running_eventset[cidx]->overflow.
2604  _papi_hwi_dispatch_overflow_signal( ( void * ) &ctx, address, NULL, 0,
2605  0, &thread, cidx );
2606  return;
2607  }
2608 
2609  pfm_msg_t msg;
2610  int ret, fd;
2611  fd = info->si_fd;
2612  retry:
2613  ret = read( fd, &msg, sizeof ( msg ) );
2614  if ( ret == -1 ) {
2615  if ( errno == EINTR ) {
2616  SUBDBG( "read(%d) interrupted, retrying\n", fd );
2617  goto retry;
2618  } else {
2619  PAPIERROR( "read(%d): errno %d", fd, errno );
2620  }
2621  } else if ( ret != sizeof ( msg ) ) {
2622  PAPIERROR( "read(%d): short %d vs. %d bytes", fd, ret, sizeof ( msg ) );
2623  ret = -1;
2624  }
2625 #if defined(HAVE_PFM_MSG_TYPE)
2626  if ( msg.type == PFM_MSG_END ) {
2627  SUBDBG( "PFM_MSG_END\n" );
2628  return;
2629  }
2630  if ( msg.type != PFM_MSG_OVFL ) {
2631  PAPIERROR( "unexpected msg type %d", msg.type );
2632  return;
2633  }
2634 #else
2635  if ( msg.pfm_gen_msg.msg_type == PFM_MSG_END ) {
2636  SUBDBG( "PFM_MSG_END\n" );
2637  return;
2638  }
2639  if ( msg.pfm_gen_msg.msg_type != PFM_MSG_OVFL ) {
2640  PAPIERROR( "unexpected msg type %d", msg.pfm_gen_msg.msg_type );
2641  return;
2642  }
2643 #endif
2644  if ( ret != -1 ) {
2645  if ( ( thread->running_eventset[cidx]->state & PAPI_PROFILING ) &&
2646  !( thread->running_eventset[cidx]->profile.
2649  thread->running_eventset[cidx] );
2650  else
2651  _papi_hwi_dispatch_overflow_signal( ( void * ) &ctx, address,
2652  NULL,
2653  msg.pfm_ovfl_msg.
2654  msg_ovfl_pmds[0] >>
2655  PMU_FIRST_COUNTER, 0,
2656  &thread, cidx );
2657  }
2658  if ( pfmw_perfmonctl( 0, fd, PFM_RESTART, 0, 0 ) == -1 ) {
2659  PAPIERROR( "perfmonctl(PFM_RESTART) errno %d, %s", errno,
2660  strerror( errno ) );
2661  return;
2662  }
2663 }
ssize_t read(int fd, void *buf, size_t count)
Definition: appio.c:225
int errno
long long flags
Definition: iozone.c:12330
static int ia64_process_profile_buffer(ThreadInfo_t *thread, EventSetInfo_t *ESI)
int fd
Definition: iozone.c:1291
static int pfmw_perfmonctl(pid_t tid, int fd, int cmd, void *arg, int narg)
Definition: perfmon-ia64.c:99
papi_vector_t _ia64_vector
void
Definition: iozone.c:18627
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
#define PAPI_PROFILING
Definition: fpapi.h:34
long long ret
Definition: iozone.c:1346
EventSetOverflowInfo_t overflow
static int cidx
Definition: event_info.c:40
hwd_ucontext_t * ucontext
void * thread(void *arg)
Definition: kufrin.c:31
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
void PAPIERROR(char *format,...)
#define PMU_FIRST_COUNTER
Definition: perfmon-ia64.h:96
#define PAPI_OVERFLOW_FORCE_SW
Definition: papi.h:409
EventSetInfo_t ** running_eventset
Definition: threads.h:30
inline_static ThreadInfo_t * _papi_hwi_lookup_thread(int custom_tid)
Definition: threads.h:92
#define PAPI_PROFIL_FORCE_SW
Definition: papi.h:401
hwd_siginfo_t * si
int _papi_hwi_dispatch_overflow_signal(void *papiContext, caddr_t address, int *isHardware, long long overflow_bit, int genOverflowBit, ThreadInfo_t **t, int cidx)
Definition: extras.c:214
EventSetProfileInfo_t profile
#define GET_OVERFLOW_ADDRESS(ctx)
Definition: aix-context.h:12
int n
Definition: mendes-alt.c:164

Here is the call graph for this function:

Here is the caller graph for this function:

static int ia64_ita2_process_profile_buffer ( ThreadInfo_t thread,
EventSetInfo_t ESI 
)
static

Definition at line 2393 of file perfmon-ia64.c.

2394 {
2395  ( void ) thread; /*unused */
2396  pfmw_smpl_hdr_t *hdr;
2397  pfmw_smpl_entry_t *ent;
2398  unsigned long buf_pos;
2399  unsigned long entry_size;
2400  int ret, reg_num, count, pos;
2401  unsigned int i, EventCode = 0, eventindex, native_index = 0;
2402  ia64_control_state_t *this_state;
2403  pfm_ita2_pmd_reg_t *reg;
2404  unsigned long overflow_vector, pc;
2405 
2406 
2407  if ( ( ESI->state & PAPI_PROFILING ) == 0 )
2408  return ( PAPI_EBUG );
2409 
2410  this_state = ( ia64_control_state_t * ) ( ESI->ctl_state );
2411  hdr = ( pfmw_smpl_hdr_t * ) ( this_state->smpl_vaddr );
2412 
2413  entry_size = sizeof ( pfmw_smpl_entry_t );
2414 
2415  /*
2416  * walk through all the entries recorded in the buffer
2417  */
2418  buf_pos = ( unsigned long ) ( hdr + 1 );
2419  for ( i = 0; i < hdr->hdr_count; i++ ) {
2420  ret = 0;
2421  ent = ( pfmw_smpl_entry_t * ) buf_pos;
2422  /* PFM30 only one PMD overflows in each sample */
2423  overflow_vector = 1 << ent->ovfl_pmd;
2424 
2425  SUBDBG( "Entry %d PID:%d CPU:%d ovfl_vector:%#lx IIP:%#016lx\n",
2426  i, ent->pid, ent->cpu, overflow_vector, ent->ip );
2427 
2428  while ( overflow_vector ) {
2429  reg_num = ffs( overflow_vector ) - 1;
2430  /* find the event code */
2431  for ( count = 0; count < ESI->profile.event_counter; count++ ) {
2432  eventindex = ESI->profile.EventIndex[count];
2433  pos = ESI->EventInfoArray[eventindex].pos[0];
2434  if ( pos + PMU_FIRST_COUNTER == reg_num ) {
2435  EventCode = ESI->profile.EventCode[count];
2436  native_index =
2437  ESI->NativeInfoArray[pos].
2438  ni_event & PAPI_NATIVE_AND_MASK;
2439  break;
2440  }
2441  }
2442  /* something is wrong */
2443  if ( count == ESI->profile.event_counter ) {
2444  PAPIERROR
2445  ( "wrong count: %d vs. ESI->profile.event_counter %d\n",
2446  count, ESI->profile.event_counter );
2447  return ( PAPI_EBUG );
2448  }
2449 
2450  /* print entry header */
2451  pc = ent->ip;
2452  if ( pfm_ita2_is_dear( native_index ) ) {
2453  reg = ( pfm_ita2_pmd_reg_t * ) ( ent + 1 );
2454  reg++;
2455  reg++;
2456  pc = ( ( reg->pmd17_ita2_reg.dear_iaddr +
2457  reg->pmd17_ita2_reg.dear_bn ) << 4 )
2458  | reg->pmd17_ita2_reg.dear_slot;
2459 
2460  /* adjust pointer position */
2461  buf_pos += ( hweight64( DEAR_REGS_MASK ) << 3 );
2462  }
2463 
2464  _papi_hwi_dispatch_profile( ESI, ( caddr_t ) pc, ( long long ) 0,
2465  count );
2466  overflow_vector ^= ( unsigned long ) 1 << reg_num;
2467  }
2468  /* move to next entry */
2469  buf_pos += entry_size;
2470  } /* end of if */
2471  return ( PAPI_OK );
2472 }
pfm_default_smpl_entry_t pfmw_smpl_entry_t
Definition: perfmon-ia64.c:84
return PAPI_OK
Definition: linux-nvml.c:458
int count
Definition: iozone.c:22422
void
Definition: iozone.c:18627
#define PAPI_PROFILING
Definition: fpapi.h:34
long long ret
Definition: iozone.c:1346
pfm_default_smpl_hdr_t pfmw_smpl_hdr_t
Definition: perfmon-ia64.c:83
int i
Definition: fileop.c:140
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
long long
Definition: iozone.c:19827
void PAPIERROR(char *format,...)
#define PMU_FIRST_COUNTER
Definition: perfmon-ia64.h:96
NativeInfo_t * NativeInfoArray
EventInfo_t * EventInfoArray
int pos[PAPI_EVENTS_IN_DERIVED_EVENT]
#define PAPI_EBUG
Definition: fpapi.h:111
#define DEAR_REGS_MASK
Definition: perfmon-ia64.h:173
void _papi_hwi_dispatch_profile(EventSetInfo_t *ESI, caddr_t pc, long long over, int profile_index)
Definition: extras.c:163
#define PAPI_NATIVE_AND_MASK
EventSetProfileInfo_t profile
hwd_control_state_t * ctl_state

Here is the call graph for this function:

Here is the caller graph for this function:

static int ia64_ita_process_profile_buffer ( ThreadInfo_t thread,
EventSetInfo_t ESI 
)
static

Definition at line 2312 of file perfmon-ia64.c.

2313 {
2314  ( void ) thread; /*unused */
2315  pfmw_smpl_hdr_t *hdr;
2316  pfmw_smpl_entry_t *ent;
2317  unsigned long buf_pos;
2318  unsigned long entry_size;
2319  int ret, reg_num, count, pos;
2320  unsigned int i, EventCode = 0, eventindex, native_index = 0;
2321  ia64_control_state_t *this_state;
2322  pfm_ita_pmd_reg_t *reg;
2323  unsigned long overflow_vector, pc;
2324 
2325 
2326  if ( ( ESI->state & PAPI_PROFILING ) == 0 )
2327  return ( PAPI_EBUG );
2328 
2329  this_state = ( ia64_control_state_t * ) ( ESI->ctl_state );
2330  hdr = ( pfmw_smpl_hdr_t * ) this_state->smpl_vaddr;
2331 
2332  entry_size = sizeof ( pfmw_smpl_entry_t );
2333 
2334  /*
2335  * walk through all the entries recorded in the buffer
2336  */
2337  buf_pos = ( unsigned long ) ( hdr + 1 );
2338  for ( i = 0; i < hdr->hdr_count; i++ ) {
2339  ret = 0;
2340  ent = ( pfmw_smpl_entry_t * ) buf_pos;
2341  /* PFM30 only one PMD overflows in each sample */
2342  overflow_vector = 1 << ent->ovfl_pmd;
2343 
2344  SUBDBG( "Entry %d PID:%d CPU:%d ovfl_vector:%#lx IIP:%#016lx\n",
2345  i, ent->pid, ent->cpu, overflow_vector, ent->ip );
2346 
2347  while ( overflow_vector ) {
2348  reg_num = ffs( overflow_vector ) - 1;
2349  /* find the event code */
2350  for ( count = 0; count < ESI->profile.event_counter; count++ ) {
2351  eventindex = ESI->profile.EventIndex[count];
2352  pos = ESI->EventInfoArray[eventindex].pos[0];
2353  if ( pos + PMU_FIRST_COUNTER == reg_num ) {
2354  EventCode = ESI->profile.EventCode[count];
2355  native_index =
2356  ESI->NativeInfoArray[pos].
2357  ni_event & PAPI_NATIVE_AND_MASK;
2358  break;
2359  }
2360  }
2361  /* something is wrong */
2362  if ( count == ESI->profile.event_counter ) {
2363  PAPIERROR
2364  ( "wrong count: %d vs. ESI->profile.event_counter %d\n",
2365  count, ESI->profile.event_counter );
2366  return ( PAPI_EBUG );
2367  }
2368 
2369  /* print entry header */
2370  pc = ent->ip;
2371  if ( pfm_ita_is_dear( native_index ) ) {
2372  reg = ( pfm_ita_pmd_reg_t * ) ( ent + 1 );
2373  reg++;
2374  reg++;
2375  pc = ( reg->pmd17_ita_reg.dear_iaddr << 4 ) | ( reg->
2376  pmd17_ita_reg.
2377  dear_slot );
2378  /* adjust pointer position */
2379  buf_pos += ( hweight64( DEAR_REGS_MASK ) << 3 );
2380  }
2381 
2382  _papi_hwi_dispatch_profile( ESI, ( caddr_t ) pc, ( long long ) 0,
2383  count );
2384  overflow_vector ^= ( unsigned long ) 1 << reg_num;
2385  }
2386  /* move to next entry */
2387  buf_pos += entry_size;
2388  } /* end of if */
2389  return ( PAPI_OK );
2390 }
pfm_default_smpl_entry_t pfmw_smpl_entry_t
Definition: perfmon-ia64.c:84
return PAPI_OK
Definition: linux-nvml.c:458
int count
Definition: iozone.c:22422
void
Definition: iozone.c:18627
#define PAPI_PROFILING
Definition: fpapi.h:34
long long ret
Definition: iozone.c:1346
pfm_default_smpl_hdr_t pfmw_smpl_hdr_t
Definition: perfmon-ia64.c:83
int i
Definition: fileop.c:140
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
long long
Definition: iozone.c:19827
void PAPIERROR(char *format,...)
#define PMU_FIRST_COUNTER
Definition: perfmon-ia64.h:96
NativeInfo_t * NativeInfoArray
EventInfo_t * EventInfoArray
again struct sockaddr sizeof(struct sockaddr_in))
int pos[PAPI_EVENTS_IN_DERIVED_EVENT]
#define PAPI_EBUG
Definition: fpapi.h:111
#define DEAR_REGS_MASK
Definition: perfmon-ia64.h:173
void _papi_hwi_dispatch_profile(EventSetInfo_t *ESI, caddr_t pc, long long over, int profile_index)
Definition: extras.c:163
#define PAPI_NATIVE_AND_MASK
EventSetProfileInfo_t profile
hwd_control_state_t * ctl_state

Here is the call graph for this function:

Here is the caller graph for this function:

static int ia64_mont_process_profile_buffer ( ThreadInfo_t thread,
EventSetInfo_t ESI 
)
static

Definition at line 2475 of file perfmon-ia64.c.

2476 {
2477  ( void ) thread; /*unused */
2478  pfmw_smpl_hdr_t *hdr;
2479  pfmw_smpl_entry_t *ent;
2480  unsigned long buf_pos;
2481  unsigned long entry_size;
2482  int ret, reg_num, count, pos;
2483  unsigned int i, EventCode = 0, eventindex, native_index = 0;
2484  ia64_control_state_t *this_state;
2485  pfm_mont_pmd_reg_t *reg;
2486  unsigned long overflow_vector, pc;
2487  unsigned int umask;
2488 
2489 
2490  if ( ( ESI->state & PAPI_PROFILING ) == 0 )
2491  return ( PAPI_EBUG );
2492 
2493  this_state = ( ia64_control_state_t * ) ESI->ctl_state;
2494  hdr = ( pfmw_smpl_hdr_t * ) this_state->smpl_vaddr;
2495 
2496  entry_size = sizeof ( pfmw_smpl_entry_t );
2497 
2498  /*
2499  * walk through all the entries recorded in the buffer
2500  */
2501  buf_pos = ( unsigned long ) ( hdr + 1 );
2502  for ( i = 0; i < hdr->hdr_count; i++ ) {
2503  ret = 0;
2504  ent = ( pfmw_smpl_entry_t * ) buf_pos;
2505  /* PFM30 only one PMD overflows in each sample */
2506  overflow_vector = 1 << ent->ovfl_pmd;
2507 
2508  SUBDBG( "Entry %d PID:%d CPU:%d ovfl_vector:%#lx IIP:%#016lx\n",
2509  i, ent->pid, ent->cpu, overflow_vector, ent->ip );
2510 
2511  while ( overflow_vector ) {
2512  reg_num = ffs( overflow_vector ) - 1;
2513  /* find the event code */
2514  for ( count = 0; count < ESI->profile.event_counter; count++ ) {
2515  eventindex = ESI->profile.EventIndex[count];
2516  pos = ESI->EventInfoArray[eventindex].pos[0];
2517  if ( pos + PMU_FIRST_COUNTER == reg_num ) {
2518  EventCode = ESI->profile.EventCode[count];
2520  ( ESI->NativeInfoArray[pos].ni_event, &native_index,
2521  &umask ) != PAPI_OK )
2522  return ( PAPI_ENOEVNT );
2523  break;
2524  }
2525  }
2526  /* something is wrong */
2527  if ( count == ESI->profile.event_counter ) {
2528  PAPIERROR
2529  ( "wrong count: %d vs. ESI->profile.event_counter %d\n",
2530  count, ESI->profile.event_counter );
2531  return ( PAPI_EBUG );
2532  }
2533 
2534  /* print entry header */
2535  pc = ent->ip;
2536  if ( pfm_mont_is_dear( native_index ) ) {
2537  reg = ( pfm_mont_pmd_reg_t * ) ( ent + 1 );
2538  reg++;
2539  reg++;
2540  pc = ( ( reg->pmd36_mont_reg.dear_iaddr +
2541  reg->pmd36_mont_reg.dear_bn ) << 4 )
2542  | reg->pmd36_mont_reg.dear_slot;
2543  /* adjust pointer position */
2544  buf_pos += ( hweight64( DEAR_REGS_MASK ) << 3 );
2545  }
2546 
2547  _papi_hwi_dispatch_profile( ESI, ( caddr_t ) pc, ( long long ) 0,
2548  count );
2549  overflow_vector ^= ( unsigned long ) 1 << reg_num;
2550  }
2551  /* move to next entry */
2552  buf_pos += entry_size;
2553  } /* end of if */
2554  return ( PAPI_OK );
2555 }
#define PAPI_ENOEVNT
Definition: fpapi.h:112
pfm_default_smpl_entry_t pfmw_smpl_entry_t
Definition: perfmon-ia64.c:84
return PAPI_OK
Definition: linux-nvml.c:458
int count
Definition: iozone.c:22422
void
Definition: iozone.c:18627
#define PAPI_PROFILING
Definition: fpapi.h:34
long long ret
Definition: iozone.c:1346
pfm_default_smpl_hdr_t pfmw_smpl_hdr_t
Definition: perfmon-ia64.c:83
int i
Definition: fileop.c:140
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
long long
Definition: iozone.c:19827
void PAPIERROR(char *format,...)
#define PMU_FIRST_COUNTER
Definition: perfmon-ia64.h:96
NativeInfo_t * NativeInfoArray
EventInfo_t * EventInfoArray
int pos[PAPI_EVENTS_IN_DERIVED_EVENT]
#define PAPI_EBUG
Definition: fpapi.h:111
#define DEAR_REGS_MASK
Definition: perfmon-ia64.h:173
void _papi_hwi_dispatch_profile(EventSetInfo_t *ESI, caddr_t pc, long long over, int profile_index)
Definition: extras.c:163
EventSetProfileInfo_t profile
hwd_control_state_t * ctl_state
static int _pfm_decode_native_event(unsigned int EventCode, unsigned int *event, unsigned int *umask)

Here is the call graph for this function:

Here is the caller graph for this function:

static int ia64_process_profile_buffer ( ThreadInfo_t thread,
EventSetInfo_t ESI 
)
static

Definition at line 2558 of file perfmon-ia64.c.

2559 {
2560  switch ( _perfmon2_pfm_pmu_type ) {
2561  case PFMLIB_ITANIUM_PMU:
2562  return ( ia64_ita_process_profile_buffer( thread, ESI ) );
2563  break;
2564  case PFMLIB_ITANIUM2_PMU:
2565  return ( ia64_ita2_process_profile_buffer( thread, ESI ) );
2566  break;
2567  case PFMLIB_MONTECITO_PMU:
2568  return ( ia64_mont_process_profile_buffer( thread, ESI ) );
2569  break;
2570  default:
2571  PAPIERROR( "PMU type %d is not supported by this component",
2573  return ( PAPI_EBUG );
2574  }
2575 }
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
static int ia64_ita_process_profile_buffer(ThreadInfo_t *thread, EventSetInfo_t *ESI)
static int ia64_ita2_process_profile_buffer(ThreadInfo_t *thread, EventSetInfo_t *ESI)
void PAPIERROR(char *format,...)
static int ia64_mont_process_profile_buffer(ThreadInfo_t *thread, EventSetInfo_t *ESI)
#define PAPI_EBUG
Definition: fpapi.h:111

Here is the call graph for this function:

Here is the caller graph for this function:

static int install_drange ( hwd_context_t pctx,
hwd_control_state_t current_state 
)
static

Definition at line 694 of file perfmon-ia64.c.

695 {
696  ia64_control_state_t *this_state = ( ia64_control_state_t * ) current_state;
697  unsigned int i, used_dbr;
698  int r;
699  int pid = ( ( ia64_context_t * ) pctx )->fd;
700 
701  pfmlib_ita2_output_param_t *ita2_output_param;
702  pfarg_dbreg_t ita2_dbreg[PFMON_ITA2_MAX_IBRS];
703  pfmlib_mont_output_param_t *mont_output_param;
704  pfarg_dbreg_t mont_dbreg[PFMON_MONT_MAX_IBRS];
705 
706  memset( mont_dbreg, 0, sizeof ( mont_dbreg ) );
707  memset( ita2_dbreg, 0, sizeof ( ita2_dbreg ) );
708 
709  switch ( _perfmon2_pfm_pmu_type ) {
710  case PFMLIB_ITANIUM2_PMU:
711  ita2_output_param =
712  &( this_state->ita_lib_param.ita2_param.ita2_output_param );
713  used_dbr = ita2_output_param->pfp_ita2_drange.rr_nbr_used;
714 
715  for ( i = 0; i < used_dbr; i++ ) {
716  ita2_dbreg[i].dbreg_num =
717  ita2_output_param->pfp_ita2_drange.rr_br[i].reg_num;
718  ita2_dbreg[i].dbreg_value =
719  ita2_output_param->pfp_ita2_drange.rr_br[i].reg_value;
720  }
721 
722  r = perfmonctl( pid, PFM_WRITE_DBRS, ita2_dbreg,
723  ita2_output_param->pfp_ita2_drange.rr_nbr_used );
724  if ( r == -1 ) {
725  SUBDBG( "cannot install data range restriction: %s\n",
726  strerror( errno ) );
727  return ( PAPI_ESYS );
728  }
729  return ( PAPI_OK );
730  break;
731  case PFMLIB_MONTECITO_PMU:
732  mont_output_param =
733  &( this_state->ita_lib_param.mont_param.mont_output_param );
734  used_dbr = mont_output_param->pfp_mont_drange.rr_nbr_used;
735 
736  for ( i = 0; i < used_dbr; i++ ) {
737  mont_dbreg[i].dbreg_num =
738  mont_output_param->pfp_mont_drange.rr_br[i].reg_num;
739  mont_dbreg[i].dbreg_value =
740  mont_output_param->pfp_mont_drange.rr_br[i].reg_value;
741  }
742 
743  r = perfmonctl( pid, PFM_WRITE_DBRS, mont_dbreg,
744  mont_output_param->pfp_mont_drange.rr_nbr_used );
745  if ( r == -1 ) {
746  SUBDBG( "cannot install data range restriction: %s\n",
747  strerror( errno ) );
748  return PAPI_ESYS;
749  }
750  return PAPI_OK;
751  break;
752  default:
753  PAPIERROR( "PMU type %d is not supported by this component",
755  return PAPI_ENOIMPL;
756  }
757 }
pfmw_ita_param_t ita_lib_param
Definition: perfmon-ia64.h:114
memset(eventId, 0, size)
int errno
#define PFMON_MONT_MAX_IBRS
Definition: perfmon-ia64.c:60
#define PAPI_ENOIMPL
Definition: fpapi.h:124
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
#define PFMON_ITA2_MAX_IBRS
Definition: perfmon-ia64.c:63
return PAPI_OK
Definition: linux-nvml.c:458
int i
Definition: fileop.c:140
static int pid
pfmw_ita2_param_t ita2_param
Definition: perfmon-ia64.h:101
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
void PAPIERROR(char *format,...)
pfmlib_ita2_output_param_t ita2_output_param
Definition: perfmon-ia64.h:89
#define PAPI_ESYS
Definition: fpapi.h:108
pfmlib_mont_output_param_t mont_output_param
Definition: perfmon-ia64.h:82
pfmw_mont_param_t mont_param
Definition: perfmon-ia64.h:102

Here is the call graph for this function:

Here is the caller graph for this function:

static int install_irange ( hwd_context_t pctx,
hwd_control_state_t current_state 
)
static

Definition at line 626 of file perfmon-ia64.c.

627 {
628  ia64_control_state_t *this_state = ( ia64_control_state_t * ) current_state;
629  unsigned int i, used_dbr;
630  int r;
631  int pid = ( ( ia64_context_t * ) pctx )->fd;
632 
633  pfmlib_ita2_output_param_t *ita2_output_param;
634  pfarg_dbreg_t ita2_dbreg[PFMON_ITA2_MAX_IBRS];
635  pfmlib_mont_output_param_t *mont_output_param;
636  pfarg_dbreg_t mont_dbreg[PFMON_MONT_MAX_IBRS];
637 
638  memset( mont_dbreg, 0, sizeof ( mont_dbreg ) );
639  memset( ita2_dbreg, 0, sizeof ( ita2_dbreg ) );
640  check_ibrp_events( current_state );
641 
642  switch ( _perfmon2_pfm_pmu_type ) {
643  case PFMLIB_ITANIUM2_PMU:
644  ita2_output_param =
645  &( this_state->ita_lib_param.ita2_param.ita2_output_param );
646  used_dbr = ita2_output_param->pfp_ita2_irange.rr_nbr_used;
647 
648  for ( i = 0; i < used_dbr; i++ ) {
649  ita2_dbreg[i].dbreg_num =
650  ita2_output_param->pfp_ita2_irange.rr_br[i].reg_num;
651  ita2_dbreg[i].dbreg_value =
652  ita2_output_param->pfp_ita2_irange.rr_br[i].reg_value;
653  }
654 
655  r = perfmonctl( pid, PFM_WRITE_IBRS, ita2_dbreg,
656  ita2_output_param->pfp_ita2_irange.rr_nbr_used );
657  if ( r == -1 ) {
658  SUBDBG( "cannot install code range restriction: %s\n",
659  strerror( errno ) );
660  return ( PAPI_ESYS );
661  }
662  return ( PAPI_OK );
663  break;
664  case PFMLIB_MONTECITO_PMU:
665  mont_output_param =
666  &( this_state->ita_lib_param.mont_param.mont_output_param );
667 
668  used_dbr = mont_output_param->pfp_mont_irange.rr_nbr_used;
669 
670  for ( i = 0; i < used_dbr; i++ ) {
671  mont_dbreg[i].dbreg_num =
672  mont_output_param->pfp_mont_irange.rr_br[i].reg_num;
673  mont_dbreg[i].dbreg_value =
674  mont_output_param->pfp_mont_irange.rr_br[i].reg_value;
675  }
676 
677  r = perfmonctl( pid, PFM_WRITE_IBRS, mont_dbreg,
678  mont_output_param->pfp_mont_irange.rr_nbr_used );
679  if ( r == -1 ) {
680  SUBDBG( "cannot install code range restriction: %s\n",
681  strerror( errno ) );
682  return ( PAPI_ESYS );
683  }
684  return ( PAPI_OK );
685  break;
686  default:
687  PAPIERROR( "PMU type %d is not supported by this component",
689  return PAPI_ENOIMPL;
690  }
691 }
pfmw_ita_param_t ita_lib_param
Definition: perfmon-ia64.h:114
memset(eventId, 0, size)
int errno
#define PFMON_MONT_MAX_IBRS
Definition: perfmon-ia64.c:60
#define PAPI_ENOIMPL
Definition: fpapi.h:124
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
#define PFMON_ITA2_MAX_IBRS
Definition: perfmon-ia64.c:63
return PAPI_OK
Definition: linux-nvml.c:458
int i
Definition: fileop.c:140
static int pid
pfmw_ita2_param_t ita2_param
Definition: perfmon-ia64.h:101
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
void PAPIERROR(char *format,...)
pfmlib_ita2_output_param_t ita2_output_param
Definition: perfmon-ia64.h:89
#define PAPI_ESYS
Definition: fpapi.h:108
static void check_ibrp_events(hwd_control_state_t *current_state)
Definition: perfmon-ia64.c:505
pfmlib_mont_output_param_t mont_output_param
Definition: perfmon-ia64.h:82
pfmw_mont_param_t mont_param
Definition: perfmon-ia64.h:102

Here is the call graph for this function:

Here is the caller graph for this function:

static int pfmw_create_context ( hwd_context_t thr_ctx)
static

Definition at line 233 of file perfmon-ia64.c.

234 {
235  pfarg_context_t ctx;
236  memset( &ctx, 0, sizeof ( ctx ) );
237 
238  SUBDBG( "PFM_CREATE_CONTEXT on 0\n" );
239  if ( perfmonctl( 0, PFM_CREATE_CONTEXT, &ctx, 1 ) == -1 ) {
240  PAPIERROR( "perfmonctl(PFM_CREATE_CONTEXT) errno %d", errno );
241  return ( PAPI_ESYS );
242  }
243  ( ( ia64_context_t * ) thr_ctx )->fd = ctx.ctx_fd;
244  ( ( ia64_context_t * ) thr_ctx )->tid = mygettid( );
245  SUBDBG( "PFM_CREATE_CONTEXT returns FD %d, TID %d\n",
246  ( int ) ( ( ia64_context_t * ) thr_ctx )->fd,
247  ( int ) ( ( ia64_context_t * ) thr_ctx )->tid );
248 
249  return ( pfmw_create_ctx_common( thr_ctx ) );
250 }
memset(eventId, 0, size)
int errno
int fd
Definition: iozone.c:1291
static pid_t mygettid(void)
Definition: darwin-common.h:11
void *long long tid
Definition: iozone.c:18586
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
void PAPIERROR(char *format,...)
#define PAPI_ESYS
Definition: fpapi.h:108
static int pfmw_create_ctx_common(hwd_context_t *ctx)
Definition: perfmon-ia64.c:162

Here is the call graph for this function:

Here is the caller graph for this function:

static int pfmw_create_ctx_common ( hwd_context_t ctx)
static

Definition at line 162 of file perfmon-ia64.c.

163 {
164  pfarg_load_t load_args;
165  int ret;
166 
167  memset( &load_args, 0, sizeof ( load_args ) );
168  /*
169  * we want to monitor ourself
170  */
171 
172  load_args.load_pid = ( ( ia64_context_t * ) ctx )->tid;
173 
174  SUBDBG( "PFM_LOAD_CONTEXT FD %d, PID %d\n",
175  ( ( ia64_context_t * ) ctx )->fd,
176  ( ( ia64_context_t * ) ctx )->tid );
177  if ( perfmonctl
178  ( ( ( ia64_context_t * ) ctx )->fd, PFM_LOAD_CONTEXT, &load_args,
179  1 ) == -1 ) {
180  PAPIERROR( "perfmonctl(PFM_LOAD_CONTEXT) errno %d", errno );
181  return ( PAPI_ESYS );
182  }
183  /*
184  * setup asynchronous notification on the file descriptor
185  */
186  ret =
187  fcntl( ( ( ia64_context_t * ) ctx )->fd, F_SETFL,
188  fcntl( ( ( ia64_context_t * ) ctx )->fd, F_GETFL,
189  0 ) | O_ASYNC );
190  if ( ret == -1 ) {
191  PAPIERROR( "fcntl(%d,F_SETFL,O_ASYNC) errno %d",
192  ( ( ia64_context_t * ) ctx )->fd, errno );
193  return ( PAPI_ESYS );
194  }
195 
196  /*
197  * get ownership of the descriptor
198  */
199 
200  ret =
201  fcntl( ( ( ia64_context_t * ) ctx )->fd, F_SETOWN,
202  ( ( ia64_context_t * ) ctx )->tid );
203  if ( ret == -1 ) {
204  PAPIERROR( "fcntl(%d,F_SETOWN) errno %d",
205  ( ( ia64_context_t * ) ctx )->fd, errno );
206  return ( PAPI_ESYS );
207  }
208 
209  ret =
210  fcntl( ( ( ia64_context_t * ) ctx )->fd, F_SETSIG,
212  if ( ret == -1 ) {
213  PAPIERROR( "fcntl(%d,F_SETSIG) errno %d",
214  ( ( ia64_context_t * ) ctx )->fd, errno );
215  return ( PAPI_ESYS );
216  }
217 
218  /* set close-on-exec to ensure we will be getting the PFM_END_MSG, i.e.,
219  * fd not visible to child. */
220 
221  ret = fcntl( ( ( ia64_context_t * ) ctx )->fd, F_SETFD, FD_CLOEXEC );
222  if ( ret == -1 ) {
223  PAPIERROR( "fcntl(%d,FD_CLOEXEC) errno %d",
224  ( ( ia64_context_t * ) ctx )->fd, errno );
225  return ( PAPI_ESYS );
226  }
227 
228  return ( PAPI_OK );
229 
230 }
memset(eventId, 0, size)
int errno
int fd
Definition: iozone.c:1291
papi_vector_t _ia64_vector
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
long long ret
Definition: iozone.c:1346
void *long long tid
Definition: iozone.c:18586
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
void PAPIERROR(char *format,...)
#define PAPI_ESYS
Definition: fpapi.h:108

Here is the call graph for this function:

Here is the caller graph for this function:

static int pfmw_destroy_context ( hwd_context_t thr_ctx)
static

Definition at line 106 of file perfmon-ia64.c.

107 {
108  int ret;
109  ret = close( ( ( ia64_context_t * ) thr_ctx )->fd );
110  if ( ret )
111  return PAPI_ESYS;
112  else
113  return PAPI_OK;
114 }
int close(int fd)
Definition: appio.c:175
int fd
Definition: iozone.c:1291
return PAPI_OK
Definition: linux-nvml.c:458
long long ret
Definition: iozone.c:1346
#define PAPI_ESYS
Definition: fpapi.h:108

Here is the call graph for this function:

Here is the caller graph for this function:

static int pfmw_dispatch_events ( pfmw_param_t evt)
static

Definition at line 117 of file perfmon-ia64.c.

118 {
119  int ret;
120  unsigned int i;
121 /*
122  PFMW_PEVT_DFLPLM(evt) = PFM_PLM3;
123 */
124 #ifdef PFMLIB_MONTECITO_PMU
125  if ( _perfmon2_pfm_pmu_type == PFMLIB_MONTECITO_PMU )
126  ret =
127  pfm_dispatch_events( &evt->inp,
128  ( pfmlib_mont_input_param_t * ) evt->mod_inp,
129  &evt->outp,
130  ( pfmlib_mont_output_param_t * ) evt->
131  mod_outp );
132  else
133 #endif
134  ret =
135  pfm_dispatch_events( &evt->inp,
136  ( pfmlib_ita2_input_param_t * ) evt->mod_inp,
137  &evt->outp,
138  ( pfmlib_ita2_output_param_t * ) evt->
139  mod_outp );
140  if ( ret ) {
141  return PAPI_ESYS;
142  } else {
143  for ( i = 0; i < evt->outp.pfp_pmc_count; i++ ) {
144  evt->pc[i].reg_num = evt->outp.pfp_pmcs[i].reg_num;
145  evt->pc[i].reg_value = evt->outp.pfp_pmcs[i].reg_value;
146  }
147 #if defined(HAVE_PFMLIB_OUTPUT_PFP_PMD_COUNT)
148  for ( i = 0; i < evt->outp.pfp_pmd_count; i++ ) {
149  evt->pd[i].reg_num = evt->outp.pfp_pmds[i].reg_num;
150  }
151 #else
152  /* This is really broken */
153  for ( i = 0; i < evt->inp.pfp_event_count; i++ ) {
154  evt->pd[i].reg_num = evt->pc[i].reg_num;
155  }
156 #endif
157  return PAPI_OK;
158  }
159 }
pfmlib_input_param_t inp
Definition: perfmon-ia64.h:73
pfmlib_output_param_t outp
Definition: perfmon-ia64.h:74
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
return PAPI_OK
Definition: linux-nvml.c:458
pfarg_reg_t pc[NUM_PMCS]
Definition: perfmon-ia64.h:72
long long ret
Definition: iozone.c:1346
int i
Definition: fileop.c:140
#define PAPI_ESYS
Definition: fpapi.h:108
pfarg_reg_t pd[NUM_PMDS]
Definition: perfmon-ia64.h:71
void * mod_inp
Definition: perfmon-ia64.h:75

Here is the caller graph for this function:

static void pfmw_get_event_description ( unsigned int  idx,
char *  dest,
int  len 
)
static

Definition at line 393 of file perfmon-ia64.c.

394 {
395  char *descr;
396 
397  if ( pfm_get_event_description( idx, &descr ) == PFMLIB_SUCCESS ) {
398  strncpy( dest, descr, len );
399  free( descr );
400  } else
401  *dest = '\0';
402 }
free(dummyfile[xx])

Here is the call graph for this function:

Here is the caller graph for this function:

static int pfmw_get_event_name ( char *  name,
unsigned int  idx 
)
static

Definition at line 379 of file perfmon-ia64.c.

380 {
381  unsigned int total;
382 
383  pfm_get_num_events( &total );
384  if ( idx >= total )
385  return PAPI_ENOEVNT;
386  if ( pfm_get_event_name( idx, name, PAPI_MAX_STR_LEN ) == PFMLIB_SUCCESS )
387  return PAPI_OK;
388  else
389  return PAPI_ENOEVNT;
390 }
#define PAPI_MAX_STR_LEN
Definition: fpapi.h:43
#define PAPI_ENOEVNT
Definition: fpapi.h:112
return PAPI_OK
Definition: linux-nvml.c:458
char * name
Definition: iozone.c:23648
static int total
Definition: rapl_overflow.c:5

Here is the caller graph for this function:

static int pfmw_get_num_counters ( int num)
static

Definition at line 1058 of file perfmon-ia64.c.

1059 {
1060  unsigned int tmp;
1061  if ( pfm_get_num_counters( &tmp ) != PFMLIB_SUCCESS )
1062  return ( PAPI_ESYS );
1063  *num = tmp;
1064  return ( PAPI_OK );
1065 }
return PAPI_OK
Definition: linux-nvml.c:458
void int num
Definition: iozone.c:22151
#define PAPI_ESYS
Definition: fpapi.h:108
long long tmp
Definition: iozone.c:12031

Here is the caller graph for this function:

static int pfmw_get_num_events ( int num)
static

Definition at line 1068 of file perfmon-ia64.c.

1069 {
1070  unsigned int tmp;
1071  if ( pfm_get_num_events( &tmp ) != PFMLIB_SUCCESS )
1072  return ( PAPI_ESYS );
1073  *num = tmp;
1074  return ( PAPI_OK );
1075 }
return PAPI_OK
Definition: linux-nvml.c:458
void int num
Definition: iozone.c:22151
#define PAPI_ESYS
Definition: fpapi.h:108
long long tmp
Definition: iozone.c:12031

Here is the caller graph for this function:

static int pfmw_is_dear ( unsigned int  i)
static

Definition at line 405 of file perfmon-ia64.c.

406 {
407  switch ( _perfmon2_pfm_pmu_type ) {
408  case PFMLIB_ITANIUM_PMU:
409  return ( pfm_ita_is_dear( i ) );
410  break;
411  case PFMLIB_ITANIUM2_PMU:
412  return ( pfm_ita2_is_dear( i ) );
413  break;
414  case PFMLIB_MONTECITO_PMU:
415  return ( pfm_mont_is_dear( i ) );
416  break;
417  default:
418  PAPIERROR( "PMU type %d is not supported by this component",
420  return ( PAPI_EBUG );
421  }
422 }
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
int i
Definition: fileop.c:140
void PAPIERROR(char *format,...)
#define PAPI_EBUG
Definition: fpapi.h:111

Here is the call graph for this function:

Here is the caller graph for this function:

static int pfmw_is_iear ( unsigned int  i)
static

Definition at line 425 of file perfmon-ia64.c.

426 {
427  switch ( _perfmon2_pfm_pmu_type ) {
428  case PFMLIB_ITANIUM_PMU:
429  return ( pfm_ita_is_iear( i ) );
430  break;
431  case PFMLIB_ITANIUM2_PMU:
432  return ( pfm_ita2_is_iear( i ) );
433  break;
434  case PFMLIB_MONTECITO_PMU:
435  return ( pfm_mont_is_iear( i ) );
436  break;
437  default:
438  PAPIERROR( "PMU type %d is not supported by this component",
440  return ( PAPI_EBUG );
441  }
442 }
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
int i
Definition: fileop.c:140
void PAPIERROR(char *format,...)
#define PAPI_EBUG
Definition: fpapi.h:111

Here is the call graph for this function:

Here is the caller graph for this function:

static int pfmw_perfmonctl ( pid_t  tid,
int  fd,
int  cmd,
void arg,
int  narg 
)
static

Definition at line 99 of file perfmon-ia64.c.

100 {
101  ( void ) tid; /*unused */
102  return ( perfmonctl( fd, cmd, arg, narg ) );
103 }
int fd
Definition: iozone.c:1291
void
Definition: iozone.c:18627
void *long long tid
Definition: iozone.c:18586

Here is the caller graph for this function:

static int pfmw_recreate_context ( EventSetInfo_t ESI,
hwd_context_t thr_ctx,
void **  smpl_vaddr,
int  EventIndex 
)
static

Definition at line 281 of file perfmon-ia64.c.

283 {
284  pfm_default_smpl_ctx_arg_t ctx;
285  pfm_uuid_t buf_fmt_id = PFM_DEFAULT_SMPL_UUID;
286  int ctx_fd;
287  unsigned int native_index, EventCode;
288  int pos;
289  //hwd_context_t *thr_ctx = (hwd_context_t *) &ESI->master->context;
290 #ifdef PFMLIB_MONTECITO_PMU
291  unsigned int umask;
292 #endif
293 
294  pos = ESI->EventInfoArray[EventIndex].pos[0];
295  EventCode = ESI->EventInfoArray[EventIndex].event_code;
296 #ifdef PFMLIB_MONTECITO_PMU
297  if ( _perfmon2_pfm_pmu_type == PFMLIB_MONTECITO_PMU ) {
299  ( ESI->NativeInfoArray[pos].ni_event, &native_index,
300  &umask ) != PAPI_OK )
301  return ( PAPI_ENOEVNT );
302  } else
303 #endif
304  native_index =
306 
307  memset( &ctx, 0, sizeof ( ctx ) );
308  /*
309  * We initialize the format specific information.
310  * The format is identified by its UUID which must be copied
311  * into the ctx_buf_fmt_id field.
312  */
313  memcpy( ctx.ctx_arg.ctx_smpl_buf_id, buf_fmt_id, sizeof ( pfm_uuid_t ) );
314  /*
315  * the size of the buffer is indicated in bytes (not entries).
316  * The kernel will record into the buffer up to a certain point.
317  * No partial samples are ever recorded.
318  */
319  ctx.buf_arg.buf_size = 4096;
320  /*
321  * now create the context for self monitoring/per-task
322  */
323  SUBDBG( "PFM_CREATE_CONTEXT on 0\n" );
324  if ( perfmonctl( 0, PFM_CREATE_CONTEXT, &ctx, 1 ) == -1 ) {
325  if ( errno == ENOSYS )
326  PAPIERROR
327  ( "Your kernel does not have performance monitoring support" );
328  else
329  PAPIERROR( "perfmonctl(PFM_CREATE_CONTEXT) errno %d", errno );
330  return ( PAPI_ESYS );
331  }
332  /*
333  * extract the file descriptor we will use to
334  * identify this newly created context
335  */
336  ctx_fd = ctx.ctx_arg.ctx_fd;
337  /* save the fd into the thread context struct */
338  ( ( ia64_context_t * ) thr_ctx )->fd = ctx_fd;
339  ( ( ia64_context_t * ) thr_ctx )->tid = mygettid( );
340  SUBDBG( "PFM_CREATE_CONTEXT returns FD %d, TID %d\n",
341  ( int ) ( ( ia64_context_t * ) thr_ctx )->fd,
342  ( int ) ( ( ia64_context_t * ) thr_ctx )->tid );
343  /* indicate which PMD to include in the sample */
344 /* DEAR and BTB events */
345  switch ( _perfmon2_pfm_pmu_type ) {
346  case PFMLIB_ITANIUM_PMU:
347  if ( pfm_ita_is_dear( native_index ) )
348  set_pmds_to_write( ESI, EventIndex, DEAR_REGS_MASK );
349  else if ( pfm_ita_is_btb( native_index )
350  || EventCode == ( unsigned int ) PAPI_BR_INS )
351  set_pmds_to_write( ESI, EventIndex, BTB_REGS_MASK );
352  break;
353  case PFMLIB_ITANIUM2_PMU:
354  if ( pfm_ita2_is_dear( native_index ) )
355  set_pmds_to_write( ESI, EventIndex, DEAR_REGS_MASK );
356  else if ( pfm_ita2_is_btb( native_index )
357  || EventCode == ( unsigned int ) PAPI_BR_INS )
358  set_pmds_to_write( ESI, EventIndex, BTB_REGS_MASK );
359  break;
360  case PFMLIB_MONTECITO_PMU:
361  if ( pfm_mont_is_dear( native_index ) )
362  set_pmds_to_write( ESI, EventIndex, MONT_DEAR_REGS_MASK );
363  else if ( pfm_mont_is_etb( native_index ) ||
364  EventCode == ( unsigned int ) PAPI_BR_INS )
365  set_pmds_to_write( ESI, EventIndex, MONT_ETB_REGS_MASK );
366  break;
367  default:
368  PAPIERROR( "PMU type %d is not supported by this component",
370  return ( PAPI_EBUG );
371  }
372 
373  *smpl_vaddr = ctx.ctx_arg.ctx_smpl_vaddr;
374 
375  return ( pfmw_create_ctx_common( thr_ctx ) );
376 }
memset(eventId, 0, size)
int errno
#define MONT_DEAR_REGS_MASK
Definition: perfmon-ia64.h:168
static int set_pmds_to_write(EventSetInfo_t *ESI, int index, unsigned long value)
Definition: perfmon-ia64.c:253
#define PAPI_ENOEVNT
Definition: fpapi.h:112
int fd
Definition: iozone.c:1291
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
return PAPI_OK
Definition: linux-nvml.c:458
static pid_t mygettid(void)
Definition: darwin-common.h:11
#define PAPI_BR_INS
Definition: fpapi.h:190
void *long long tid
Definition: iozone.c:18586
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
void PAPIERROR(char *format,...)
NativeInfo_t * NativeInfoArray
EventInfo_t * EventInfoArray
#define PAPI_ESYS
Definition: fpapi.h:108
again struct sockaddr sizeof(struct sockaddr_in))
int pos[PAPI_EVENTS_IN_DERIVED_EVENT]
#define BTB_REGS_MASK
Definition: perfmon-ia64.h:174
#define PAPI_EBUG
Definition: fpapi.h:111
#define DEAR_REGS_MASK
Definition: perfmon-ia64.h:173
#define PAPI_NATIVE_AND_MASK
unsigned int event_code
static int pfmw_create_ctx_common(hwd_context_t *ctx)
Definition: perfmon-ia64.c:162
static int _pfm_decode_native_event(unsigned int EventCode, unsigned int *event, unsigned int *umask)
#define MONT_ETB_REGS_MASK
Definition: perfmon-ia64.h:169

Here is the call graph for this function:

Here is the caller graph for this function:

static void pfmw_start ( hwd_context_t ctx)
static

Definition at line 87 of file perfmon-ia64.c.

88 {
89  pfm_self_start( ( ( ia64_context_t * ) ctx )->fd );
90 }
int fd
Definition: iozone.c:1291

Here is the caller graph for this function:

static void pfmw_stop ( hwd_context_t ctx)
static

Definition at line 93 of file perfmon-ia64.c.

94 {
95  pfm_self_stop( ( ( ia64_context_t * ) ctx )->fd );
96 }
int fd
Definition: iozone.c:1291

Here is the caller graph for this function:

static int pfmw_support_darr ( unsigned int  i)
static

Definition at line 445 of file perfmon-ia64.c.

446 {
447  switch ( _perfmon2_pfm_pmu_type ) {
448  case PFMLIB_ITANIUM_PMU:
449  return ( pfm_ita_support_darr( i ) );
450  break;
451  case PFMLIB_ITANIUM2_PMU:
452  return ( pfm_ita2_support_darr( i ) );
453  break;
454  case PFMLIB_MONTECITO_PMU:
455  return ( pfm_mont_support_darr( i ) );
456  break;
457  default:
458  PAPIERROR( "PMU type %d is not supported by this component",
460  return ( PAPI_EBUG );
461  }
462 }
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
int i
Definition: fileop.c:140
void PAPIERROR(char *format,...)
#define PAPI_EBUG
Definition: fpapi.h:111

Here is the call graph for this function:

Here is the caller graph for this function:

static int pfmw_support_iarr ( unsigned int  i)
static

Definition at line 465 of file perfmon-ia64.c.

466 {
467  switch ( _perfmon2_pfm_pmu_type ) {
468  case PFMLIB_ITANIUM_PMU:
469  return ( pfm_ita_support_iarr( i ) );
470  break;
471  case PFMLIB_ITANIUM2_PMU:
472  return ( pfm_ita2_support_iarr( i ) );
473  break;
474  case PFMLIB_MONTECITO_PMU:
475  return ( pfm_mont_support_iarr( i ) );
476  break;
477  default:
478  PAPIERROR( "PMU type %d is not supported by this component",
480  return ( PAPI_EBUG );
481  }
482 }
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
int i
Definition: fileop.c:140
void PAPIERROR(char *format,...)
#define PAPI_EBUG
Definition: fpapi.h:111

Here is the call graph for this function:

Here is the caller graph for this function:

static int pfmw_support_opcm ( unsigned int  i)
static

Definition at line 485 of file perfmon-ia64.c.

486 {
487  switch ( _perfmon2_pfm_pmu_type ) {
488  case PFMLIB_ITANIUM_PMU:
489  return ( pfm_ita_support_opcm( i ) );
490  break;
491  case PFMLIB_ITANIUM2_PMU:
492  return ( pfm_ita2_support_opcm( i ) );
493  break;
494  case PFMLIB_MONTECITO_PMU:
495  return ( pfm_mont_support_opcm( i ) );
496  break;
497  default:
498  PAPIERROR( "PMU type %d is not supported by this component",
500  return ( PAPI_EBUG );
501  }
502 }
static int _perfmon2_pfm_pmu_type
Definition: perfmon.c:50
int i
Definition: fileop.c:140
void PAPIERROR(char *format,...)
#define PAPI_EBUG
Definition: fpapi.h:111

Here is the call graph for this function:

Here is the caller graph for this function:

static int prepare_umask ( unsigned int  foo,
unsigned int values 
)
static

Definition at line 1385 of file perfmon-ia64.c.

1386 {
1387  unsigned int tmp = foo, i, j = 0;
1388 
1389  SUBDBG( "umask %#x\n", tmp );
1390  if ( foo == 0 )
1391  return 0;
1392  while ( ( i = ffs( tmp ) ) ) {
1393  tmp = tmp ^ ( 1 << ( i - 1 ) );
1394  values[j] = i - 1;
1395  SUBDBG( "umask %d is %d\n", j, values[j] );
1396  j++;
1397  }
1398  return ( j );
1399 }
int i
Definition: fileop.c:140
pthread_attr_t foo
Definition: iozone.c:18592
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
long j
Definition: iozone.c:19135
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
long long tmp
Definition: iozone.c:12031

Here is the caller graph for this function:

static int round_requested_ns ( int  ns)
static

Definition at line 2222 of file perfmon-ia64.c.

2223 {
2224  if ( ns < _papi_os_info.itimer_res_ns ) {
2226  } else {
2227  int leftover_ns = ns % _papi_os_info.itimer_res_ns;
2228  return ns + leftover_ns;
2229  }
2230 }
int ns
Definition: iozone.c:20358
PAPI_os_info_t _papi_os_info
Definition: aix.c:1210

Here is the caller graph for this function:

static char* search_cpu_info ( FILE *  f,
char *  search_str,
char *  line 
)
static

Definition at line 1700 of file perfmon-ia64.c.

1701 {
1702  /* This code courtesy of our friends in Germany. Thanks Rudolph Berrendorf! */
1703  /* See the PCL home page for the German version of PAPI. */
1704 
1705  char *s;
1706 
1707  while ( fgets( line, 256, f ) != NULL ) {
1708  if ( strstr( line, search_str ) != NULL ) {
1709  /* ignore all characters in line up to : */
1710  for ( s = line; *s && ( *s != ':' ); ++s );
1711  if ( *s )
1712  return ( s );
1713  }
1714  }
1715  return ( NULL );
1716 
1717  /* End stolen code */
1718 }
double f(double a)
Definition: cpi.c:23
s
Definition: iozone.c:20289
static int set_default_domain ( hwd_control_state_t this_state,
int  domain 
)
static

Definition at line 2004 of file perfmon-ia64.c.

2005 {
2006  return ( _ia64_set_domain( this_state, domain ) );
2007 }
int _ia64_set_domain(hwd_control_state_t *this_state, int domain)

Here is the call graph for this function:

Here is the caller graph for this function:

static int set_default_granularity ( hwd_control_state_t this_state,
int  granularity 
)
static

Definition at line 2010 of file perfmon-ia64.c.

2011 {
2012  return ( set_granularity( this_state, granularity ) );
2013 }
static int set_granularity(hwd_control_state_t *this_state, int domain