PAPI  5.3.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
aix.c File Reference
Include dependency graph for aix.c:

Go to the source code of this file.

Macros

#define START_OF_TEXT   &_text
 
#define END_OF_TEXT   &_etext
 
#define START_OF_DATA   &_data
 
#define END_OF_DATA   &_edata
 
#define START_OF_BSS   &_edata
 
#define END_OF_BSS   &_end
 

Functions

void aix_initialize_native_table ()
 
static void aix_ppc64_setup_gps (int total)
 
int aix_ppc64_setup_native_table ()
 
static void copy_value (unsigned int val, char *nam, char *names, unsigned int *values, int len)
 
static int do_counter_allocation (ppc64_reg_alloc_t *event_list, int size)
 
int _aix_allocate_registers (EventSetInfo_t *ESI)
 
int _aix_init_control_state (hwd_control_state_t *ptr)
 
int _aix_update_control_state (hwd_control_state_t *this_state, NativeInfo_t *native, int count, hwd_context_t *context)
 
static char * trim_string (char *in)
 
int _aix_ntv_code_to_name (unsigned int EventCode, char *ntv_name, int len)
 
int _aix_ntv_code_to_descr (unsigned int EventCode, char *ntv_descr, int len)
 
int _aix_ntv_code_to_bits (unsigned int EventCode, hwd_register_t *bits)
 
int _aix_ntv_enum_events (unsigned int *EventCode, int modifier)
 
static void set_config (hwd_control_state_t *ptr, int arg1, int arg2)
 
static void unset_config (hwd_control_state_t *ptr, int arg1)
 
int init_domain ()
 
static int _aix_set_domain (hwd_control_state_t *this_state, int domain)
 
int _aix_set_granularity (hwd_control_state_t *this_state, int domain)
 
static int set_default_domain (EventSetInfo_t *zero, int domain)
 
static int set_default_granularity (EventSetInfo_t *zero, int granularity)
 
int _aix_mdi_init ()
 
static int _aix_get_system_info (papi_mdi_t *mdi)
 
long long _aix_get_real_usec (void)
 
long long _aix_get_real_cycles (void)
 
long long _aix_get_virt_usec (void)
 
static void _aix_lock_init (void)
 
int _aix_shutdown_thread (hwd_context_t *ctx)
 
int _aix_init_component (int cidx)
 
int _aix_init_thread (hwd_context_t *context)
 
static int get_avail_hwcntr_bits (int cntr_avail_bits)
 
static void set_hwcntr_codes (int selector, unsigned char *from, int *to)
 
void dump_cmd (pm_prog_t *t)
 
void dump_data (long long *vals)
 
int _aix_reset (hwd_context_t *ESI, hwd_control_state_t *zero)
 
int _aix_read (hwd_context_t *ctx, hwd_control_state_t *spc, long long **vals, int flags)
 
static int round_requested_ns (int ns)
 
int _aix_ctl (hwd_context_t *ctx, int code, _papi_int_option_t *option)
 
void _aix_dispatch_timer (int signal, siginfo_t *si, void *i)
 
int _aix_set_overflow (EventSetInfo_t *ESI, int EventIndex, int threshold)
 
void_aix_get_overflow_address (void *context)
 
int _aix_start (hwd_context_t *ctx, hwd_control_state_t *cntrl)
 
int _aix_stop (hwd_context_t *ctx, hwd_control_state_t *cntrl)
 
int _aix_update_shlib_info (papi_mdi_t *mdi)
 
int _aix_ntv_name_to_code (char *name, unsigned int *evtcode)
 
int _papi_hwi_init_os (void)
 

Variables

papi_vector_t _aix_vector
 
volatile int lock_var [PAPI_MAX_LOCK] = { 0 }
 
atomic_p lock [PAPI_MAX_LOCK]
 
static int maxgroups = 0
 
struct utsname AixVer
 
native_event_entry_t native_table [PAPI_MAX_NATIVE_EVENTS]
 
hwd_pminfo_t pminfo
 
pm_groups_info_t pmgroups
 
PPC64_native_map_t native_name_map [PAPI_MAX_NATIVE_EVENTS]
 
hwd_groups_t group_map [MAX_GROUPS] = { 0 }
 
PAPI_os_info_t _papi_os_info
 
papi_os_vector_t _papi_os_vector
 

Macro Definition Documentation

#define END_OF_BSS   &_end

Definition at line 36 of file aix.c.

#define END_OF_DATA   &_edata

Definition at line 34 of file aix.c.

#define END_OF_TEXT   &_etext

Definition at line 32 of file aix.c.

#define START_OF_BSS   &_edata

Definition at line 35 of file aix.c.

#define START_OF_DATA   &_data

Definition at line 33 of file aix.c.

#define START_OF_TEXT   &_text

Definition at line 31 of file aix.c.

Function Documentation

int _aix_allocate_registers ( EventSetInfo_t ESI)

Definition at line 201 of file aix.c.

202 {
203  hwd_control_state_t *this_state = ESI->ctl_state;
204  unsigned char selector;
205  int i, j, natNum, index;
206  ppc64_reg_alloc_t event_list[MAX_COUNTERS];
207  int position, group;
208 
209 
210  /* not yet successfully mapped, but have enough slots for events */
211 
212  /* Initialize the local structure needed
213  for counter allocation and optimization. */
214  natNum = ESI->NativeCount;
215  for ( i = 0; i < natNum; i++ ) {
216  /* CAUTION: Since this is in the hardware layer, it's ok
217  to access the native table directly, but in general this is a bad idea */
218  event_list[i].ra_position = -1;
219  /* calculate native event rank, which is number of counters it can live on, this is power3 specific */
220  for ( j = 0; j < MAX_COUNTERS; j++ ) {
221  if ( ( index =
223  ni_event & PAPI_NATIVE_AND_MASK].index ) <
224  0 )
225  return PAPI_ECNFLCT;
226  event_list[i].ra_counter_cmd[j] =
228  }
229  for ( j = 0; j < GROUP_INTS; j++ ) {
230  if ( ( index =
232  ni_event & PAPI_NATIVE_AND_MASK].index ) <
233  0 )
234  return PAPI_ECNFLCT;
235  event_list[i].ra_group[j] = native_table[index].resources.group[j];
236  }
237  /*event_list[i].ra_mod = -1; */
238  }
239 
240  if ( ( group = do_counter_allocation( event_list, natNum ) ) >= 0 ) { /* successfully mapped */
241  /* copy counter allocations info back into NativeInfoArray */
242  this_state->group_id = group;
243  for ( i = 0; i < natNum; i++ )
244  ESI->NativeInfoArray[i].ni_position = event_list[i].ra_position;
245  /* update the control structure based on the NativeInfoArray */
246  /*_papi_hwd_update_control_state(this_state, ESI->NativeInfoArray, natNum);*/
247  return PAPI_OK;
248  } else {
249  return PAPI_ECNFLCT;
250  }
251 }
PPC64_native_map_t native_name_map[PAPI_MAX_NATIVE_EVENTS]
Definition: aix.c:46
static int do_counter_allocation(ppc64_reg_alloc_t *event_list, int size)
Definition: aix.c:160
#define MAX_COUNTERS
Definition: perfctr-x86.h:8
return PAPI_OK
Definition: linux-nvml.c:458
#define PAPI_ECNFLCT
Definition: fpapi.h:113
int ra_position
Definition: aix.h:98
int i
Definition: fileop.c:140
native_event_entry_t native_table[PAPI_MAX_NATIVE_EVENTS]
Definition: aix.c:41
int ra_counter_cmd[MAX_COUNTERS]
Definition: aix.h:100
#define GROUP_INTS
NativeInfo_t * NativeInfoArray
unsigned int ra_group[GROUP_INTS]
Definition: aix.h:99
#define PAPI_NATIVE_AND_MASK
X86_register_t resources
Definition: perfctr-x86.h:137
hwd_control_state_t * ctl_state
long j
Definition: iozone.c:19135

Here is the call graph for this function:

int _aix_ctl ( hwd_context_t ctx,
int  code,
_papi_int_option_t option 
)

Definition at line 874 of file aix.c.

875 {
876  switch ( code ) {
877 /* I don't understand what it means to set the default domain
878  case PAPI_DEFDOM:
879  return(set_default_domain(zero, option->domain.domain));
880 */
881  case PAPI_DOMAIN:
882  return ( _aix_set_domain
883  ( option->domain.ESI->ctl_state, option->domain.domain ) );
884 /* I don't understand what it means to set the default granularity
885  case PAPI_DEFGRN:
886  return(set_default_granularity(zero, option->granularity.granularity));
887 */
888  case PAPI_GRANUL:
889  return ( _aix_set_granularity
890  ( option->domain.ESI->ctl_state,
891  option->granularity.granularity ) );
892 #if 0
893  case PAPI_INHERIT:
894  return ( set_inherit( option->inherit.inherit ) );
895 #endif
896  case PAPI_DEF_ITIMER:
897  {
898  /* flags are currently ignored, eventually the flags will be able
899  to specify whether or not we use POSIX itimers (clock_gettimer) */
900  if ( ( option->itimer.itimer_num == ITIMER_REAL ) &&
901  ( option->itimer.itimer_sig != SIGALRM ) )
902  return PAPI_EINVAL;
903  if ( ( option->itimer.itimer_num == ITIMER_VIRTUAL ) &&
904  ( option->itimer.itimer_sig != SIGVTALRM ) )
905  return PAPI_EINVAL;
906  if ( ( option->itimer.itimer_num == ITIMER_PROF ) &&
907  ( option->itimer.itimer_sig != SIGPROF ) )
908  return PAPI_EINVAL;
909  if ( option->itimer.ns > 0 )
910  option->itimer.ns = round_requested_ns( option->itimer.ns );
911  /* At this point, we assume the user knows what he or
912  she is doing, they maybe doing something arch specific */
913  return PAPI_OK;
914  }
915  case PAPI_DEF_MPX_NS:
916  {
917  option->multiplex.ns = round_requested_ns( option->multiplex.ns );
918  return ( PAPI_OK );
919  }
920  case PAPI_DEF_ITIMER_NS:
921  {
922  option->itimer.ns = round_requested_ns( option->itimer.ns );
923  return ( PAPI_OK );
924  }
925  default:
926  return ( PAPI_ENOSUPP );
927  }
928 }
_papi_int_inherit_t inherit
#define PAPI_DEF_ITIMER_NS
Definition: papi.h:453
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
#define PAPI_ENOSUPP
Definition: fpapi.h:123
_papi_int_granularity_t granularity
EventSetInfo_t * ESI
#define PAPI_DOMAIN
Definition: fpapi.h:50
#define PAPI_GRANUL
Definition: fpapi.h:52
_papi_int_multiplex_t multiplex
#define PAPI_DEF_MPX_NS
Definition: fpapi.h:53
int _aix_set_granularity(hwd_control_state_t *this_state, int domain)
Definition: aix.c:486
static int set_inherit(int arg)
Definition: perfmon.c:724
static int round_requested_ns(int ns)
Definition: aix.c:863
#define PAPI_DEF_ITIMER
Definition: papi.h:452
_papi_int_domain_t domain
hwd_control_state_t * ctl_state
static int _aix_set_domain(hwd_control_state_t *this_state, int domain)
Definition: aix.c:436

Here is the call graph for this function:

void _aix_dispatch_timer ( int  signal,
siginfo_t *  si,
void i 
)

Definition at line 931 of file aix.c.

