PAPI  5.0.1.0
linux-bgq.h
Go to the documentation of this file.
00001 /****************************/
00002 /* THIS IS OPEN SOURCE CODE */
00003 /****************************/
00004 
00022 #ifndef _LINUX_BGQ_H
00023 #define _LINUX_BGQ_H
00024 
00025 #include <stdlib.h>
00026 #include <stdio.h>
00027 #include <string.h>
00028 #include <unistd.h>
00029 #include <sys/profil.h>
00030 #include <assert.h>
00031 #include <limits.h>
00032 #include <signal.h>
00033 #include <errno.h>
00034 #include <sys/ucontext.h>
00035 #include <stdarg.h>
00036 #include <ctype.h>
00037 //#include <pthread.h>
00038 
00039 #include "linux-bgq-common.h"
00040 /* Header required to obtain BGQ personality */
00041 #include "process_impl.h"
00042 #include "linux-context.h"
00043 
00044 /* this number assumes that there will never be more events than indicated */
00045 #define BGQ_PUNIT_MAX_COUNTERS PEVT_PUNIT_LAST_EVENT
00046 #define MAX_COUNTER_TERMS BGQ_PUNIT_MAX_COUNTERS
00047 // keep a large enough gap between actual BGPM events and our local opcode events
00048 #define OPCODE_BUF ( MAX_COUNTERS + MAX_COUNTERS ) 
00049 
00050 
00051 #include "papi.h"
00052 #include "papi_preset.h"
00053 
00054 
00055 
00056 typedef struct
00057 {
00058     int preset;             /* Preset code */
00059     int derived;                /* Derived code */
00060     char *( findme[MAX_COUNTER_TERMS] );    /* Strings to look for, more than 1 means derived */
00061     char *operation;            /* PostFix operations between terms */
00062     char *note;             /* In case a note is included with a preset */
00063 } bgq_preset_search_entry_t;
00064 
00065 
00066 // Context structure not used...
00067 typedef struct bgq_context
00068 {
00069     int reserved;
00070 } bgq_context_t;
00071 
00072 // Control state structure...  Holds local copy of read counters...
00073 typedef struct bgq_control_state
00074 {
00075     int EventGroup;
00076     int EventGroup_local[512];
00077     int count;
00078     long_long counters[BGQ_PUNIT_MAX_COUNTERS];
00079     int muxOn;                  // multiplexing on or off flag
00080     int bgpm_eventset_applied;  // BGPM eventGroup applied yes or no flag
00081 } bgq_control_state_t;
00082 
00083 // Register allocation structure
00084 typedef struct bgq_reg_alloc
00085 {
00086     //_papi_hwd_bgq_native_event_id_t id;
00087 } bgq_reg_alloc_t;
00088 
00089 // Register structure not used...
00090 typedef struct bgq_register
00091 {
00092     /* This is used by the framework.It likes it to be !=0 to do something */
00093     unsigned int selector;
00094     /* This is the information needed to locate a BGPM / Punit event */
00095     unsigned eventID;
00096 } bgq_register_t;
00097 
00099 typedef struct bgq_native_event_entry
00100 {
00101     bgq_register_t resources;
00102     char name[PAPI_MAX_STR_LEN];
00103     char description[PAPI_2MAX_STR_LEN];
00104 } bgq_native_event_entry_t;
00105 
00106 /* Override void* definitions from PAPI framework layer */
00107 /* with typedefs to conform to PAPI component layer code. */
00108 #undef  hwd_reg_alloc_t
00109 #undef  hwd_register_t
00110 #undef  hwd_control_state_t
00111 #undef  hwd_context_t
00112 
00113 typedef bgq_reg_alloc_t hwd_reg_alloc_t;
00114 typedef bgq_register_t hwd_register_t;
00115 typedef bgq_control_state_t hwd_control_state_t;
00116 typedef bgq_context_t hwd_context_t;
00117 
00118 extern void _papi_hwd_lock( int );
00119 extern void _papi_hwd_unlock( int );
00120 
00121 /* Signal handling functions */
00122 //#undef hwd_siginfo_t
00123 //#undef hwd_ucontext_t
00124 //typedef int hwd_siginfo_t;
00125 //typedef ucontext_t hwd_ucontext_t;
00126 
00127 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines