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

Go to the source code of this file.

Data Structures

struct  ctr_info_t
 
struct  einfo_t
 

Macros

#define LASTULTRA3   CPC_ULTRA3_PLUS
 
#define MAX_ENAME   40
 

Functions

static void action (void *arg, int regno, const char *name, uint8_t bits)
 
static int build_tables (void)
 
static void add_preset (hwi_search_t *tab, int *np, einfo_t e)
 
static void dump_cmd (papi_cpc_event_t *t)
 
static void dispatch_emt (int signal, siginfo_t *sip, void *arg)
 
static int scan_prtconf (char *cpuname, int len_cpuname, int *hz, int *ver)
 
int _ultra_set_domain (hwd_control_state_t *this_state, int domain)
 
static int set_granularity (hwd_control_state_t *this_state, int domain)
 
void print_walk_names (void *arg, int regno, const char *name, uint8_t bits)
 
static int srch_event (char *e1)
 
static int set_inherit (EventSetInfo_t *global, int arg)
 
static int set_default_domain (hwd_control_state_t *ctrl_state, int domain)
 
static int set_default_granularity (hwd_control_state_t *current_state, int granularity)
 
static void lock_init (void)
 
int _ultra_hwd_shutdown_component (void)
 
int _ultra_hwd_init_component (int cidx)
 
int _ultra_hwd_reset (hwd_context_t *ctx, hwd_control_state_t *ctrl)
 
int _ultra_hwd_read (hwd_context_t *ctx, hwd_control_state_t *ctrl, long long **events, int flags)
 
int _ultra_hwd_ctl (hwd_context_t *ctx, int code, _papi_int_option_t *option)
 
void _ultra_hwd_dispatch_timer (int signal, siginfo_t *si, void *context)
 
int _ultra_hwd_set_overflow (EventSetInfo_t *ESI, int EventIndex, int threshold)
 
 _ultra_shutdown (hwd_context_t *ctx)
 
void_ultra_hwd_get_overflow_address (void *context)
 
int _ultra_hwd_start (hwd_context_t *ctx, hwd_control_state_t *ctrl)
 
int _ultra_hwd_stop (hwd_context_t *ctx, hwd_control_state_t *ctrl)
 
int _ultra_hwd_remove_event (hwd_register_map_t *chosen, unsigned int hardware_index, hwd_control_state_t *out)
 
int _ultra_hwd_encode_native (char *name, int *code)
 
int _ultra_hwd_ntv_enum_events (unsigned int *EventCode, int modifier)
 
int _ultra_hwd_ntv_code_to_name (unsigned int EventCode, char *ntv_name, int len)
 
int _ultra_hwd_ntv_code_to_descr (unsigned int EventCode, char *hwd_descr, int len)
 
static void copy_value (unsigned int val, char *nam, char *names, unsigned int *values, int len)
 
int _ultra_hwd_ntv_code_to_bits (unsigned int EventCode, hwd_register_t *bits)
 
int _ultra_hwd_init_control_state (hwd_control_state_t *ptr)
 
int _ultra_hwd_update_control_state (hwd_control_state_t *this_state, NativeInfo_t *native, int count, hwd_context_t *zero)
 

Variables

static einfo_t us3info []
 
static einfo_t us2info []
 
papi_vector_t _solaris_vector
 
static native_info_tnative_table
 
static hwi_search_tpreset_table
 
static struct ctr_info * ctrs
 
static int nctrs
 
static int cpuver
 
static int pcr_shift [2]
 
hwi_search_tpreset_search_map
 
rwlock_t lock [PAPI_MAX_LOCK]
 
papi_os_vector_t _papi_os_vector
 

Macro Definition Documentation

#define LASTULTRA3   CPC_ULTRA3_PLUS

Definition at line 33 of file solaris-ultra.c.

#define MAX_ENAME   40

Definition at line 36 of file solaris-ultra.c.

Function Documentation

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

Definition at line 719 of file solaris-ultra.c.

720 {
721 
722  switch ( code ) {
723  case PAPI_DEFDOM:
724  return ( set_default_domain
725  ( option->domain.ESI->ctl_state, option->domain.domain ) );
726  case PAPI_DOMAIN:
727  return ( _ultra_set_domain
728  ( option->domain.ESI->ctl_state, option->domain.domain ) );
729  case PAPI_DEFGRN:
730  return ( set_default_granularity
731  ( option->domain.ESI->ctl_state,
732  option->granularity.granularity ) );
733  case PAPI_GRANUL:
734  return ( set_granularity
735  ( option->granularity.ESI->ctl_state,
736  option->granularity.granularity ) );
737  default:
738  return ( PAPI_EINVAL );
739  }
740 }
EventSetInfo_t * ESI
return PAPI_EINVAL
Definition: linux-nvml.c:408
static int set_granularity(hwd_control_state_t *this_state, int domain)
#define PAPI_DEFDOM
Definition: fpapi.h:49
_papi_int_granularity_t granularity
EventSetInfo_t * ESI
#define PAPI_DOMAIN
Definition: fpapi.h:50
#define PAPI_DEFGRN
Definition: fpapi.h:51
#define PAPI_GRANUL
Definition: fpapi.h:52
int _ultra_set_domain(hwd_control_state_t *this_state, int domain)
static int set_default_domain(hwd_control_state_t *ctrl_state, int domain)
_papi_int_domain_t domain
hwd_control_state_t * ctl_state
static int set_default_granularity(hwd_control_state_t *current_state, int granularity)

Here is the call graph for this function:

void _ultra_hwd_dispatch_timer ( int  signal,
siginfo_t *  si,
void context 
)

Definition at line 743 of file solaris-ultra.c.

744 {
745 
747  ThreadInfo_t *master = NULL;
748  int isHardware = 0;
749  caddr_t address;
751 
752  ctx.si = si;
753  ctx.ucontext = ( ucontext_t * ) context;
754 
755  address = GET_OVERFLOW_ADDRESS( ctx );
756  _papi_hwi_dispatch_overflow_signal( ( void * ) &ctx, address, &isHardware,
757  0, 0, &master, _solaris_vector.cmp_info.CmpIdx );
758 
759  /* We are done, resume interrupting counters */
760  if ( isHardware ) {
761  // errno = vperfctr_iresume( master->context[cidx]->perfctr );
762  //if ( errno < 0 ) {
763  // PAPIERROR( "vperfctr_iresume errno %d", errno );
764  //}
765  }
766 
767 
768 #if 0
769  EventSetInfo_t *ESI = NULL;
770  ThreadInfo_t *thread = NULL;
771  int overflow_vector = 0;
772  hwd_control_state_t *ctrl = NULL;
773  long_long results[MAX_COUNTERS];
774  int i;
776  caddr_t address;
777  int cidx = _solaris_vector.cmp_info.CmpIdx;
778 
779  ctx.si = si;
780  ctx.ucontext = ( hwd_ucontext_t * ) info;
781 
782  thread = _papi_hwi_lookup_thread( 0 );
783 
784  if ( thread == NULL ) {
785  PAPIERROR( "thread == NULL in _papi_hwd_dispatch_timer");
786  return;
787  }
788 
789  ESI = ( EventSetInfo_t * ) thread->running_eventset[cidx];
790 
791 
792  if ( ESI == NULL || ESI->master != thread || ESI->ctl_state == NULL ||
793  ( ( ESI->state & PAPI_OVERFLOWING ) == 0 ) ) {
794 
795  if ( ESI == NULL )
796  PAPIERROR( "ESI is NULL\n");
797 
798  if ( ESI->master != thread )
799  PAPIERROR( "Thread mismatch, ESI->master=%#x thread=%#x\n",
800  ESI->master, thread );
801 
802  if ( ESI->ctl_state == NULL )
803  PAPIERROR( "Counter state invalid\n");
804 
805  if ( ( ( ESI->state & PAPI_OVERFLOWING ) == 0 ) )
806  PAPIERROR( "Overflow flag missing");
807  }
808 
809  ctrl = ESI->ctl_state;
810 
811  if ( thread->running_eventset[cidx]->overflow.flags & PAPI_OVERFLOW_FORCE_SW ) {
812  address = GET_OVERFLOW_ADDRESS( ctx );
813  _papi_hwi_dispatch_overflow_signal( ( void * ) &ctx, address, NULL, 0,
814  0, &thread, cidx );
815  } else {
816  PAPIERROR ( "Need to implement additional code in _papi_hwd_dispatch_timer!" );
817  }
818 #endif
819 }
papi_vector_t _solaris_vector
#define MAX_COUNTERS
Definition: perfctr-x86.h:8
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
#define PAPI_OVERFLOWING
Definition: fpapi.h:33
int i
Definition: fileop.c:140
EventSetOverflowInfo_t overflow
struct _ThreadInfo * master
static int cidx
Definition: event_info.c:40
hwd_ucontext_t * ucontext
void * thread(void *arg)
Definition: kufrin.c:31
void PAPIERROR(char *format,...)
struct sigcontext hwd_ucontext_t
Definition: aix-context.h:10
#define PAPI_OVERFLOW_FORCE_SW
Definition: papi.h:409
EventSetInfo_t ** running_eventset
Definition: threads.h:30
#define long_long
Definition: papi.h:549
inline_static ThreadInfo_t * _papi_hwi_lookup_thread(int custom_tid)
Definition: threads.h:92
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
hwd_control_state_t * ctl_state
#define GET_OVERFLOW_ADDRESS(ctx)
Definition: aix-context.h:12
if(gettimeofday(&tp,(struct timezone *) NULL)==-1) perror("gettimeofday")

Here is the call graph for this function:

int _ultra_hwd_encode_native ( char *  name,
int code 
)

Definition at line 922 of file solaris-ultra.c.

923 {
924  return ( PAPI_OK );
925 }
return PAPI_OK
Definition: linux-nvml.c:458
void* _ultra_hwd_get_overflow_address ( void context)

Definition at line 880 of file solaris-ultra.c.

881 {
882  void *location;
883  ucontext_t *info = ( ucontext_t * ) context;
884  location = ( void * ) info->uc_mcontext.gregs[REG_PC];
885 
886  return ( location );
887 }
return
Definition: iozone.c:22170
int _ultra_hwd_init_component ( int  cidx)

Definition at line 656 of file solaris-ultra.c.

657 {
658  int retval;
659  /* retval = _papi_hwi_setup_vector_table(vtable, _solaris_ultra_table);
660  if ( retval != PAPI_OK ) return(retval); */
661 
662  /* Fill in what we can of the papi_system_info. */
664  if ( retval )
665  return ( retval );
666 
667  /* Setup memory info */
669  0 );
670  if ( retval )
671  return ( retval );
672 
673 
674  lock_init( );
675 
676  SUBDBG( "Found %d %s %s CPUs at %d Mhz.\n",
681 
682  return ( PAPI_OK );
683 }
return PAPI_OK
Definition: linux-nvml.c:458
papi_os_vector_t _papi_os_vector
Definition: aix.c:1288
static void lock_init(void)
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
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 _solaris_get_system_info(papi_mdi_t *mdi)
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 _ultra_hwd_init_control_state ( hwd_control_state_t ptr)

Definition at line 1005 of file solaris-ultra.c.

1006 {
1007  ptr->counter_cmd.flags = 0x0;
1008  ptr->counter_cmd.cmd.ce_cpuver = cpuver;
1009  ptr->counter_cmd.cmd.ce_pcr = 0x0;
1010  ptr->counter_cmd.cmd.ce_pic[0] = 0;
1011  ptr->counter_cmd.cmd.ce_pic[1] = 0;
1012 
1015 
1016  return PAPI_OK;
1017 }
papi_vector_t _solaris_vector
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
static int cpuver
cpc_event_t cmd
Definition: solaris-ultra.h:53
static int set_granularity(hwd_control_state_t *this_state, int domain)
int _ultra_set_domain(hwd_control_state_t *this_state, int domain)
papi_cpc_event_t counter_cmd
Definition: solaris-ultra.h:61

Here is the call graph for this function:

int _ultra_hwd_ntv_code_to_bits ( unsigned int  EventCode,
hwd_register_t bits 
)

Definition at line 984 of file solaris-ultra.c.

985 {
986  int index = EventCode & PAPI_NATIVE_AND_MASK;
987 
988  if ( cpuver <= CPC_ULTRA2 ) {
989  if ( index >= MAX_NATIVE_EVENT_USII ) {
990  return ( PAPI_ENOEVNT );
991  }
992  } else if ( cpuver <= LASTULTRA3 ) {
993  if ( index >= MAX_NATIVE_EVENT ) {
994  return ( PAPI_ENOEVNT );
995  }
996  } else
997  return ( PAPI_ENOEVNT );
998 
999  bits->event[0] = native_table[index].encoding[0];
1000  bits->event[1] = native_table[index].encoding[1];
1001  return ( PAPI_OK );
1002 }
#define PAPI_ENOEVNT
Definition: fpapi.h:112
return PAPI_OK
Definition: linux-nvml.c:458
int event[MAX_COUNTERS]
Definition: solaris-ultra.h:47
static int cpuver
#define MAX_NATIVE_EVENT_USII
Definition: solaris-ultra.h:33
#define LASTULTRA3
Definition: solaris-ultra.c:33
#define MAX_NATIVE_EVENT
native_event_entry_t native_table[PAPI_MAX_NATIVE_EVENTS]
Definition: aix.c:41
#define PAPI_NATIVE_AND_MASK
int _ultra_hwd_ntv_code_to_descr ( unsigned int  EventCode,
char *  hwd_descr,
int  len 
)

Definition at line 969 of file solaris-ultra.c.

970 {
971  return ( _ultra_hwd_ntv_code_to_name( EventCode, hwd_descr, len ) );
972 }
int _ultra_hwd_ntv_code_to_name(unsigned int EventCode, char *ntv_name, int len)

Here is the call graph for this function:

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

Definition at line 955 of file solaris-ultra.c.

956 {
957 
958  int event_code = EventCode & PAPI_NATIVE_AND_MASK;
959 
960  if ( event_code >= 0 && event_code < nctrs ) {
961  strlcpy( ntv_name, native_table[event_code].name, len );
962  return PAPI_OK;
963  }
964  return PAPI_ENOEVNT;
965 }
#define PAPI_ENOEVNT
Definition: fpapi.h:112
return PAPI_OK
Definition: linux-nvml.c:458
native_event_entry_t native_table[PAPI_MAX_NATIVE_EVENTS]
Definition: aix.c:41
static int nctrs
char * name
Definition: iozone.c:23648
#define PAPI_NATIVE_AND_MASK

Here is the caller graph for this function:

int _ultra_hwd_ntv_enum_events ( unsigned int EventCode,
int  modifier 
)

Definition at line 928 of file solaris-ultra.c.