932 {
934  ThreadInfo_t *t = NULL;
935  caddr_t address;
936 
937  ctx.si = si;
938  ctx.ucontext = ( hwd_ucontext_t * ) i;
939 
940  address = ( caddr_t ) GET_OVERFLOW_ADDRESS( ( &ctx ) );
941  _papi_hwi_dispatch_overflow_signal( ( void * ) &ctx, address, NULL, 0, 0,
943 }
papi_vector_t _aix_vector
Definition: aix.c:21
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
t
Definition: iozone.c:23562
int i
Definition: fileop.c:140
hwd_ucontext_t * ucontext
struct sigcontext hwd_ucontext_t
Definition: aix-context.h:10
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
#define GET_OVERFLOW_ADDRESS(ctx)
Definition: aix-context.h:12

Here is the call graph for this function:

void* _aix_get_overflow_address ( void context)

Definition at line 954 of file aix.c.

955 {
956  void *location;
957  struct sigcontext *info = ( struct sigcontext * ) context;
958  location = ( void * ) info->sc_jmpbuf.jmp_context.iar;
959 
960  return ( location );
961 }
return
Definition: iozone.c:22170
long long _aix_get_real_cycles ( void  )

Definition at line 666 of file aix.c.

667 {
668  return ( _aix_get_real_usec( ) *
669  ( long long ) _papi_hwi_system_info.hw_info.cpu_max_mhz );
670 }
papi_mdi_t _papi_hwi_system_info
Definition: papi_internal.c:57
PAPI_hw_info_t hw_info
int cpu_max_mhz
Definition: papi.h:791
long long _aix_get_real_usec(void)
Definition: aix.c:654

Here is the call graph for this function:

long long _aix_get_real_usec ( void  )

Definition at line 654 of file aix.c.

655 {
656  timebasestruct_t t;
657  long long retval;
658 
659  read_real_time( &t, TIMEBASE_SZ );
660  time_base_to_time( &t, TIMEBASE_SZ );
661  retval = ( t.tb_high * 1000000 ) + t.tb_low / 1000;
662  return ( retval );
663 }
t
Definition: iozone.c:23562
return
Definition: iozone.c:22170
ssize_t retval
Definition: libasync.c:338

Here is the caller graph for this function:

static int _aix_get_system_info ( papi_mdi_t mdi)
static

Definition at line 560 of file aix.c.

561 {
562  int retval;
563  /* pm_info_t pminfo; */
564  struct procsinfo psi = { 0 };
565  pid_t pid;
566  char maxargs[PAPI_HUGE_STR_LEN];
567  char pname[PAPI_HUGE_STR_LEN];
568 
569  pid = getpid( );
570  if ( pid == -1 )
571  return ( PAPI_ESYS );
573  psi.pi_pid = pid;
574  retval = getargs( &psi, sizeof ( psi ), maxargs, PAPI_HUGE_STR_LEN );
575  if ( retval == -1 )
576  return ( PAPI_ESYS );
577 
578  if ( realpath( maxargs, pname ) )
579  strncpy( _papi_hwi_system_info.exe_info.fullname, pname,
581  else
582  strncpy( _papi_hwi_system_info.exe_info.fullname, maxargs,
584 
586  basename( maxargs ) );
587 
588 #ifdef _POWER7
589  /* we pass PM_POWER7 for the same reasons as below (power6 case) */
590  retval = pm_initialize( PM_INIT_FLAGS , &pminfo, &pmgroups, PM_POWER7);
591 #elif defined(_POWER6)
592  /* problem with pm_initialize(): it cannot be called multiple times with
593  PM_CURRENT; use instead the actual proc type - here PM_POWER6 -
594  and multiple invocations are no longer a problem */
595  retval = pm_initialize( PM_INIT_FLAGS, &pminfo, &pmgroups, PM_POWER6 );
596 #else
597 #ifdef _AIXVERSION_510
598 #ifdef PM_INITIALIZE
599  SUBDBG( "Calling AIX 5 version of pm_initialize...\n" );
600 /*#if defined(_POWER5)
601  retval = pm_initialize(PM_INIT_FLAGS, &pminfo, &pmgroups, PM_POWER5);
602 #endif*/
603  retval = pm_initialize( PM_INIT_FLAGS, &pminfo, &pmgroups, PM_CURRENT );
604 #else
605  SUBDBG( "Calling AIX 5 version of pm_init...\n" );
606  retval = pm_init( PM_INIT_FLAGS, &pminfo, &pmgroups );
607 #endif
608 
609 #else
610  SUBDBG( "Calling AIX 4 version of pm_init...\n" );
611  retval = pm_init( PM_INIT_FLAGS, &pminfo );
612 #endif
613 #endif
614  SUBDBG( "...Back from pm_init\n" );
615 
616  if ( retval > 0 )
617  return ( retval );
618 
619  _aix_mdi_init( );
620 
622  _papi_hwi_system_info.hw_info.ncpu = _system_configuration.ncpus;
628  _papi_hwi_system_info.hw_info.model = _system_configuration.implementation;
631  ( float ) _system_configuration.version;
632  _papi_hwi_system_info.hw_info.mhz = ( float ) ( pm_cycles( ) / 1000000.0 );
635 
636 /* _papi_hwi_system_info.num_gp_cntrs = pminfo.maxpmcs;*/
638  _aix_vector.cmp_info.num_mpx_cntrs = MAX_MPX_COUNTERS; // pminfo.maxpmcs,
639 
641 /* This field doesn't appear to exist in the PAPI 3.0 structure
642  _papi_hwi_system_info.cpunum = mycpu();
643 */
645  return PAPI_OK;
646 }
char name[PAPI_HUGE_STR_LEN]
Definition: papi.h:691
#define PAPI_HUGE_STR_LEN
Definition: fpapi.h:42
int available_granularities
Definition: papi.h:642
papi_vector_t _aix_vector
Definition: aix.c:21
int cpu_min_mhz
Definition: papi.h:792
return PAPI_OK
Definition: linux-nvml.c:458
#define MAX_MPX_COUNTERS
Definition: aix.h:45
PAPI_exe_info_t exe_info
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
hwd_pminfo_t pminfo
Definition: aix.c:43
int _aix_mdi_init()
Definition: aix.c:526
float mhz
Definition: papi.h:802
float revision
Definition: papi.h:786
static int pid
pm_groups_info_t pmgroups
Definition: aix.c:44
PAPI_address_map_t address_info
Definition: papi.h:704
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
int nnodes
Definition: papi.h:780
int init_domain()
Definition: aix.c:420
#define PAPI_ESYS
Definition: fpapi.h:108
char vendor_string[PAPI_MAX_STR_LEN]
Definition: papi.h:783
papi_mdi_t _papi_hwi_system_info
Definition: papi_internal.c:57
strcpy(filename, default_filename)
PAPI_hw_info_t hw_info
int vendor
Definition: papi.h:782
int model
Definition: papi.h:784
int cpu_max_mhz
Definition: papi.h:791
int totalcpus
Definition: papi.h:781
char model_string[PAPI_MAX_STR_LEN]
Definition: papi.h:785
char fullname[PAPI_HUGE_STR_LEN]
Definition: papi.h:703
ssize_t retval
Definition: libasync.c:338
#define PM_INIT_FLAGS
Definition: aix.h:75
#define PAPI_GRN_THR
Definition: fpapi.h:67
int ncpu
Definition: papi.h:776

Here is the call graph for this function:

long long _aix_get_virt_usec ( void  )

Definition at line 673 of file aix.c.

674 {
675  long long retval;
676  struct tms buffer;
677 
678  times( &buffer );
679  SUBDBG( "user %d system %d\n", ( int ) buffer.tms_utime,
680  ( int ) buffer.tms_stime );
681  retval =
682  ( long long ) ( ( buffer.tms_utime + buffer.tms_stime ) *
683  ( 1000000 / CLK_TCK ) );
684  return ( retval );
685 }
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
long long
Definition: iozone.c:19827
char * buffer
Definition: iozone.c:1366
ssize_t retval
Definition: libasync.c:338
int _aix_init_component ( int  cidx)

Definition at line 702 of file aix.c.

703 {
704  int retval = PAPI_OK, procidx;
705 
706  /* Fill in what we can of the papi_system_info. */
708  if ( retval )
709  return ( retval );
710 
711  /* Setup memory info */
713  if ( retval )
714  return ( retval );
715 
716  SUBDBG( "Found %d %s %s CPUs at %d Mhz.\n",
721 
724 
725  procidx = pm_get_procindex( );
726  switch ( procidx ) {
727  case PM_POWER5:
728  _papi_load_preset_table( "POWER5", 0, cidx );
729  break;
730  case PM_POWER5_II:
731  _papi_load_preset_table( "POWER5+", 0, cidx );
732  break;
733  case PM_POWER6:
734  _papi_load_preset_table( "POWER6", 0, cidx );
735  break;
736  case PM_PowerPC970:
737  _papi_load_preset_table( "PPC970", 0, cidx );
738  break;
739  case PM_POWER7:
740  _papi_load_preset_table( "POWER7", 0, cidx );
741  break;
742  default:
743  fprintf( stderr, "%s is not supported!\n", pminfo.proc_name );
744  return PAPI_ENOIMPL;
745  }
746 
747  _aix_lock_init( );
748 
749  return ( retval );
750 }
#define PAPI_ENOIMPL
Definition: fpapi.h:124
papi_vector_t _aix_vector
Definition: aix.c:21
static void _aix_lock_init(void)
Definition: aix.c:688
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
hwd_pminfo_t pminfo
Definition: aix.c:43
papi_os_vector_t _papi_os_vector
Definition: aix.c:1288
static int cidx
Definition: event_info.c:40
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
int aix_ppc64_setup_native_table()
Definition: aix.c:106
int _papi_load_preset_table(char *pmu_str, int pmu_type, int cidx)
Definition: papi_preset.c:299
char vendor_string[PAPI_MAX_STR_LEN]
Definition: papi.h:783
papi_mdi_t _papi_hwi_system_info
Definition: papi_internal.c:57
PAPI_hw_info_t hw_info
int(* get_system_info)(papi_mdi_t *mdi)
Definition: papi_vector.h:68
int cpu_max_mhz
Definition: papi.h:791
int totalcpus
Definition: papi.h:781
char model_string[PAPI_MAX_STR_LEN]
Definition: papi.h:785
ssize_t retval
Definition: libasync.c:338
int(* get_memory_info)(PAPI_hw_info_t *, int)
Definition: papi_vector.h:69

Here is the call graph for this function:

int _aix_init_control_state ( hwd_control_state_t ptr)

Definition at line 254 of file aix.c.

255 {
256  int i;
257 
258  for ( i = 0; i < _aix_vector.cmp_info.num_cntrs; i++ ) {
259  ptr->counter_cmd.events[i] = COUNT_NOTHING;
260  }
261  ptr->counter_cmd.mode.b.is_group = 1;
262 
265  /*setup_native_table(); */
266  return ( PAPI_OK );
267 }
papi_vector_t _aix_vector
Definition: aix.c:21
int default_granularity
Definition: papi.h:641
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
int i
Definition: fileop.c:140
int(* set_domain)(hwd_control_state_t *, int)
Definition: papi_vector.h:42
int _aix_set_granularity(hwd_control_state_t *this_state, int domain)
Definition: aix.c:486
papi_cpc_event_t counter_cmd
Definition: solaris-ultra.h:61

Here is the call graph for this function:

Here is the caller graph for this function:

int _aix_init_thread ( hwd_context_t context)

Definition at line 754 of file aix.c.

755 {
756  int retval;
757  /* Initialize our global control state. */
758 
759  _aix_init_control_state( &context->cntrl );
760 }
int _aix_init_control_state(hwd_control_state_t *ptr)
Definition: aix.c:254
ssize_t retval
Definition: libasync.c:338

Here is the call graph for this function:

static void _aix_lock_init ( void  )
static

Definition at line 688 of file aix.c.

689 {
690  int i;
691  for ( i = 0; i < PAPI_MAX_LOCK; i++ )
692  lock[i] = ( int * ) ( lock_var + i );
693 }
volatile int lock_var[PAPI_MAX_LOCK]
Definition: aix.c:24
#define PAPI_MAX_LOCK
Definition: papi_lock.h:18
int i
Definition: fileop.c:140
atomic_p lock[]
Definition: aix.c:25

Here is the caller graph for this function:

int _aix_mdi_init ( )

Definition at line 526 of file aix.c.

527 {
528  int retval;
529 
530  if ( ( retval = uname( &AixVer ) ) < 0 )
531  return ( PAPI_ESYS );
532  if ( AixVer.version[0] == '4' ) {
534  ( caddr_t ) START_OF_TEXT;
536  ( caddr_t ) END_OF_TEXT;
538  ( caddr_t ) START_OF_DATA;
540  ( caddr_t ) END_OF_DATA;
542  ( caddr_t ) START_OF_BSS;
544  ( caddr_t ) END_OF_BSS;
545  } else {
547  }
548 
549 /* _papi_hwi_system_info.supports_64bit_counters = 1;
550  _papi_hwi_system_info.supports_real_usec = 1;
551  _papi_hwi_system_info.sub_info.fast_real_timer = 1;
552  _papi_hwi_system_info.sub_info->available_domains = init_domain();*/
553 
554 
555  return ( PAPI_OK );
556 }
#define START_OF_TEXT
Definition: aix.c:31
caddr_t text_end
Definition: papi.h:693
return PAPI_OK
Definition: linux-nvml.c:458
caddr_t bss_start
Definition: papi.h:696
PAPI_exe_info_t exe_info
struct utsname AixVer
Definition: aix.c:39
caddr_t text_start
Definition: papi.h:692
PAPI_address_map_t address_info
Definition: papi.h:704
#define END_OF_BSS
Definition: aix.c:36
#define END_OF_TEXT
Definition: aix.c:32
#define START_OF_DATA
Definition: aix.c:33
int _aix_update_shlib_info(papi_mdi_t *mdi)
Definition: aix.c:1046
#define PAPI_ESYS
Definition: fpapi.h:108
papi_mdi_t _papi_hwi_system_info
Definition: papi_internal.c:57
caddr_t data_start
Definition: papi.h:694
caddr_t bss_end
Definition: papi.h:697
caddr_t data_end
Definition: papi.h:695
#define END_OF_DATA
Definition: aix.c:34
#define START_OF_BSS
Definition: aix.c:35
ssize_t retval
Definition: libasync.c:338

Here is the call graph for this function:

Here is the caller graph for this function:

int _aix_ntv_code_to_bits ( unsigned int  EventCode,
hwd_register_t bits 
)

Definition at line 348 of file aix.c.

349 {
350  bits = &native_table[EventCode & PAPI_NATIVE_AND_MASK].resources; /* it is not right, different type */
351  return ( PAPI_OK );
352 }
return PAPI_OK
Definition: linux-nvml.c:458
native_event_entry_t native_table[PAPI_MAX_NATIVE_EVENTS]
Definition: aix.c:41
#define PAPI_NATIVE_AND_MASK
X86_register_t resources
Definition: perfctr-x86.h:137
int _aix_ntv_code_to_descr ( unsigned int  EventCode,
char *  ntv_descr,
int  len 
)

Definition at line 330 of file aix.c.

331 {
332  if ( ( EventCode & PAPI_NATIVE_AND_MASK ) >=
334  return ( PAPI_ENOEVNT );
335  strncpy( ntv_descr,
336  native_table[native_name_map[EventCode & PAPI_NATIVE_AND_MASK].
337  index].description, len );
338  trim_string( ntv_descr );
339  if ( strlen
340  ( native_table
341  [native_name_map[EventCode & PAPI_NATIVE_AND_MASK].index].
342  description ) > len - 1 )
343  return ( PAPI_EBUF );
344  return ( PAPI_OK );
345 }
PPC64_native_map_t native_name_map[PAPI_MAX_NATIVE_EVENTS]
Definition: aix.c:46
papi_vector_t _aix_vector
Definition: aix.c:21
#define PAPI_ENOEVNT
Definition: fpapi.h:112
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
native_event_entry_t native_table[PAPI_MAX_NATIVE_EVENTS]
Definition: aix.c:41
static char * trim_string(char *in)
Definition: aix.c:289
#define PAPI_EBUF
Definition: fpapi.h:125
#define PAPI_NATIVE_AND_MASK

Here is the call graph for this function:

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

Definition at line 315 of file aix.c.

316 {
317  if ( ( EventCode & PAPI_NATIVE_AND_MASK ) >=
319  return ( PAPI_ENOEVNT );
320  strncpy( ntv_name,
321  native_name_map[EventCode & PAPI_NATIVE_AND_MASK].name, len );
322  trim_string( ntv_name );
323  if ( strlen( native_name_map[EventCode & PAPI_NATIVE_AND_MASK].name ) >
324  len - 1 )
325  return ( PAPI_EBUF );
326  return ( PAPI_OK );
327 }
PPC64_native_map_t native_name_map[PAPI_MAX_NATIVE_EVENTS]
Definition: aix.c:46
papi_vector_t _aix_vector
Definition: aix.c:21
#define PAPI_ENOEVNT
Definition: fpapi.h:112
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
static char * trim_string(char *in)
Definition: aix.c:289
char * name
Definition: iozone.c:23648
#define PAPI_EBUF
Definition: fpapi.h:125
#define PAPI_NATIVE_AND_MASK

Here is the call graph for this function:

int _aix_ntv_enum_events ( unsigned int EventCode,
int  modifier 
)

Definition at line 366 of file aix.c.

367 {
368  if ( modifier == PAPI_ENUM_FIRST ) {
369  *EventCode = PAPI_NATIVE_MASK;
370  return ( PAPI_OK );
371  }
372  if ( modifier == PAPI_ENUM_EVENTS ) {
373  int index = *EventCode & PAPI_NATIVE_AND_MASK;
374 
375  if ( native_table[index + 1].resources.selector ) {
376  *EventCode = *EventCode + 1;
377  return ( PAPI_OK );
378  } else
379  return ( PAPI_ENOEVNT );
380  } else if ( modifier == PAPI_NTV_ENUM_GROUPS ) {
381 #if defined(_POWER5) || defined(_POWER6)
382  unsigned int group =
383  ( *EventCode & PAPI_NTV_GROUP_AND_MASK ) >> PAPI_NTV_GROUP_SHIFT;
384  int index = *EventCode & 0x000000FF;
385  int i;
386  unsigned int tmpg;
387 
388  *EventCode = *EventCode & ( ~PAPI_NTV_GROUP_SHIFT );
389  for ( i = 0; i < GROUP_INTS; i++ ) {
390  tmpg = native_table[index].resources.group[i];
391  if ( group != 0 ) {
392  while ( ( ffs( tmpg ) + i * 32 ) <= group && tmpg != 0 )
393  tmpg = tmpg ^ ( 1 << ( ffs( tmpg ) - 1 ) );
394  }
395  if ( tmpg != 0 ) {
396  group = ffs( tmpg ) + i * 32;
397  *EventCode = *EventCode | ( group << PAPI_NTV_GROUP_SHIFT );
398  return ( PAPI_OK );
399  }
400  }
401 #endif
402  return ( PAPI_ENOEVNT );
403  } else
404  return ( PAPI_EINVAL );
405 }
#define PAPI_NATIVE_MASK
#define PAPI_ENOEVNT
Definition: fpapi.h:112
return PAPI_OK
Definition: linux-nvml.c:458
return PAPI_EINVAL
Definition: linux-nvml.c:408
int i
Definition: fileop.c:140
#define PAPI_NTV_GROUP_SHIFT
Definition: papi.h:523
native_event_entry_t native_table[PAPI_MAX_NATIVE_EVENTS]
Definition: aix.c:41
#define GROUP_INTS
#define PAPI_NTV_GROUP_AND_MASK
Definition: papi.h:522
#define PAPI_NATIVE_AND_MASK
X86_register_t resources
Definition: perfctr-x86.h:137
int _aix_ntv_name_to_code ( char *  name,
unsigned int evtcode 
)

Definition at line 1196 of file aix.c.

1197 {
1198  int i;
1199 
1200  for ( i = 0; i < PAPI_MAX_NATIVE_EVENTS; i++ )
1201  if ( strcmp( name, native_name_map[i].name ) == 0 ) {
1202  *evtcode = native_name_map[i].index | PAPI_NATIVE_MASK;
1203  return PAPI_OK;
1204  }
1205 
1206  return PAPI_ENOEVNT;
1207 }
#define PAPI_NATIVE_MASK
PPC64_native_map_t native_name_map[PAPI_MAX_NATIVE_EVENTS]
Definition: aix.c:46
#define PAPI_ENOEVNT
Definition: fpapi.h:112
return PAPI_OK
Definition: linux-nvml.c:458
int i
Definition: fileop.c:140
char * name
Definition: iozone.c:23648
#define PAPI_MAX_NATIVE_EVENTS
int _aix_read ( hwd_context_t ctx,
hwd_control_state_t spc,
long long **  vals,
int  flags 
)

Definition at line 840 of file aix.c.

842 {
843  int retval;
844 
845  retval = pm_get_data_mythread( &spc->state );
846  if ( retval > 0 ) {
848  pm_error( "PAPI Error: pm_get_data_mythread", retval );
849  return ( retval );
850  }
851 
852  *vals = spc->state.accu;
853 
854 #ifdef DEBUG
855  if ( ISLEVEL( DEBUG_SUBSTRATE ) )
856  dump_data( *vals );
857 #endif
858 
859  return ( PAPI_OK );
860 }
return PAPI_OK
Definition: linux-nvml.c:458
void dump_data(long long *vals)
Definition: aix.c:816
int _papi_hwi_error_level
Definition: papi_internal.c:55
#define PAPI_QUIET
Definition: fpapi.h:38
#define ISLEVEL(a)
Definition: papi_debug.h:54
ssize_t retval
Definition: libasync.c:338
#define DEBUG_SUBSTRATE
Definition: papi_debug.h:27

Here is the call graph for this function:

int _aix_reset ( hwd_context_t ESI,
hwd_control_state_t zero 
)

Definition at line 827 of file aix.c.

828 {
829  int retval = pm_reset_data_mythread( );
830  if ( retval > 0 ) {
832  pm_error( "PAPI Error: pm_reset_data_mythread", retval );
833  return ( retval );
834  }
835  return ( PAPI_OK );
836 }
return PAPI_OK
Definition: linux-nvml.c:458
int _papi_hwi_error_level
Definition: papi_internal.c:55
#define PAPI_QUIET
Definition: fpapi.h:38
ssize_t retval
Definition: libasync.c:338
static int _aix_set_domain ( hwd_control_state_t this_state,
int  domain 
)
static

Definition at line 436 of file aix.c.

437 {
438  pm_mode_t *mode = &( this_state->counter_cmd.mode );
439  int did = 0;
440 
441  mode->b.user = 0;
442  mode->b.kernel = 0;
443  if ( domain & PAPI_DOM_USER ) {
444  did++;
445  mode->b.user = 1;
446  }
447  if ( domain & PAPI_DOM_KERNEL ) {
448  did++;
449  mode->b.kernel = 1;
450  }
451 #ifdef PM_INITIALIZE
452 #ifdef _AIXVERSION_510
453  if ( ( domain & PAPI_DOM_SUPERVISOR ) && pminfo.proc_feature.b.hypervisor ) {
454  did++;
455  mode->b.hypervisor = 1;
456  }
457 #endif
458 #endif
459  if ( did )
460  return ( PAPI_OK );
461  else
462  return ( PAPI_EINVAL );
463 /*
464  switch (domain)
465  {
466  case PAPI_DOM_USER:
467  mode->b.user = 1;
468  mode->b.kernel = 0;
469  break;
470  case PAPI_DOM_KERNEL:
471  mode->b.user = 0;
472  mode->b.kernel = 1;
473  break;
474  case PAPI_DOM_ALL:
475  mode->b.user = 1;
476  mode->b.kernel = 1;
477  break;
478  default:
479  return(PAPI_EINVAL);
480  }
481  return(PAPI_OK);
482 */
483 }
return PAPI_OK
Definition: linux-nvml.c:458
#define PAPI_DOM_KERNEL
Definition: fpapi.h:22
return PAPI_EINVAL
Definition: linux-nvml.c:408
hwd_pminfo_t pminfo
Definition: aix.c:43
#define PAPI_DOM_SUPERVISOR
Definition: fpapi.h:24
#define PAPI_DOM_USER
Definition: fpapi.h:21
papi_cpc_event_t counter_cmd
Definition: solaris-ultra.h:61

Here is the caller graph for this function:

int _aix_set_granularity ( hwd_control_state_t this_state,
int  domain 
)

Definition at line 486 of file aix.c.

487 {
488  pm_mode_t *mode = &( this_state->counter_cmd.mode );
489 
490  switch ( domain ) {
491  case PAPI_GRN_THR:
492  mode->b.process = 0;
493  mode->b.proctree = 0;
494  break;
495  /* case PAPI_GRN_PROC:
496  mode->b.process = 1;
497  mode->b.proctree = 0;
498  break;
499  case PAPI_GRN_PROCG:
500  mode->b.process = 0;
501  mode->b.proctree = 1;
502  break; */
503  default:
504  return ( PAPI_EINVAL );
505  }
506  return ( PAPI_OK );
507 }
return PAPI_OK
Definition: linux-nvml.c:458
return PAPI_EINVAL
Definition: linux-nvml.c:408
#define PAPI_GRN_THR
Definition: fpapi.h:67
papi_cpc_event_t counter_cmd
Definition: solaris-ultra.h:61

Here is the caller graph for this function:

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

Definition at line 946 of file aix.c.

947 {
948  hwd_control_state_t *this_state = ESI->ctl_state;
949 
950  return ( PAPI_OK );
951 }
return PAPI_OK
Definition: linux-nvml.c:458
hwd_control_state_t * ctl_state
int _aix_shutdown_thread ( hwd_context_t ctx)

Definition at line 696 of file aix.c.

697 {
698  return ( PAPI_OK );
699 }
return PAPI_OK
Definition: linux-nvml.c:458
int _aix_start ( hwd_context_t ctx,
hwd_control_state_t cntrl 
)

Definition at line 967 of file aix.c.

968 {
969  int i, retval;
970  hwd_control_state_t *current_state = &ctx->cntrl;
971 
972  /* If we are nested, merge the global counter structure
973  with the current eventset */
974 
975  SUBDBG( "Start\n" );
976 
977  /* Copy the global counter structure to the current eventset */
978 
979  SUBDBG( "Copying states\n" );
980  memcpy( current_state, cntrl, sizeof ( hwd_control_state_t ) );
981 
982  retval = pm_set_program_mythread( &current_state->counter_cmd );
983  if ( retval > 0 ) {
984  if ( retval == 13 ) {
985  retval = pm_delete_program_mythread( );
986  if ( retval > 0 ) {
988  pm_error( "PAPI Error: pm_delete_program_mythread",
989  retval );
990  return ( retval );
991  }
992  retval = pm_set_program_mythread( &current_state->counter_cmd );
993  if ( retval > 0 ) {
995  pm_error( "PAPI Error: pm_set_program_mythread", retval );
996  return ( retval );
997  }
998  } else {
1000  pm_error( "PAPI Error: pm_set_program_mythread", retval );
1001  return ( retval );
1002  }
1003  }
1004 
1005  /* Set up the new merged control structure */
1006 
1007 #if 0
1008  dump_cmd( &current_state->counter_cmd );
1009 #endif
1010 
1011  /* Start the counters */
1012 
1013  retval = pm_start_mythread( );
1014  if ( retval > 0 ) {
1016  pm_error( "pm_start_mythread()", retval );
1017  return ( retval );
1018  }
1019 
1020  return ( PAPI_OK );
1021 }
return PAPI_OK
Definition: linux-nvml.c:458
int i
Definition: fileop.c:140
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
int _papi_hwi_error_level
Definition: papi_internal.c:55
#define PAPI_QUIET
Definition: fpapi.h:38
ssize_t retval
Definition: libasync.c:338
void dump_cmd(pm_prog_t *t)
Definition: aix.c:795
papi_cpc_event_t counter_cmd
Definition: solaris-ultra.h:61

Here is the call graph for this function:

int _aix_stop ( hwd_context_t ctx,
hwd_control_state_t cntrl 
)

Definition at line 1024 of file aix.c.

1025 {
1026  int retval;
1027 
1028  retval = pm_stop_mythread( );
1029  if ( retval > 0 ) {
1031  pm_error( "pm_stop_mythread()", retval );
1032  return ( retval );
1033  }
1034 
1035  retval = pm_delete_program_mythread( );
1036  if ( retval > 0 ) {
1038  pm_error( "pm_delete_program_mythread()", retval );
1039  return ( retval );
1040  }
1041 
1042  return ( PAPI_OK );
1043 }
return PAPI_OK
Definition: linux-nvml.c:458
int _papi_hwi_error_level
Definition: papi_internal.c:55
#define PAPI_QUIET
Definition: fpapi.h:38
ssize_t retval
Definition: libasync.c:338
int _aix_update_control_state ( hwd_control_state_t this_state,
NativeInfo_t native,
int  count,
hwd_context_t context 
)

Definition at line 273 of file aix.c.

276 {
277 
278  this_state->counter_cmd.events[0] = this_state->group_id;
279  return PAPI_OK;
280 }
return PAPI_OK
Definition: linux-nvml.c:458
papi_cpc_event_t counter_cmd
Definition: solaris-ultra.h:61
int _aix_update_shlib_info ( papi_mdi_t mdi)

Definition at line 1046 of file aix.c.

1047 {
1048 #if ( ( defined( _AIXVERSION_510) || defined(_AIXVERSION_520)))
1049  struct ma_msg_s
1050  {
1051  long flag;
1052  char *name;
1053  } ma_msgs[] = {
1054  {
1055  MA_MAINEXEC, "MAINEXEC"}, {
1056  MA_KERNTEXT, "KERNTEXT"}, {
1057  MA_READ, "READ"}, {
1058  MA_WRITE, "WRITE"}, {
1059  MA_EXEC, "EXEC"}, {
1060  MA_SHARED, "SHARED"}, {
1061  MA_BREAK, "BREAK"}, {
1062  MA_STACK, "STACK"},};
1063 
1064  char fname[80], name[PAPI_HUGE_STR_LEN];
1065  prmap_t newp;
1066  int count, t_index, retval, i, j, not_first_flag_bit;
1067  FILE *map_f;
1068  void *vaddr;
1069  prmap_t *tmp1 = NULL;
1070  PAPI_address_map_t *tmp2 = NULL;
1071 
1072  sprintf( fname, "/proc/%d/map", getpid( ) );
1073  map_f = fopen( fname, "r" );
1074  if ( !map_f ) {
1075  PAPIERROR( "fopen(%s) returned < 0", fname );
1076  return ( PAPI_OK );
1077  }
1078 
1079  /* count the entries we need */
1080  count = 0;
1081  t_index = 0;
1082  while ( ( retval = fread( &newp, sizeof ( prmap_t ), 1, map_f ) ) > 0 ) {
1083  if ( newp.pr_pathoff > 0 && newp.pr_mapname[0] != '\0' ) {
1084  if ( newp.pr_mflags & MA_STACK )
1085  continue;
1086 
1087  count++;
1088  SUBDBG( "count=%d offset=%ld map=%s\n", count,
1089  newp.pr_pathoff, newp.pr_mapname );
1090 
1091  if ( ( newp.pr_mflags & MA_READ ) && ( newp.pr_mflags & MA_EXEC ) )
1092  t_index++;
1093  }
1094  }
1095  rewind( map_f );
1096  tmp1 = ( prmap_t * ) papi_calloc( ( count + 1 ), sizeof ( prmap_t ) );
1097  if ( tmp1 == NULL )
1098  return ( PAPI_ENOMEM );
1099 
1100  tmp2 =
1101  ( PAPI_address_map_t * ) papi_calloc( t_index,
1102  sizeof ( PAPI_address_map_t ) );
1103  if ( tmp2 == NULL )
1104  return ( PAPI_ENOMEM );
1105 
1106  i = 0;
1107  t_index = -1;
1108  while ( ( retval = fread( &tmp1[i], sizeof ( prmap_t ), 1, map_f ) ) > 0 ) {
1109  if ( tmp1[i].pr_pathoff > 0 && tmp1[i].pr_mapname[0] != '\0' )
1110  if ( !( tmp1[i].pr_mflags & MA_STACK ) )
1111  i++;
1112  }
1113  for ( i = 0; i < count; i++ ) {
1114  char c;
1115  int cc = 0;
1116 
1117  retval = fseek( map_f, tmp1[i].pr_pathoff, SEEK_SET );
1118  if ( retval != 0 )
1119  return ( PAPI_ESYS );
1120  while ( fscanf( map_f, "%c", &c ) != EOF ) {
1121  name[cc] = c;
1122  /* how many char are hold in /proc/xxxx/map */
1123  cc++;
1124  if ( c == '\0' )
1125  break;
1126  }
1127 
1128 
1129  /* currently /proc/xxxx/map file holds only 33 char per line (incl NULL char);
1130  * if executable name > 32 char, compare first 32 char only */
1132  basename( name ), cc - 1 ) == 0 ) {
1134  cc - 1 )
1135  PAPIERROR
1136  ( "executable name too long (%d char). Match of first %d char only",
1138  name ), cc - 1 );
1139 
1140  if ( tmp1[i].pr_mflags & MA_READ ) {
1141  if ( tmp1[i].pr_mflags & MA_EXEC ) {
1143  text_start = ( caddr_t ) tmp1[i].pr_vaddr;
1145  text_end =
1146  ( caddr_t ) ( tmp1[i].pr_vaddr + tmp1[i].pr_size );
1147  } else if ( tmp1[i].pr_mflags & MA_WRITE ) {
1149  data_start = ( caddr_t ) tmp1[i].pr_vaddr;
1151  data_end =
1152  ( caddr_t ) ( tmp1[i].pr_vaddr + tmp1[i].pr_size );
1153  }
1154  }
1155 
1156  } else {
1159  0 ) &&
1162  0 ) )
1163  PAPIERROR( "executable name not recognized" );
1164 
1165  if ( tmp1[i].pr_mflags & MA_READ ) {
1166  if ( tmp1[i].pr_mflags & MA_EXEC ) {
1167  t_index++;
1168  tmp2[t_index].text_start = ( caddr_t ) tmp1[i].pr_vaddr;
1169  tmp2[t_index].text_end =
1170  ( caddr_t ) ( tmp1[i].pr_vaddr + tmp1[i].pr_size );
1171  strncpy( tmp2[t_index].name, name, PAPI_MAX_STR_LEN );
1172  } else if ( tmp1[i].pr_mflags & MA_WRITE ) {
1173  tmp2[t_index].data_start = ( caddr_t ) tmp1[i].pr_vaddr;
1174  tmp2[t_index].data_end =
1175  ( caddr_t ) ( tmp1[i].pr_vaddr + tmp1[i].pr_size );
1176  }
1177  }
1178 
1179  }
1180  }
1181  fclose( map_f );
1182 
1186  _papi_hwi_system_info.shlib_info.count = t_index + 1;
1187  papi_free( tmp1 );
1188 
1189  return PAPI_OK;
1190 #else
1191  return PAPI_ENOIMPL;
1192 #endif
1193 }
char name[PAPI_HUGE_STR_LEN]
Definition: papi.h:691
#define PAPI_HUGE_STR_LEN
Definition: fpapi.h:42
sprintf(splash[splash_line++],"\tIozone: Performance Test of File I/O\n")
#define PAPI_ENOMEM
Definition: fpapi.h:107
#define PAPI_ENOIMPL
Definition: fpapi.h:124
#define papi_free(a)
Definition: papi_memory.h:35
caddr_t text_end
Definition: papi.h:693
#define PAPI_MAX_STR_LEN
Definition: fpapi.h:43
long long tmp2
Definition: iozone.c:19604
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
Definition: appio.c:275
return PAPI_OK
Definition: linux-nvml.c:458
int count
Definition: iozone.c:22422
PAPI_exe_info_t exe_info
fclose(thread_wqfd)
double c
Definition: multiplex.c:22
PAPI_shlib_info_t shlib_info
struct client_command cc
Definition: iozone.c:21326
int i
Definition: fileop.c:140
caddr_t text_start
Definition: papi.h:692
PAPI_address_map_t address_info
Definition: papi.h:704
get the executable&#39;s address space info
Definition: papi.h:690
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
void PAPIERROR(char *format,...)
child_stat flag
Definition: iozone.c:12951
#define PAPI_ESYS
Definition: fpapi.h:108
papi_mdi_t _papi_hwi_system_info
Definition: papi_internal.c:57
caddr_t data_start
Definition: papi.h:694
char * name
Definition: iozone.c:23648
PAPI_address_map_t * map
Definition: papi.h:709
caddr_t data_end
Definition: papi.h:695
long j
Definition: iozone.c:19135
ssize_t retval
Definition: libasync.c:338
rewind(w_traj_fd)
#define papi_calloc(a, b)
Definition: papi_memory.h:37

Here is the call graph for this function:

Here is the caller graph for this function:

int _papi_hwi_init_os ( void  )

Definition at line 1213 of file aix.c.

1213  {
1214 
1215  struct utsname uname_buffer;
1216 
1217  uname(&uname_buffer);
1218 
1219  strncpy(_papi_os_info.name,uname_buffer.sysname,PAPI_MAX_STR_LEN);
1220 
1221  strncpy(_papi_os_info.version,uname_buffer.release,PAPI_MAX_STR_LEN);
1222 
1227 
1228  return PAPI_OK;
1229 
1230 }
#define PAPI_INT_MPX_DEF_US
Definition: papi_internal.h:65
#define PAPI_MAX_STR_LEN
Definition: fpapi.h:43
return PAPI_OK
Definition: linux-nvml.c:458
char name[PAPI_MAX_STR_LEN]
PAPI_os_info_t _papi_os_info
Definition: aix.c:1210
#define PAPI_INT_ITIMER
Definition: papi_internal.h:54
char version[PAPI_MAX_STR_LEN]
#define PAPI_INT_MPX_SIGNAL
Definition: papi_internal.h:52

Here is the caller graph for this function:

void aix_initialize_native_table ( )

Definition at line 51 of file aix.c.

52 {
53  int i, j;
54 
55  memset( native_table, 0,
59  for ( i = 0; i < PAPI_MAX_NATIVE_EVENTS; i++ ) {
60  native_name_map[i].index = -1;
61  for ( j = 0; j < MAX_COUNTERS; j++ )
62  native_table[i].resources.counter_cmd[j] = -1;
63  }
64 }
memset(eventId, 0, size)
PPC64_native_map_t native_name_map[PAPI_MAX_NATIVE_EVENTS]
Definition: aix.c:46
#define MAX_COUNTERS
Definition: perfctr-x86.h:8
Definition: perfctr-x86.h:133
int i
Definition: fileop.c:140
native_event_entry_t native_table[PAPI_MAX_NATIVE_EVENTS]
Definition: aix.c:41
#define PAPI_MAX_NATIVE_EVENTS
long j
Definition: iozone.c:19135

Here is the call graph for this function:

Here is the caller graph for this function:

static void aix_ppc64_setup_gps ( int  total)
static

Definition at line 68 of file aix.c.

69 {
70  int i, j, gnum;
71 
72  for ( i = 0; i < total; i++ ) {
73  for ( j = 0; j < MAX_COUNTERS; j++ ) {
74  /* native_table[i].resources.rgg[j]=-1; */
75  if ( native_table[i].resources.selector & ( 1 << j ) ) {
76  for ( gnum = 0; gnum < pmgroups.maxgroups; gnum++ ) {
77  if ( native_table[i].resources.counter_cmd[j] ==
78  pmgroups.event_groups[gnum].events[j] ) {
79  /* could use gnum instead of pmgroups.event_groups[gnum].group_id */
81  event_groups[gnum].
82  group_id / 32] |=
83  1 << ( pmgroups.event_groups[gnum].group_id % 32 );
84  }
85  }
86  }
87  }
88  }
89 
90  for ( gnum = 0; gnum < pmgroups.maxgroups; gnum++ ) {
91  for ( i = 0; i < MAX_COUNTERS; i++ ) {
92  /*group_map[gnum].counter_cmd[i] = pmgroups.event_groups[gnum].events[i]; */
93  if (pmgroups.event_groups[gnum].group_id >=MAX_GROUPS) {
94  fprintf(stderr,"ERROR, group number trying to go past MAX GROUPS\n");
95  continue;
96  }
97 
98  group_map[pmgroups.event_groups[gnum].group_id].counter_cmd[i] =
99  pmgroups.event_groups[gnum].events[i];
100  }
101  }
102 }
unsigned int counter_cmd[MAX_COUNTERS]
Definition: ppc64_events.h:52
#define MAX_COUNTERS
Definition: perfctr-x86.h:8
#define MAX_GROUPS
hwd_groups_t group_map[MAX_GROUPS]
Definition: aix.c:47
int i
Definition: fileop.c:140
native_event_entry_t native_table[PAPI_MAX_NATIVE_EVENTS]
Definition: aix.c:41
pm_groups_info_t pmgroups
Definition: aix.c:44
static int total
Definition: rapl_overflow.c:5
X86_register_t resources
Definition: perfctr-x86.h:137
long j
Definition: iozone.c:19135

