|
PAPI
5.0.1.0
|
00001 #ifndef _PAPI_SOLARIS_ULTRA_H 00002 #define _PAPI_SOLARIS_ULTRA_H 00003 00004 #include <stdio.h> 00005 #include <stdlib.h> 00006 #include <fcntl.h> 00007 #include <unistd.h> 00008 #include <assert.h> 00009 #include <string.h> 00010 #include <libgen.h> 00011 #include <limits.h> 00012 #include <synch.h> 00013 #include <procfs.h> 00014 #include <libcpc.h> 00015 #include <libgen.h> 00016 #include <ctype.h> 00017 #include <errno.h> 00018 #include <sys/times.h> 00019 #include <sys/time.h> 00020 #include <sys/types.h> 00021 #include <sys/processor.h> 00022 #include <sys/procset.h> 00023 #include <syms.h> 00024 #include <dlfcn.h> 00025 #include <sys/stat.h> 00026 00027 #include "papi_defines.h" 00028 00029 #define MAX_COUNTERS 2 00030 #define MAX_COUNTER_TERMS MAX_COUNTERS 00031 #define PAPI_MAX_NATIVE_EVENTS 71 00032 #define MAX_NATIVE_EVENT PAPI_MAX_NATIVE_EVENTS 00033 #define MAX_NATIVE_EVENT_USII 22 00034 00035 /* Defines in papi_internal.h cause compile warnings on solaris because typedefs are done here */ 00036 #undef hwd_context_t 00037 #undef hwd_control_state_t 00038 #undef hwd_reg_alloc_t 00039 #undef hwd_register_t 00040 #undef hwd_siginfo_t 00041 #undef hwd_ucontext_t 00042 00043 typedef int hwd_reg_alloc_t; 00044 00045 typedef struct US_register 00046 { 00047 int event[MAX_COUNTERS]; 00048 } hwd_register_t; 00049 00050 typedef struct papi_cpc_event 00051 { 00052 /* Structure to libcpc */ 00053 cpc_event_t cmd; 00054 /* Flags to kernel */ 00055 int flags; 00056 } papi_cpc_event_t; 00057 00058 typedef struct hwd_control_state 00059 { 00060 /* Buffer to pass to the kernel to control the counters */ 00061 papi_cpc_event_t counter_cmd; 00062 /* overflow event counter */ 00063 int overflow_num; 00064 } hwd_control_state_t; 00065 00066 typedef int hwd_register_map_t; 00067 00068 typedef struct _native_info 00069 { 00070 /* native name */ 00071 char name[40]; 00072 /* Buffer to pass to the kernel to control the counters */ 00073 int encoding[MAX_COUNTERS]; 00074 } native_info_t; 00075 00076 #include "solaris-context.h" 00077 00078 typedef int hwd_context_t; 00079 00080 /* Assembler prototypes */ 00081 00082 extern void cpu_sync( void ); 00083 extern unsigned long long get_tick( void ); 00084 extern caddr_t _start, _end, _etext, _edata; 00085 00086 extern rwlock_t lock[PAPI_MAX_LOCK]; 00087 00088 #define _papi_hwd_lock(lck) rw_wrlock(&lock[lck]); 00089 00090 #define _papi_hwd_unlock(lck) rw_unlock(&lock[lck]); 00091 00092 #endif