929 {
930  int index = *EventCode & PAPI_NATIVE_AND_MASK;
931 
932  if ( modifier == PAPI_ENUM_FIRST ) {
933  *EventCode = PAPI_NATIVE_MASK + 1;
934 
935  return PAPI_OK;
936  }
937 
938  if ( cpuver <= CPC_ULTRA2 ) {
939  if ( index < MAX_NATIVE_EVENT_USII - 1 ) {
940  *EventCode = *EventCode + 1;
941  return ( PAPI_OK );
942  } else
943  return ( PAPI_ENOEVNT );
944  } else if ( cpuver <= LASTULTRA3 ) {
945  if ( index < MAX_NATIVE_EVENT - 1 ) {
946  *EventCode = *EventCode + 1;
947  return ( PAPI_OK );
948  } else
949  return ( PAPI_ENOEVNT );
950  };
951  return ( PAPI_ENOEVNT );
952 }
#define PAPI_NATIVE_MASK
#define PAPI_ENOEVNT
Definition: fpapi.h:112
return PAPI_OK
Definition: linux-nvml.c:458
static int cpuver
#define MAX_NATIVE_EVENT_USII
Definition: solaris-ultra.h:33
#define LASTULTRA3
Definition: solaris-ultra.c:33
#define MAX_NATIVE_EVENT
#define PAPI_NATIVE_AND_MASK
int _ultra_hwd_read ( hwd_context_t ctx,
hwd_control_state_t ctrl,
long long **  events,
int  flags 
)

Definition at line 704 of file solaris-ultra.c.

706 {
707  int retval;
708 
709  retval = cpc_take_sample( &ctrl->counter_cmd.cmd );
710  if ( retval == -1 )
711  return ( PAPI_ESYS );
712 
713  *events = ( long long * ) ctrl->counter_cmd.cmd.ce_pic;
714 
715  return PAPI_OK;
716 }
return PAPI_OK
Definition: linux-nvml.c:458
cpc_event_t cmd
Definition: solaris-ultra.h:53
char events[MAX_EVENTS][BUFSIZ]
#define PAPI_ESYS
Definition: fpapi.h:108
ssize_t retval
Definition: libasync.c:338
papi_cpc_event_t counter_cmd
Definition: solaris-ultra.h:61
int _ultra_hwd_remove_event ( hwd_register_map_t chosen,
unsigned int  hardware_index,
hwd_control_state_t out 
)

Definition at line 915 of file solaris-ultra.c.

917 {
918  return PAPI_OK;
919 }
return PAPI_OK
Definition: linux-nvml.c:458
int _ultra_hwd_reset ( hwd_context_t ctx,
hwd_control_state_t ctrl 
)

Definition at line 687 of file solaris-ultra.c.

688 {
689  int retval;
690 
691  /* reset the hardware counter */
692  ctrl->counter_cmd.cmd.ce_pic[0] = 0;
693  ctrl->counter_cmd.cmd.ce_pic[1] = 0;
694  /* let's rock and roll */
695  retval = cpc_bind_event( &ctrl->counter_cmd.cmd, ctrl->counter_cmd.flags );
696  if ( retval == -1 )
697  return ( PAPI_ESYS );
698 
699  return ( PAPI_OK );
700 }
return PAPI_OK
Definition: linux-nvml.c:458
cpc_event_t cmd
Definition: solaris-ultra.h:53
#define PAPI_ESYS
Definition: fpapi.h:108
ssize_t retval
Definition: libasync.c:338
papi_cpc_event_t counter_cmd
Definition: solaris-ultra.h:61
int _ultra_hwd_set_overflow ( EventSetInfo_t ESI,
int  EventIndex,
int  threshold 
)

Definition at line 822 of file solaris-ultra.c.

823 {
824  hwd_control_state_t *this_state = ESI->ctl_state;
825  papi_cpc_event_t *arg = &this_state->counter_cmd;
826  int hwcntr;
827 
828  if ( threshold == 0 ) {
829  if ( this_state->overflow_num == 1 ) {
830  arg->flags ^= CPC_BIND_EMT_OVF;
831  if ( sigaction
833  NULL ) == -1 )
834  return ( PAPI_ESYS );
835  this_state->overflow_num = 0;
836  } else
837  this_state->overflow_num--;
838 
839  } else {
840  struct sigaction act;
841  /* increase the counter for overflow events */
842  this_state->overflow_num++;
843 
844  act.sa_sigaction = dispatch_emt;
845  memset( &act.sa_mask, 0x0, sizeof ( act.sa_mask ) );
846  act.sa_flags = SA_RESTART | SA_SIGINFO;
847  if ( sigaction
849  NULL ) == -1 )
850  return ( PAPI_ESYS );
851 
852  arg->flags |= CPC_BIND_EMT_OVF;
853  hwcntr = ESI->EventInfoArray[EventIndex].pos[0];
854  if ( hwcntr == 0 )
855  arg->cmd.ce_pic[0] = UINT64_MAX - ( uint64_t ) threshold;
856  else if ( hwcntr == 1 )
857  arg->cmd.ce_pic[1] = UINT64_MAX - ( uint64_t ) threshold;
858  }
859 
860  return ( PAPI_OK );
861 }
memset(eventId, 0, size)
papi_vector_t _solaris_vector
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
cpc_event_t cmd
Definition: solaris-ultra.h:53
EventInfo_t * EventInfoArray
#define PAPI_ESYS
Definition: fpapi.h:108
int threshold
again struct sockaddr sizeof(struct sockaddr_in))
int pos[PAPI_EVENTS_IN_DERIVED_EVENT]
static void dispatch_emt(int signal, siginfo_t *sip, void *arg)
hwd_control_state_t * ctl_state
papi_cpc_event_t counter_cmd
Definition: solaris-ultra.h:61

Here is the call graph for this function:

int _ultra_hwd_shutdown_component ( void  )

Definition at line 649 of file solaris-ultra.c.

650 {
651  ( void ) cpc_rele( );
652  return ( PAPI_OK );
653 }
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
int _ultra_hwd_start ( hwd_context_t ctx,
hwd_control_state_t ctrl 
)

Definition at line 890 of file solaris-ultra.c.

891 {
892  int retval;
893 
894  /* reset the hardware counter */
895  if ( ctrl->overflow_num == 0 ) {
896  ctrl->counter_cmd.cmd.ce_pic[0] = 0;
897  ctrl->counter_cmd.cmd.ce_pic[1] = 0;
898  }
899  /* let's rock and roll */
900  retval = cpc_bind_event( &ctrl->counter_cmd.cmd, ctrl->counter_cmd.flags );
901  if ( retval == -1 )
902  return ( PAPI_ESYS );
903 
904  return ( PAPI_OK );
905 }
return PAPI_OK
Definition: linux-nvml.c:458
cpc_event_t cmd
Definition: solaris-ultra.h:53
#define PAPI_ESYS
Definition: fpapi.h:108
ssize_t retval
Definition: libasync.c:338
papi_cpc_event_t counter_cmd
Definition: solaris-ultra.h:61
int _ultra_hwd_stop ( hwd_context_t ctx,
hwd_control_state_t ctrl 
)

Definition at line 908 of file solaris-ultra.c.

909 {
910  cpc_bind_event( NULL, 0 );
911  return PAPI_OK;
912 }
return PAPI_OK
Definition: linux-nvml.c:458
int _ultra_hwd_update_control_state ( hwd_control_state_t this_state,
NativeInfo_t native,
int  count,
hwd_context_t zero 
)