Here is the caller graph for this function:

int aix_ppc64_setup_native_table ( )

Definition at line 106 of file aix.c.

107 {
108  hwd_pmevents_t *wevp;
109  hwd_pminfo_t *info;
110  int pmc, ev, i, j, index;
111 
112  info = &pminfo;
113  index = 0;
115  for ( pmc = 0; pmc < info->maxpmcs; pmc++ ) {
116  wevp = info->list_events[pmc];
117  for ( ev = 0; ev < info->maxevents[pmc]; ev++, wevp++ ) {
118  for ( i = 0; i < index; i++ ) {
119  if ( strcmp( wevp->short_name, native_table[i].name ) == 0 ) {
120  native_table[i].resources.selector |= 1 << pmc;
121  native_table[i].resources.counter_cmd[pmc] = wevp->event_id;
122  break;
123  }
124  }
125  if ( i == index ) {
126  /*native_table[i].index=i; */
127  native_table[i].resources.selector |= 1 << pmc;
128  native_table[i].resources.counter_cmd[pmc] = wevp->event_id;
129  native_table[i].name = wevp->short_name;
130  native_table[i].description = wevp->description;
133  index++;
134  }
135  }
136  }
137  aix_ppc64_setup_gps( index );
138 
139  return index;
140 }
PPC64_native_map_t native_name_map[PAPI_MAX_NATIVE_EVENTS]
Definition: aix.c:46
hwd_pminfo_t pminfo
Definition: aix.c:43
char * description
Definition: perfctr-x86.h:136
int i
Definition: fileop.c:140
unsigned int selector
Definition: perfctr-x86.h:74
char name[PAPI_MAX_STR_LEN]
Definition: perfctr-x86.h:135
native_event_entry_t native_table[PAPI_MAX_NATIVE_EVENTS]
Definition: aix.c:41
pm_events_t hwd_pmevents_t
Definition: aix.h:82
static void aix_ppc64_setup_gps(int total)
Definition: aix.c:68
pm_info_t hwd_pminfo_t
Definition: aix.h:81
X86_register_t resources
Definition: perfctr-x86.h:137
long j
Definition: iozone.c:19135
void aix_initialize_native_table()
Definition: aix.c:51

