PAPI  5.4.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
linux-bgq.h
Go to the documentation of this file.
1 /****************************/
2 /* THIS IS OPEN SOURCE CODE */
3 /****************************/
4 
22 #ifndef _LINUX_BGQ_H
23 #define _LINUX_BGQ_H
24 
25 #include <stdlib.h>
26 #include <stdio.h>
27 #include <string.h>
28 #include <unistd.h>
29 #include <sys/profil.h>
30 #include <assert.h>
31 #include <limits.h>
32 #include <signal.h>
33 #include <errno.h>
34 #include <sys/ucontext.h>
35 #include <stdarg.h>
36 #include <ctype.h>
37 //#include <pthread.h>
38 
39 #include "linux-bgq-common.h"
40 /* Header required to obtain BGQ personality */
41 #include "process_impl.h"
42 #include "linux-context.h"
43 
44 /* this number assumes that there will never be more events than indicated */
45 #define BGQ_PUNIT_MAX_COUNTERS UPC_P_NUM_COUNTERS
46 #define BGQ_PUNIT_MAX_EVENTS PEVT_PUNIT_LAST_EVENT
47 #define MAX_COUNTER_TERMS BGQ_PUNIT_MAX_COUNTERS
48 // keep a large enough gap between actual BGPM events and our local opcode events
49 #define OPCODE_BUF ( MAX_COUNTERS + MAX_COUNTERS )
50 
51 
52 #include "papi.h"
53 #include "papi_preset.h"
54 
55 
56 
57 typedef struct
58 {
59  int preset; /* Preset code */
60  int derived; /* Derived code */
61  char *( findme[MAX_COUNTER_TERMS] ); /* Strings to look for, more than 1 means derived */
62  char *operation; /* PostFix operations between terms */
63  char *note; /* In case a note is included with a preset */
65 
66 
67 // Context structure not used...
68 typedef struct bgq_context
69 {
70  int reserved;
72 
73 typedef struct bgq_overflow
74 {
75  int threshold;
78 
79 // Control state structure... Holds local copy of read counters...
80 typedef struct bgq_control_state
81 {
83  int EventGroup_local[512];
84  int count;
86  int muxOn; // multiplexing on or off flag
87  int overflow; // overflow enable
89  bgq_overflow_t overflow_list[512];
90  int bgpm_eventset_applied; // BGPM eventGroup applied yes or no flag
92 
93 // Register allocation structure
94 typedef struct bgq_reg_alloc
95 {
96  //_papi_hwd_bgq_native_event_id_t id;
98 
99 // Register structure not used...
100 typedef struct bgq_register
101 {
102  /* This is used by the framework.It likes it to be !=0 to do something */
103  unsigned int selector;
104  /* This is the information needed to locate a BGPM / Punit event */
105  unsigned eventID;
107 
109 typedef struct bgq_native_event_entry
110 {
113  char description[PAPI_2MAX_STR_LEN];
115 
116 /* Override void* definitions from PAPI framework layer */
117 /* with typedefs to conform to PAPI component layer code. */
118 #undef hwd_reg_alloc_t
119 #undef hwd_register_t
120 #undef hwd_control_state_t
121 #undef hwd_context_t
122 
127 
128 extern void _papi_hwd_lock( int );
129 extern void _papi_hwd_unlock( int );
130 
131 /* Signal handling functions */
132 //#undef hwd_siginfo_t
133 //#undef hwd_ucontext_t
134 //typedef int hwd_siginfo_t;
135 //typedef ucontext_t hwd_ucontext_t;
136 
137 #endif
Definition: linux-bgq.h:57
#define hwd_control_state_t
#define hwd_reg_alloc_t
Return codes and api definitions.
char * note
Definition: linux-bgq.h:63
#define PAPI_2MAX_STR_LEN
Definition: papi.h:464
#define MAX_COUNTER_TERMS
Definition: linux-bgq.h:47
#define hwd_context_t
char * operation
Definition: linux-bgq.h:62
#define _papi_hwd_unlock(lck)
Definition: aix-lock.h:11
unsigned int selector
Definition: linux-bgq.h:103
int derived
Definition: linux-bgq.h:60
This file is part of the source code for a component that enables PAPI-C to access hardware monitorin...
bgq_register_t resources
Definition: linux-bgq.h:111
char * name
Definition: iozone.c:23648
#define long_long
Definition: papi.h:550
#define PAPI_MAX_STR_LEN
Definition: papi.h:463
#define BGQ_PUNIT_MAX_COUNTERS
Definition: linux-bgq.h:45
unsigned eventID
Definition: linux-bgq.h:105
#define _papi_hwd_lock(lck)
Definition: aix-lock.h:6
#define hwd_register_t
Definition: linux-bgq.h:109
int preset
Definition: linux-bgq.h:59