Definition at line 1020 of file solaris-ultra.c.

1023 {
1024  int nidx1, nidx2, hwcntr;
1025  uint64_t tmp = 0;
1026  uint64_t pcr;
1027  int64_t cmd0, cmd1;
1028 
1029 /* save the last three bits */
1030  pcr = this_state->counter_cmd.cmd.ce_pcr & 0x7;
1031 
1032 /* clear the control register */
1033  this_state->counter_cmd.cmd.ce_pcr = pcr;
1034 
1035 /* no native events left */
1036  if ( count == 0 )
1037  return ( PAPI_OK );
1038 
1039  cmd0 = -1;
1040  cmd1 = -1;
1041 /* one native event */
1042  if ( count == 1 ) {
1043  nidx1 = native[0].ni_event & PAPI_NATIVE_AND_MASK;
1044  hwcntr = 0;
1045  cmd0 = native_table[nidx1].encoding[0];
1046  native[0].ni_position = 0;
1047  if ( cmd0 == -1 ) {
1048  cmd1 = native_table[nidx1].encoding[1];
1049  native[0].ni_position = 1;
1050  }
1051  }
1052 
1053 /* two native events */
1054  if ( count == 2 ) {
1055  int avail1, avail2;
1056 
1057  avail1 = 0;
1058  avail2 = 0;
1059  nidx1 = native[0].ni_event & PAPI_NATIVE_AND_MASK;
1060  nidx2 = native[1].ni_event & PAPI_NATIVE_AND_MASK;
1061  if ( native_table[nidx1].encoding[0] != -1 )
1062  avail1 = 0x1;
1063  if ( native_table[nidx1].encoding[1] != -1 )
1064  avail1 += 0x2;
1065  if ( native_table[nidx2].encoding[0] != -1 )
1066  avail2 = 0x1;
1067  if ( native_table[nidx2].encoding[1] != -1 )
1068  avail2 += 0x2;
1069  if ( ( avail1 | avail2 ) != 0x3 )
1070  return ( PAPI_ECNFLCT );
1071  if ( avail1 == 0x3 ) {
1072  if ( avail2 == 0x1 ) {
1073  cmd0 = native_table[nidx2].encoding[0];
1074  cmd1 = native_table[nidx1].encoding[1];
1075  native[0].ni_position = 1;
1076  native[1].ni_position = 0;
1077  } else {
1078  cmd1 = native_table[nidx2].encoding[1];
1079  cmd0 = native_table[nidx1].encoding[0];
1080  native[0].ni_position = 0;
1081  native[1].ni_position = 1;
1082  }
1083  } else {
1084  if ( avail1 == 0x1 ) {
1085  cmd0 = native_table[nidx1].encoding[0];
1086  cmd1 = native_table[nidx2].encoding[1];
1087  native[0].ni_position = 0;
1088  native[1].ni_position = 1;
1089  } else {
1090  cmd0 = native_table[nidx2].encoding[0];
1091  cmd1 = native_table[nidx1].encoding[1];
1092  native[0].ni_position = 1;
1093  native[1].ni_position = 0;
1094  }
1095  }
1096  }
1097 
1098 /* set the control register */
1099  if ( cmd0 != -1 ) {
1100  tmp = ( ( uint64_t ) cmd0 << pcr_shift[0] );
1101  }
1102  if ( cmd1 != -1 ) {
1103  tmp = tmp | ( ( uint64_t ) cmd1 << pcr_shift[1] );
1104  }
1105  this_state->counter_cmd.cmd.ce_pcr = tmp | pcr;
1106 #if DEBUG
1107  dump_cmd( &this_state->counter_cmd );
1108 #endif
1109 
1110  return ( PAPI_OK );
1111 }
return PAPI_OK
Definition: linux-nvml.c:458
int count
Definition: iozone.c:22422
static int pcr_shift[2]
#define PAPI_ECNFLCT
Definition: fpapi.h:113
cpc_event_t cmd
Definition: solaris-ultra.h:53
native_event_entry_t native_table[PAPI_MAX_NATIVE_EVENTS]
Definition: aix.c:41
#define PAPI_NATIVE_AND_MASK
long long tmp
Definition: iozone.c:12031
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 _ultra_set_domain ( hwd_control_state_t this_state,
int  domain 
)

Definition at line 333 of file solaris-ultra.c.

334 {
335  papi_cpc_event_t *command = &this_state->counter_cmd;
336  cpc_event_t *event = &command->cmd;
337  uint64_t pcr = event->ce_pcr;
338  int did = 0;
339 
340  pcr = pcr | 0x7;
341  pcr = pcr ^ 0x7;
342 
343  if ( domain & PAPI_DOM_USER ) {
344  pcr = pcr | 1 << CPC_ULTRA_PCR_USR;
345  did = 1;
346  }
347  if ( domain & PAPI_DOM_KERNEL ) {
348  pcr = pcr | 1 << CPC_ULTRA_PCR_SYS;
349  did = 1;
350  }
351  /* DOMAIN ERROR */
352  if ( !did ) {
353  return ( PAPI_EINVAL );
354  }
355 
356  event->ce_pcr = pcr;
357 
358  return ( PAPI_OK );
359 }
return PAPI_OK
Definition: linux-nvml.c:458
#define PAPI_DOM_KERNEL
Definition: fpapi.h:22
return PAPI_EINVAL
Definition: linux-nvml.c:408
char command[512]
Definition: iozone.c:21329
cpc_event_t cmd
Definition: solaris-ultra.h:53
#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:

_ultra_shutdown ( hwd_context_t ctx)

Definition at line 864 of file solaris-ultra.c.

865 {
866 
867  return PAPI_OK;
868 }
return PAPI_OK
Definition: linux-nvml.c:458
void action ( void arg,
int  regno,
const char *  name,
uint8_t  bits 
)
static

Definition at line 571 of file solaris-ultra.c.

572 {
573  int i;
574 
575  if ( arg == 0 ) {
576  ++nctrs;
577  return;
578  }
579  assert( regno == 0 || regno == 1 );
580  for ( i = 0; i < nctrs; ++i ) {
581  if ( strcmp( ctrs[i].name, name ) == 0 ) {
582  ctrs[i].bits[regno] = bits;
583  ctrs[i].bitmask |= ( 1 << regno );
584  return;
585  }
586  }
587  memset( &ctrs[i], 0, sizeof ( ctrs[i] ) );
588  ctrs[i].name = papi_strdup( name );
589  ctrs[i].bits[regno] = bits;
590  ctrs[i].bitmask = ( 1 << regno );
591  ++nctrs;
592 }
memset(eventId, 0, size)
#define papi_strdup(a)
Definition: papi_memory.h:39
int i
Definition: fileop.c:140
static int nctrs
char * name
Definition: iozone.c:23648
static struct ctr_info * ctrs

Here is the call graph for this function:

Here is the caller graph for this function:

static void add_preset ( hwi_search_t tab,
int np,
einfo_t  e 
)
static

Definition at line 495 of file solaris-ultra.c.