Here is the call graph for this function:

Here is the caller graph for this function:

static void copy_value ( unsigned int  val,
char *  nam,
char *  names,
unsigned int values,
int  len 
)
static

Definition at line 146 of file aix.c.

148 {
149  *values = val;
150  strncpy( names, nam, len );
151  names[len - 1] = '\0';
152 }
int val
Definition: libbif.c:235
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
const char * names[NUM_EVENTS]
static int do_counter_allocation ( ppc64_reg_alloc_t event_list,
int  size 
)
static

Definition at line 160 of file aix.c.

161 {
162  int i, j, group = -1;
163  unsigned int map[GROUP_INTS];
164 
165  for ( i = 0; i < GROUP_INTS; i++ )
166  map[i] = event_list[0].ra_group[i];
167 
168  for ( i = 1; i < size; i++ ) {
169  for ( j = 0; j < GROUP_INTS; j++ )
170  map[j] &= event_list[i].ra_group[j];
171  }
172 
173  for ( i = 0; i < GROUP_INTS; i++ ) {
174  if ( map[i] ) {
175  group = ffs( map[i] ) - 1 + i * 32;
176  break;
177  }
178  }
179 
180  if ( group < 0 )
181  return group; /* allocation fail */
182  else {
183  for ( i = 0; i < size; i++ ) {
184  for ( j = 0; j < MAX_COUNTERS; j++ ) {
185  if ( event_list[i].ra_counter_cmd[j] >= 0
186  && event_list[i].ra_counter_cmd[j] ==
187  group_map[group].counter_cmd[j] )
188  event_list[i].ra_position = j;
189  }
190  }
191  return group;
192  }
193 }
#define MAX_COUNTERS
Definition: perfctr-x86.h:8
int ra_position
Definition: aix.h:98
hwd_groups_t group_map[MAX_GROUPS]
Definition: aix.c:47
int i
Definition: fileop.c:140
char *long long size
Definition: iozone.c:12023
#define GROUP_INTS
long j
Definition: iozone.c:19135

