|
PAPI
5.0.1.0
|
00001 #ifndef _PAPI_AIX_H /* _PAPI_AIX */ 00002 #define _PAPI_AIX_H 00003 00004 /****************************/ 00005 /* THIS IS OPEN SOURCE CODE */ 00006 /****************************/ 00007 00008 /* 00009 * File: pmapi-ppc64.h 00010 * Author: Maynard Johnson 00011 * maynardj@us.ibm.com 00012 * Mods: <your name here> 00013 * <your email address> 00014 */ 00015 00016 00017 00018 #include <stdlib.h> 00019 #include <stdio.h> 00020 #include <stdarg.h> 00021 #include <unistd.h> 00022 #include <assert.h> 00023 #include <string.h> 00024 #include <libgen.h> 00025 #include <time.h> 00026 #if defined( _AIXVERSION_510) || defined(_AIXVERSION_520) 00027 #include <sys/procfs.h> 00028 #include <sys/cred.h> 00029 #endif 00030 #include <procinfo.h> 00031 #include <dlfcn.h> 00032 #include <sys/time.h> 00033 #include <sys/times.h> 00034 #include <sys/systemcfg.h> 00035 #include <sys/processor.h> 00036 #include <sys/atomic_op.h> 00037 #include <sys/utsname.h> 00038 00039 00040 #include "pmapi.h" 00041 00042 #define ANY_THREAD_GETS_SIGNAL 00043 #define POWER_MAX_COUNTERS MAX_COUNTERS 00044 #define MAX_COUNTER_TERMS MAX_COUNTERS 00045 #define MAX_MPX_COUNTERS 32 00046 #define INVALID_EVENT -2 00047 #define POWER_MAX_COUNTERS_MAPPING 8 00048 00049 extern _text; 00050 extern _etext; 00051 extern _edata; 00052 extern _end; 00053 extern _data; 00054 00055 /* globals */ 00056 #ifdef PM_INITIALIZE 00057 #ifdef _AIXVERSION_510 00058 #define PMINFO_T pm_info2_t 00059 #define PMEVENTS_T pm_events2_t 00060 #else 00061 #define PMINFO_T pm_info_t 00062 #define PMEVENTS_T pm_events_t 00063 #endif 00064 PMINFO_T pminfo; 00065 #else 00066 #define PMINFO_T pm_info_t 00067 #define PMEVENTS_T pm_events_t 00068 /*pm_info_t pminfo;*/ 00069 #endif 00070 00071 #include "aix-context.h" 00072 00073 /* define the vector structure at the bottom of this file */ 00074 00075 #define PM_INIT_FLAGS PM_VERIFIED|PM_UNVERIFIED|PM_CAVEAT|PM_GET_GROUPS 00076 00077 #ifdef PM_INITIALIZE 00078 typedef pm_info2_t hwd_pminfo_t; 00079 typedef pm_events2_t hwd_pmevents_t; 00080 #else 00081 typedef pm_info_t hwd_pminfo_t; 00082 typedef pm_events_t hwd_pmevents_t; 00083 #endif 00084 00085 #include "ppc64_events.h" 00086 00087 typedef struct ppc64_pmapi_control 00088 { 00089 /* Buffer to pass to the kernel to control the counters */ 00090 pm_prog_t counter_cmd; 00091 int group_id; 00092 /* Space to read the counters */ 00093 pm_data_t state; 00094 } ppc64_pmapi_control_t; 00095 00096 typedef struct ppc64_reg_alloc 00097 { 00098 int ra_position; 00099 unsigned int ra_group[GROUP_INTS]; 00100 int ra_counter_cmd[MAX_COUNTERS]; 00101 } ppc64_reg_alloc_t; 00102 00103 typedef struct ppc64_pmapi_context 00104 { 00105 /* this structure is a work in progress */ 00106 ppc64_pmapi_control_t cntrl; 00107 } ppc64_pmapi_context_t; 00108 00109 /* Override void* definitions from PAPI framework layer */ 00110 /* typedefs to conform to hardware independent PAPI code. */ 00111 #undef hwd_control_state_t 00112 #undef hwd_reg_alloc_t 00113 #undef hwd_context_t 00114 typedef ppc64_pmapi_control_t hwd_control_state_t; 00115 typedef ppc64_reg_alloc_t hwd_reg_alloc_t; 00116 typedef ppc64_pmapi_context_t hwd_context_t; 00117 00118 /* 00119 typedef struct hwd_groups { 00120 // group number from the pmapi pm_groups_t struct 00121 //int group_id; 00122 // Buffer containing counter cmds for this group 00123 unsigned char counter_cmd[POWER_MAX_COUNTERS]; 00124 } hwd_groups_t; 00125 */ 00126 00127 /* prototypes */ 00128 extern int _aix_set_granularity( hwd_control_state_t * this_state, int domain ); 00129 extern int _papi_hwd_init_preset_search_map( hwd_pminfo_t * info ); 00130 00131 extern int _aix_get_memory_info( PAPI_hw_info_t * mem_info, int type ); 00132 extern int _aix_get_dmem_info( PAPI_dmem_info_t * d ); 00133 00134 /* Machine dependent info structure */ 00135 extern pm_groups_info_t pmgroups; 00136 00137 #endif /* _PAPI_AIX */ 00138