496 {
497  /* Parse the event info string and build the PAPI preset.
498  * If parse fails, just return, otherwise increment the table
499  * size. We assume that the table is big enough.
500  */
501  char *p;
502  char *q;
503  char op;
504  char e1[MAX_ENAME], e2[MAX_ENAME];
505  int i;
506  int ne;
507  int ne2;
508 
509  p = e.event_str;
510  /* Assume p is the name of a native event, the sum of two
511  * native events, or the difference of two native events.
512  * This could be extended with a real parser (hint).
513  */
514  while ( isspace( *p ) )
515  ++p;
516  q = p;
517  i = 0;
518  while ( isalnum( *p ) || ( *p == '_' ) ) {
519  if ( i >= MAX_ENAME - 1 )
520  break;
521  e1[i] = *p++;
522  ++i;
523  }
524  e1[i] = 0;
525  if ( *p == '+' || *p == '-' )
526  op = *p++;
527  else
528  op = 0;
529  while ( isspace( *p ) )
530  ++p;
531  q = p;
532  i = 0;
533  while ( isalnum( *p ) || ( *p == '_' ) ) {
534  if ( i >= MAX_ENAME - 1 )
535  break;
536  e2[i] = *p++;
537  ++i;
538  }
539  e2[i] = 0;
540 
541  if ( e2[0] == 0 && e1[0] == 0 ) {
542  return;
543  }
544  if ( e2[0] == 0 || op == 0 ) {
545  ne = srch_event( e1 );
546  if ( ne == -1 )
547  return;
548  tab[*np].event_code = e.papi_event;
549  tab[*np].data.derived = 0;
550  tab[*np].data.native[0] = PAPI_NATIVE_MASK | ne;
551  tab[*np].data.native[1] = PAPI_NULL;
552  memset( tab[*np].data.operation, 0,
553  sizeof ( tab[*np].data.operation ) );
554  ++*np;
555  return;
556  }
557  ne = srch_event( e1 );
558  ne2 = srch_event( e2 );
559  if ( ne == -1 || ne2 == -1 )
560  return;
561  tab[*np].event_code = e.papi_event;
562  tab[*np].data.derived = ( op == '-' ) ? DERIVED_SUB : DERIVED_ADD;
563  tab[*np].data.native[0] = PAPI_NATIVE_MASK | ne;
564  tab[*np].data.native[1] = PAPI_NATIVE_MASK | ne2;
565  tab[*np].data.native[2] = PAPI_NULL;
566  memset( tab[*np].data.operation, 0, sizeof ( tab[*np].data.operation ) );
567  ++*np;
568 }
memset(eventId, 0, size)
#define PAPI_NATIVE_MASK
#define DERIVED_SUB
Definition: papi_internal.h:74
#define PAPI_NULL
Definition: fpapi.h:13
unsigned int event_code
Definition: papi_preset.h:14
#define DERIVED_ADD
Definition: papi_internal.h:70
int i
Definition: fileop.c:140
int native[PAPI_EVENTS_IN_DERIVED_EVENT]
Definition: papi_preset.h:16
char * event_str
Definition: solaris-ultra.c:51
char operation[PAPI_2MAX_STR_LEN]
Definition: papi_preset.h:17
again struct sockaddr sizeof(struct sockaddr_in))
static int srch_event(char *e1)
int int op
Definition: iozone.c:19389
#define MAX_ENAME
Definition: solaris-ultra.c:36
unsigned int papi_event
Definition: solaris-ultra.c:50

Here is the call graph for this function:

Here is the caller graph for this function:

static int build_tables ( void  )
static

Definition at line 389 of file solaris-ultra.c.

390 {
391  int i;
392  int regno;
393  int npic;
394  einfo_t *ep;
395  int n;
396  int npresets;
397  npic = cpc_getnpic( cpuver );
398  nctrs = 0;
399  for ( regno = 0; regno < npic; ++regno ) {
400  cpc_walk_names( cpuver, regno, 0, action );
401  }
402  SUBDBG( "%d counters\n", nctrs );
403  if ( ( ctrs = papi_malloc( nctrs * sizeof ( struct ctr_info ) ) ) == 0 ) {
404  return PAPI_ENOMEM;
405  }
406  nctrs = 0;
407  for ( regno = 0; regno < npic; ++regno ) {
408  cpc_walk_names( cpuver, regno, ( void * ) 1, action );
409  }
410  SUBDBG( "%d counters\n", nctrs );
411 #if DEBUG
412  if ( ISLEVEL( DEBUG_SUBSTRATE ) ) {
413  for ( i = 0; i < nctrs; ++i ) {
414  SUBDBG( "%s: bits (%#x,%#x) pics %#x\n", ctrs[i].name, ctrs[i].bits[0],
415  ctrs[i].bits[1], ctrs[i].bitmask );
416  }
417  }
418 #endif
419  /* Build the native event table */
420  if ( ( native_table =
421  papi_malloc( nctrs * sizeof ( native_info_t ) ) ) == 0 ) {
422  papi_free( ctrs );
423  return PAPI_ENOMEM;
424  }
425  for ( i = 0; i < nctrs; ++i ) {
426  native_table[i].name[39] = 0;
427  strncpy( native_table[i].name, ctrs[i].name, 39 );
428  if ( ctrs[i].bitmask & 1 )
429  native_table[i].encoding[0] = ctrs[i].bits[0];
430  else
431  native_table[i].encoding[0] = -1;
432  if ( ctrs[i].bitmask & 2 )
433  native_table[i].encoding[1] = ctrs[i].bits[1];
434  else
435  native_table[i].encoding[1] = -1;
436  }
437  papi_free( ctrs );
438 
439  /* Build the preset table */
440  if ( cpuver <= CPC_ULTRA2 ) {
441  n = sizeof ( us2info ) / sizeof ( einfo_t );
442  ep = us2info;
443  } else if ( cpuver <= LASTULTRA3 ) {
444  n = sizeof ( us3info ) / sizeof ( einfo_t );
445  ep = us3info;
446  } else
447  return PAPI_ECMP;
448  preset_table = papi_malloc( ( n + 1 ) * sizeof ( hwi_search_t ) );
449  npresets = 0;
450  for ( i = 0; i < n; ++i ) {
451  add_preset( preset_table, &npresets, ep[i] );
452  }
453  memset( &preset_table[npresets], 0, sizeof ( hwi_search_t ) );
454 
455 #ifdef DEBUG
456  if ( ISLEVEL( DEBUG_SUBSTRATE ) ) {
457  SUBDBG( "Native table: %d\n", nctrs );
458  for ( i = 0; i < nctrs; ++i ) {
459  SUBDBG( "%40s: %8x %8x\n", native_table[i].name,
460  native_table[i].encoding[0], native_table[i].encoding[1] );
461  }
462  SUBDBG( "\nPreset table: %d\n", npresets );
463  for ( i = 0; preset_table[i].event_code != 0; ++i ) {
464  SUBDBG( "%8x: op %2d e0 %8x e1 %8x\n",
465  preset_table[i].event_code,
466  preset_table[i].data.derived,
467  preset_table[i].data.native[0],
468  preset_table[i].data.native[1] );
469  }
470  }
471 #endif
472 
474 
475  return PAPI_OK;
476 }
memset(eventId, 0, size)
#define PAPI_ENOMEM
Definition: fpapi.h:107
papi_vector_t _solaris_vector
#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
hwi_search_t * preset_table
return PAPI_OK
Definition: linux-nvml.c:458
static einfo_t us3info[]
Definition: solaris-ultra.c:53
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
static void add_preset(hwi_search_t *tab, int *np, einfo_t e)
static int cpuver
#define LASTULTRA3
Definition: solaris-ultra.c:33
int i
Definition: fileop.c:140
static void action(void *arg, int regno, const char *name, uint8_t bits)
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
#define PAPI_ECMP
Definition: fpapi.h:109
static int nctrs
int native[PAPI_EVENTS_IN_DERIVED_EVENT]
Definition: papi_preset.h:16
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
static einfo_t us2info[]
Definition: solaris-ultra.c:77
char * name
Definition: iozone.c:23648
#define ISLEVEL(a)
Definition: papi_debug.h:54
static struct ctr_info * ctrs
int n
Definition: mendes-alt.c:164
#define DEBUG_SUBSTRATE
Definition: papi_debug.h:27

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 975 of file solaris-ultra.c.