Here is the caller graph for this function:

void dump_cmd ( pm_prog_t *  t)

Definition at line 795 of file aix.c.

796 {
797  SUBDBG( "mode.b.threshold %d\n", t->mode.b.threshold );
798  SUBDBG( "mode.b.spare %d\n", t->mode.b.spare );
799  SUBDBG( "mode.b.process %d\n", t->mode.b.process );
800  SUBDBG( "mode.b.kernel %d\n", t->mode.b.kernel );
801  SUBDBG( "mode.b.user %d\n", t->mode.b.user );
802  SUBDBG( "mode.b.count %d\n", t->mode.b.count );
803  SUBDBG( "mode.b.proctree %d\n", t->mode.b.proctree );
804  SUBDBG( "events[0] %d\n", t->events[0] );
805  SUBDBG( "events[1] %d\n", t->events[1] );
806  SUBDBG( "events[2] %d\n", t->events[2] );
807  SUBDBG( "events[3] %d\n", t->events[3] );
808  SUBDBG( "events[4] %d\n", t->events[4] );
809  SUBDBG( "events[5] %d\n", t->events[5] );
810  SUBDBG( "events[6] %d\n", t->events[6] );
811  SUBDBG( "events[7] %d\n", t->events[7] );
812  SUBDBG( "reserved %d\n", t->reserved );
813 }
t
Definition: iozone.c:23562
#define SUBDBG(format, args...)
Definition: papi_debug.h:63