977 {
978  *values = val;
979  strncpy( names, nam, len );
980  names[len - 1] = 0;
981 }
int val
Definition: libbif.c:235
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
const char * names[NUM_EVENTS]
static void dispatch_emt ( int  signal,
siginfo_t *  sip,
void arg 
)
static

Definition at line 132 of file solaris-ultra.c.

133 {
134  int event_counter;
136  caddr_t address;
137  ctx.si = sip;
138  ctx.ucontext = arg;
139  SUBDBG( "%d, %p, %p\n", signal, sip, arg );
140 
141  if ( sip->si_code == EMT_CPCOVF ) {
142  papi_cpc_event_t *sample;
143  EventSetInfo_t *ESI;
144  ThreadInfo_t *thread = NULL;
145  int t, overflow_vector, readvalue;
146 
147  thread = _papi_hwi_lookup_thread( 0 );
148  ESI = ( EventSetInfo_t * ) thread->running_eventset;
149  int cidx = ESI->CmpIdx;
150 
151  if ( ( ESI == NULL ) || ( ( ESI->state & PAPI_OVERFLOWING ) == 0 ) ) {
152  OVFDBG( "Either no eventset or eventset not set to overflow.\n" );
153  return;
154  }
155 
156  if ( ESI->master != thread ) {
157  PAPIERROR
158  ( "eventset->thread 0x%lx vs. current thread 0x%lx mismatch",
159  ESI->master, thread );
160  return;
161  }
162 
163  event_counter = ESI->overflow.event_counter;
164  sample = &( ESI->ctl_state->counter_cmd );
165 
166  /* GROSS! This is a hack to 'push' the correct values
167  back into the hardware, such that when PAPI handles
168  the overflow and reads the values, it gets the correct ones.
169  */
170 
171  /* Find which HW counter overflowed */
172 
173  if ( ESI->EventInfoArray[ESI->overflow.EventIndex[0]].pos[0] == 0 )
174  t = 0;
175  else
176  t = 1;
177 
178  if ( cpc_take_sample( &sample->cmd ) == -1 )
179  return;
180  if ( event_counter == 1 ) {
181  /* only one event is set to be the overflow monitor */
182 
183  /* generate the overflow vector */
184  overflow_vector = 1 << t;
185  /* reset the threshold */
186  sample->cmd.ce_pic[t] = UINT64_MAX - ESI->overflow.threshold[0];
187  } else {
188  /* two events are set to be the overflow monitors */
189  overflow_vector = 0;
190  readvalue = sample->cmd.ce_pic[0];
191  if ( readvalue >= 0 ) {
192  /* the first counter overflowed */
193 
194  /* generate the overflow vector */
195  overflow_vector = 1;
196  /* reset the threshold */
197  if ( t == 0 )
198  sample->cmd.ce_pic[0] =
199  UINT64_MAX - ESI->overflow.threshold[0];
200  else
201  sample->cmd.ce_pic[0] =
202  UINT64_MAX - ESI->overflow.threshold[1];
203  }
204  readvalue = sample->cmd.ce_pic[1];
205  if ( readvalue >= 0 ) {
206  /* the second counter overflowed */
207 
208  /* generate the overflow vector */
209  overflow_vector ^= 1 << 1;
210  /* reset the threshold */
211  if ( t == 0 )
212  sample->cmd.ce_pic[1] =
213  UINT64_MAX - ESI->overflow.threshold[1];
214  else
215  sample->cmd.ce_pic[1] =
216  UINT64_MAX - ESI->overflow.threshold[0];
217  }
218  SUBDBG( "overflow_vector, = %d\n", overflow_vector );
219  /* something is wrong here */
220  if ( overflow_vector == 0 ) {
221  PAPIERROR( "BUG! overflow_vector is 0, dropping interrupt" );
222  return;
223  }
224  }
225 
226  /* Call the regular overflow function in extras.c */
227  if ( thread->running_eventset[cidx]->overflow.
229  address = GET_OVERFLOW_ADDRESS(ctx);
230  _papi_hwi_dispatch_overflow_signal( ( void * ) &ctx, address, NULL,
231  overflow_vector, 0, &thread,
232  cidx );
233  } else {
234  PAPIERROR( "Additional implementation needed in dispatch_emt!" );
235  }
236 
237 #if DEBUG
238  dump_cmd( sample );
239 #endif
240  /* push back the correct values and start counting again */
241  if ( cpc_bind_event( &sample->cmd, sample->flags ) == -1 )
242  return;
243  } else {
244  SUBDBG( "dispatch_emt() dropped, si_code = %d\n", sip->si_code );
245  return;
246  }
247 }
long long flags
Definition: iozone.c:12330
#define PAPI_OVERFLOWING
Definition: fpapi.h:33
t
Definition: iozone.c:23562
cpc_event_t cmd
Definition: solaris-ultra.h:53
EventSetOverflowInfo_t overflow
struct _ThreadInfo * master
static int cidx
Definition: event_info.c:40
#define OVFDBG(format, args...)
Definition: papi_debug.h:68
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,...)
EventInfo_t * EventInfoArray
int pos[PAPI_EVENTS_IN_DERIVED_EVENT]
#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
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
hwd_control_state_t * ctl_state
#define GET_OVERFLOW_ADDRESS(ctx)
Definition: aix-context.h:12
void dump_cmd(pm_prog_t *t)
Definition: aix.c:795
signal(SIGINT, signal_handler)
papi_cpc_event_t counter_cmd
Definition: solaris-ultra.h:61
if(gettimeofday(&tp,(struct timezone *) NULL)==-1) perror("gettimeofday")

Here is the call graph for this function:

Here is the caller graph for this function:

static void dump_cmd ( papi_cpc_event_t t)
static

Definition at line 120 of file solaris-ultra.c.

121 {
122  SUBDBG( "cpc_event_t.ce_cpuver %d\n", t->cmd.ce_cpuver );
123  SUBDBG( "ce_tick %llu\n", t->cmd.ce_tick );
124  SUBDBG( "ce_pic[0] %llu ce_pic[1] %llu\n", t->cmd.ce_pic[0],
125  t->cmd.ce_pic[1] );
126  SUBDBG( "ce_pcr 0x%llx\n", t->cmd.ce_pcr );
127  SUBDBG( "flags %#x\n", t->flags );
128 }
cpc_event_t cmd
Definition: solaris-ultra.h:53
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
static void lock_init ( void  )
static

Definition at line 643 of file solaris-ultra.c.

644 {
645  memset( lock, 0x0, sizeof ( rwlock_t ) * PAPI_MAX_LOCK );
646 }
memset(eventId, 0, size)
#define PAPI_MAX_LOCK
Definition: papi_lock.h:18
atomic_p lock[]
Definition: aix.c:25

Here is the call graph for this function:

Here is the caller graph for this function:

void print_walk_names ( void arg,
int  regno,
const char *  name,
uint8_t  bits 
)

Definition at line 382 of file solaris-ultra.c.

383 {
384  SUBDBG( arg, regno, name, bits );
385 }
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
char * name
Definition: iozone.c:23648

Here is the caller graph for this function:

static int scan_prtconf ( char *  cpuname,
int  len_cpuname,
int hz,
int ver 
)
static

Definition at line 250 of file solaris-ultra.c.

251 {
252  /* This code courtesy of our friends in Germany. Thanks Rudolph Berrendorf! */
253  /* See the PCL home page for the German version of PAPI. */
254  /* Modified by Nils Smeds, all new bugs are my fault */
255  /* The routine now looks for the first "Node" with the following: */
256  /* "device_type" = 'cpu' */
257  /* "name" = (Any value) */
258  /* "sparc-version" = (Any value) */
259  /* "clock-frequency" = (Any value) */
260  int ihz, version;
261  char line[256], cmd[80], name[256];
262  FILE *f = NULL;
263  char cmd_line[PAPI_HUGE_STR_LEN + PAPI_HUGE_STR_LEN], fname[L_tmpnam];
264  unsigned int matched;
265 
266  /*??? system call takes very long */
267  /* get system configuration and put output into file */
268 
269  tmpnam( fname );
270  SUBDBG( "Temporary name %s\n", fname );
271 
272  sprintf( cmd_line, "/usr/sbin/prtconf -vp > %s", fname );
273  SUBDBG( "Executing %s\n", cmd_line );
274  if ( system( cmd_line ) == -1 ) {
275  remove( fname );
276  return -1;
277  }
278 
279  f = fopen( fname, "r" );
280  /* open output file */
281  if ( f == NULL ) {
282  remove( fname );
283  return -1;
284  }
285 
286  /* ignore all lines until we reach something with a sparc line */
287  matched = 0x0;
288  ihz = -1;
289  while ( fgets( line, 256, f ) != NULL ) {
290  /*SUBDBG(">>> %s",line); */
291  if ( ( sscanf( line, "%s", cmd ) == 1 )
292  && strstr( line, "Node 0x" ) ) {
293  matched = 0x0;
294  /*SUBDBG("Found 'Node' -- search reset. (0x%2.2x)\n",matched); */
295  } else {
296  if ( strstr( cmd, "device_type:" ) && strstr( line, "'cpu'" ) ) {
297  matched |= 0x1;
298  SUBDBG( "Found 'cpu'. (0x%2.2x)\n", matched );
299  } else if ( !strcmp( cmd, "sparc-version:" ) &&
300  ( sscanf( line, "%s %#x", cmd, &version ) == 2 ) ) {
301  matched |= 0x2;
302  SUBDBG( "Found version=%d. (0x%2.2x)\n", version, matched );
303  } else if ( !strcmp( cmd, "clock-frequency:" ) &&
304  ( sscanf( line, "%s %#x", cmd, &ihz ) == 2 ) ) {
305  matched |= 0x4;
306  SUBDBG( "Found ihz=%d. (0x%2.2x)\n", ihz, matched );
307  } else if ( !strcmp( cmd, "name:" ) &&
308  ( sscanf( line, "%s %s", cmd, name ) == 2 ) ) {
309  matched |= 0x8;
310  SUBDBG( "Found name: %s. (0x%2.2x)\n", name, matched );
311  }
312  }
313  if ( ( matched & 0xF ) == 0xF )
314  break;
315  }
316  SUBDBG( "Parsing found name=%s, speed=%dHz, version=%d\n", name, ihz,
317  version );
318 
319  if ( matched ^ 0x0F )
320  ihz = -1;
321  else {
322  *hz = ( float ) ihz;
323  *ver = version;
324  strncpy( cpuname, name, len_cpuname );
325  }
326 
327  return ihz;
328 
329  /* End stolen code */
330 }
#define PAPI_HUGE_STR_LEN
Definition: fpapi.h:42
sprintf(splash[splash_line++],"\tIozone: Performance Test of File I/O\n")
double f(double a)
Definition: cpi.c:23
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
char version[]
Definition: fileop.c:134
sscanf(mnc->m_child_port,"%d",&mc.m_child_port)
char * name
Definition: iozone.c:23648
int system()

Here is the call graph for this function:

Here is the caller graph for this function:

static int set_default_domain ( hwd_control_state_t ctrl_state,
int  domain 
)
static

Definition at line 624 of file solaris-ultra.c.

625 {
626  /* This doesn't exist on this platform */
627 
628  if ( domain == PAPI_DOM_OTHER )
629  return ( PAPI_EINVAL );
630 
631  return ( _ultra_set_domain( ctrl_state, domain ) );
632 }
#define PAPI_DOM_OTHER
Definition: fpapi.h:23
return PAPI_EINVAL
Definition: linux-nvml.c:408
int _ultra_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 current_state,
int  granularity 
)
static

Definition at line 635 of file solaris-ultra.c.