Here is the caller graph for this function:

void dump_data ( long long vals)

Definition at line 816 of file aix.c.

817 {
818  int i;
819 
820  for ( i = 0; i < MAX_COUNTERS; i++ ) {
821  SUBDBG( "counter[%d] = %lld\n", i, vals[i] );
822  }
823 }
#define MAX_COUNTERS
Definition: perfctr-x86.h:8
int i
Definition: fileop.c:140
#define SUBDBG(format, args...)
Definition: papi_debug.h:63

Here is the caller graph for this function:

static int get_avail_hwcntr_bits ( int  cntr_avail_bits)
static

Definition at line 766 of file aix.c.

767 {
768  int tmp = 0, i = 1 << ( POWER_MAX_COUNTERS - 1 );
769 
770  while ( i ) {
771  tmp = i & cntr_avail_bits;
772  if ( tmp )
773  return ( tmp );
774  i = i >> 1;
775  }
776  return ( 0 );
777 }
int i
Definition: fileop.c:140
long long tmp
Definition: iozone.c:12031
#define POWER_MAX_COUNTERS
Definition: aix.h:43
int init_domain ( )

Definition at line 420 of file aix.c.

421 {
422  int domain = 0;
423 
425 #ifdef PM_INITIALIZE
426 #ifdef _AIXVERSION_510
427  if ( pminfo.proc_feature.b.hypervisor ) {
428  domain |= PAPI_DOM_SUPERVISOR;
429  }
430 #endif
431 #endif
432  return ( domain );
433 }
#define PAPI_DOM_OTHER
Definition: fpapi.h:23
#define PAPI_DOM_KERNEL
Definition: fpapi.h:22
hwd_pminfo_t pminfo
Definition: aix.c:43
#define PAPI_DOM_SUPERVISOR
Definition: fpapi.h:24
#define PAPI_DOM_USER
Definition: fpapi.h:21

Here is the caller graph for this function:

static int round_requested_ns ( int  ns)
static

Definition at line 863 of file aix.c.

864 {
865  if ( ns <= _papi_os_info.itimer_res_ns ) {
867  } else {
868  int leftover_ns = ns % _papi_os_info.itimer_res_ns;
869  return ( ns - leftover_ns + _papi_os_info.itimer_res_ns );
870  }
871 }
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 void set_config ( hwd_control_state_t ptr,
int  arg1,
int  arg2 
)
static

Definition at line 408 of file aix.c.

409 {
410  ptr->counter_cmd.events[arg1] = arg2;
411 }
papi_cpc_event_t counter_cmd
Definition: solaris-ultra.h:61
static int set_default_domain ( EventSetInfo_t zero,
int  domain 
)
static

Definition at line 510 of file aix.c.

511 {
512  hwd_control_state_t *current_state = zero->ctl_state;
513  return ( _aix_set_domain( current_state, domain ) );
514 }
hwd_control_state_t * ctl_state
static int _aix_set_domain(hwd_control_state_t *this_state, int domain)
Definition: aix.c:436

Here is the call graph for this function:

Here is the caller graph for this function:

static int set_default_granularity ( EventSetInfo_t zero,
int  granularity 
)
static

Definition at line 517 of file aix.c.

518 {
519  hwd_control_state_t *current_state = zero->ctl_state;
520  return ( _aix_set_granularity( current_state, granularity ) );
521 }
int _aix_set_granularity(hwd_control_state_t *this_state, int domain)
Definition: aix.c:486
hwd_control_state_t * ctl_state

Here is the call graph for this function:

static void set_hwcntr_codes ( int  selector,
unsigned char *  from,
int to 
)
static

Definition at line 780 of file aix.c.

781 {
782  int useme, i;
783 
784  for ( i = 0; i < _aix_vector.cmp_info.num_cntrs; i++ ) {
785  useme = ( 1 << i ) & selector;
786  if ( useme ) {
787  to[i] = from[i];
788  }
789  }
790 }
papi_vector_t _aix_vector
Definition: aix.c:21
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
int i
Definition: fileop.c:140
static char* trim_string ( char *  in)
static

Definition at line 289 of file aix.c.

290 {
291  int len, i = 0;
292  char *start = in;
293 
294  if ( in == NULL )
295  return ( in );
296  len = strlen( in );
297  if ( len == 0 )
298  return ( in );
299  /* Trim right */
300  i = strlen( start ) - 1;
301  while ( i >= 0 ) {
302  if ( isblank( start[i] ) || ( start[i] == '\r' ) ||
303  ( start[i] == '\n' ) )
304  start[i] = '\0';
305  else
306  break;
307  i--;
308  }
309  return ( start );
310 }
start
Definition: iozone.c:22736
int i
Definition: fileop.c:140

Here is the caller graph for this function:

static void unset_config ( hwd_control_state_t ptr,
int  arg1 
)
static

Definition at line 414 of file aix.c.

415 {
416  ptr->counter_cmd.events[arg1] = 0;
417 }
papi_cpc_event_t counter_cmd
Definition: solaris-ultra.h:61

Variable Documentation

papi_vector_t _aix_vector

Definition at line 21 of file aix.c.

PAPI_os_info_t _papi_os_info

Definition at line 1210 of file aix.c.

papi_os_vector_t _papi_os_vector
Initial value:
= {
.get_memory_info = _aix_get_memory_info,
.get_dmem_info = _aix_get_dmem_info,
.get_real_usec = _aix_get_real_usec,
.get_real_cycles = _aix_get_real_cycles,
.get_virt_usec = _aix_get_virt_usec,
.update_shlib_info = _aix_update_shlib_info,
.get_system_info = _aix_get_system_info,
}
int _aix_get_memory_info(PAPI_hw_info_t *mem_info, int type)
Definition: aix-memory.c:16
long long _aix_get_virt_usec(void)
Definition: aix.c:673
int _aix_update_shlib_info(papi_mdi_t *mdi)
Definition: aix.c:1046
int _aix_get_dmem_info(PAPI_dmem_info_t *d)
Definition: aix-memory.c:64
long long _aix_get_real_cycles(void)
Definition: aix.c:666
static int _aix_get_system_info(papi_mdi_t *mdi)
Definition: aix.c:560
long long _aix_get_real_usec(void)
Definition: aix.c:654

Definition at line 1288 of file aix.c.

struct utsname AixVer

Definition at line 39 of file aix.c.

hwd_groups_t group_map[MAX_GROUPS] = { 0 }

Definition at line 47 of file aix.c.

atomic_p lock[PAPI_MAX_LOCK]

Definition at line 25 of file aix.c.

volatile int lock_var[PAPI_MAX_LOCK] = { 0 }

Definition at line 24 of file aix.c.

int maxgroups = 0
static

Definition at line 38 of file aix.c.

Definition at line 46 of file aix.c.

native_event_entry_t native_table

Definition at line 41 of file aix.c.

pm_groups_info_t pmgroups

Definition at line 44 of file aix.c.

hwd_pminfo_t pminfo

Definition at line 43 of file aix.c.