636 {
637  return ( set_granularity( current_state, granularity ) );
638 }
static int set_granularity(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_granularity ( hwd_control_state_t this_state,
int  domain 
)
static

Definition at line 362 of file solaris-ultra.c.

363 {
364  switch ( domain ) {
365  case PAPI_GRN_PROCG:
366  case PAPI_GRN_SYS:
367  case PAPI_GRN_SYS_CPU:
368  case PAPI_GRN_PROC:
369  return PAPI_ECMP;
370  case PAPI_GRN_THR:
371  break;
372  default:
373  return ( PAPI_EINVAL );
374  }
375  return ( PAPI_OK );
376 }
#define PAPI_GRN_SYS_CPU
Definition: fpapi.h:72
return PAPI_OK
Definition: linux-nvml.c:458
#define PAPI_GRN_SYS
Definition: fpapi.h:71
#define PAPI_GRN_PROC
Definition: fpapi.h:69
return PAPI_EINVAL
Definition: linux-nvml.c:408
#define PAPI_GRN_PROCG
Definition: fpapi.h:70
#define PAPI_ECMP
Definition: fpapi.h:109
#define PAPI_GRN_THR
Definition: fpapi.h:67

Here is the caller graph for this function:

static int set_inherit ( EventSetInfo_t global,
int  arg 
)
static

Definition at line 599 of file solaris-ultra.c.

600 {
601  return PAPI_ECMP;
602 
603 /*
604  hwd_control_state_t *machdep = (hwd_control_state_t *)global->machdep;
605  papi_cpc_event_t *command= &machdep->counter_cmd;
606 
607  return(PAPI_EINVAL);
608 */
609 
610 #if 0
611  if ( arg == 0 ) {
612  if ( command->flags & CPC_BIND_LWP_INHERIT )
613  command->flags = command->flags ^ CPC_BIND_LWP_INHERIT;
614  } else if ( arg == 1 ) {
615  command->flags = command->flags | CPC_BIND_LWP_INHERIT;
616  } else
617  return ( PAPI_EINVAL );
618 
619  return ( PAPI_OK );
620 #endif
621 }
return PAPI_OK
Definition: linux-nvml.c:458
return PAPI_EINVAL
Definition: linux-nvml.c:408
char command[512]
Definition: iozone.c:21329
#define PAPI_ECMP
Definition: fpapi.h:109
static int srch_event ( char *  e1)
static

Definition at line 479 of file solaris-ultra.c.

480 {
481  int i;
482 
483  for ( i = 0; i < nctrs; ++i ) {
484  if ( strcmp( e1, native_table[i].name ) == 0 )
485  break;
486  }
487  if ( i >= nctrs )
488  return -1;
489  return i;
490 }
int i
Definition: fileop.c:140
native_event_entry_t native_table[PAPI_MAX_NATIVE_EVENTS]
Definition: aix.c:41
static int nctrs
char * name
Definition: iozone.c:23648

Here is the caller graph for this function:

Variable Documentation

papi_os_vector_t _papi_os_vector
Initial value:
= {
.get_memory_info = _solaris_get_memory_info,
.get_dmem_info = _solaris_get_dmem_info,
.update_shlib_info = _solaris_update_shlib_info,
.get_system_info = _solaris_get_system_info,
.get_real_usec = _solaris_get_real_usec,
.get_real_cycles = _solaris_get_real_cycles,
.get_virt_usec = _solaris_get_virt_usec,
}
int _solaris_update_shlib_info(papi_mdi_t *mdi)
long long _solaris_get_virt_usec(void)
long long _solaris_get_real_cycles(void)
int _solaris_get_memory_info(PAPI_hw_info_t *hw, int id)
long long _solaris_get_real_usec(void)
int _solaris_get_system_info(papi_mdi_t *mdi)
int _solaris_get_dmem_info(PAPI_dmem_info_t *d)

Definition at line 1169 of file solaris-ultra.c.

papi_vector_t _solaris_vector

Definition at line 100 of file solaris-ultra.c.

int cpuver
static

Definition at line 113 of file solaris-ultra.c.

struct ctr_info* ctrs
static

Definition at line 105 of file solaris-ultra.c.

rwlock_t lock[PAPI_MAX_LOCK]

Definition at line 640 of file solaris-ultra.c.

native_info_t* native_table
static

Definition at line 102 of file solaris-ultra.c.

int nctrs
static

Definition at line 106 of file solaris-ultra.c.

int pcr_shift[2]
static

Definition at line 114 of file solaris-ultra.c.

hwi_search_t* preset_search_map

Definition at line 116 of file solaris-ultra.c.

hwi_search_t* preset_table
static

Definition at line 103 of file solaris-ultra.c.

einfo_t us2info[]
static
Initial value:
= {
{PAPI_L1_ICM, "IC_ref-IC_hit"},
{PAPI_L2_TCM, "EC_ref-EC_hit"},
{PAPI_CA_SNP, "EC_snoop_cb"},
{PAPI_CA_INV, "EC_snoop_inv"},
{PAPI_L1_LDM, "DC_rd-DC_rd_hit"},
{PAPI_L1_STM, "DC_wr-DC_wr_hit"},
{PAPI_L2_LDM, "EC_rd_miss"},
{PAPI_BR_MSP, "Dispatch0_mispred"},
{PAPI_TOT_IIS, "Instr_cnt"},
{PAPI_TOT_INS, "Instr_cnt"},
{PAPI_LD_INS, "DC_rd"},
{PAPI_SR_INS, "DC_wr"},
{PAPI_TOT_CYC, "Cycle_cnt"},
{PAPI_L1_DCR, "DC_rd"},
{PAPI_L1_DCW, "DC_wr"},
{PAPI_L1_ICH, "IC_hit"},
{PAPI_L2_ICH, "EC_ic_hit"},
{PAPI_L1_ICA, "IC_ref"},
{PAPI_L2_TCH, "EC_hit"},
{PAPI_L2_TCA, "EC_ref"},
}
#define PAPI_L2_TCM
Definition: fpapi.h:142
#define PAPI_CA_SNP
Definition: fpapi.h:144
#define PAPI_LD_INS
Definition: fpapi.h:188
#define PAPI_L1_ICA
Definition: fpapi.h:211
#define PAPI_L1_ICM
Definition: fpapi.h:136
#define PAPI_TOT_INS
Definition: fpapi.h:185
#define PAPI_L1_DCW
Definition: fpapi.h:205
#define PAPI_L1_ICH
Definition: fpapi.h:208
#define PAPI_L1_DCR
Definition: fpapi.h:202
#define PAPI_CA_INV
Definition: fpapi.h:147
#define PAPI_TOT_CYC
Definition: fpapi.h:194
#define PAPI_SR_INS
Definition: fpapi.h:189
#define PAPI_BR_MSP
Definition: fpapi.h:181
#define PAPI_TOT_IIS
Definition: fpapi.h:184
#define PAPI_L2_TCH
Definition: fpapi.h:221
#define PAPI_L1_STM
Definition: fpapi.h:159
#define PAPI_L1_LDM
Definition: fpapi.h:158
#define PAPI_L2_TCA
Definition: fpapi.h:224
#define PAPI_L2_LDM
Definition: fpapi.h:160
#define PAPI_L2_ICH
Definition: fpapi.h:209

Definition at line 77 of file solaris-ultra.c.

einfo_t us3info[]
static
Initial value:
= {
{PAPI_FP_INS, "FA_pipe_completion+FM_pipe_completion"},
{PAPI_FAD_INS, "FA_pipe_completion"},
{PAPI_FML_INS, "FM_pipe_completion"},
{PAPI_TLB_IM, "ITLB_miss"},
{PAPI_TLB_DM, "DTLB_miss"},
{PAPI_TOT_CYC, "Cycle_cnt"},
{PAPI_TOT_IIS, "Instr_cnt"},
{PAPI_TOT_INS, "Instr_cnt"},
{PAPI_L2_TCM, "EC_misses"},
{PAPI_L2_ICM, "EC_ic_miss"},
{PAPI_L1_ICM, "IC_miss"},
{PAPI_L1_LDM, "DC_rd_miss"},
{PAPI_L1_STM, "DC_wr_miss"},
{PAPI_L2_LDM, "EC_rd_miss"},
{PAPI_BR_MSP, "IU_Stat_Br_miss_taken+IU_Stat_Br_miss_untaken"},
{PAPI_L1_DCR, "DC_rd"},
{PAPI_L1_DCW, "DC_wr"},
{PAPI_L1_ICH, "IC_ref-IC_miss"},
{PAPI_L1_ICA, "IC_ref"},
{PAPI_L2_TCH, "EC_ref-EC_misses"},
{PAPI_L2_TCA, "EC_ref"},
}
#define PAPI_TLB_IM
Definition: fpapi.h:156
#define PAPI_L2_TCM
Definition: fpapi.h:142
#define PAPI_L1_ICA
Definition: fpapi.h:211
#define PAPI_L1_ICM
Definition: fpapi.h:136
#define PAPI_TOT_INS
Definition: fpapi.h:185
#define PAPI_L1_DCW
Definition: fpapi.h:205
#define PAPI_TLB_DM
Definition: fpapi.h:155
#define PAPI_L1_ICH
Definition: fpapi.h:208
#define PAPI_L1_DCR
Definition: fpapi.h:202
#define PAPI_TOT_CYC
Definition: fpapi.h:194
#define PAPI_FML_INS
Definition: fpapi.h:232
#define PAPI_BR_MSP
Definition: fpapi.h:181
#define PAPI_FP_INS
Definition: fpapi.h:187
#define PAPI_FAD_INS
Definition: fpapi.h:233
#define PAPI_TOT_IIS
Definition: fpapi.h:184
#define PAPI_L2_TCH
Definition: fpapi.h:221
#define PAPI_L1_STM
Definition: fpapi.h:159
#define PAPI_L2_ICM
Definition: fpapi.h:138
#define PAPI_L1_LDM
Definition: fpapi.h:158
#define PAPI_L2_TCA
Definition: fpapi.h:224
#define PAPI_L2_LDM
Definition: fpapi.h:160

Definition at line 53 of file solaris-ultra.c.