PAPI  5.0.1.0
linux-infiniband.h
Go to the documentation of this file.
00001 /****************************/
00002 /* THIS IS OPEN SOURCE CODE */
00003 /****************************/
00004 
00024 #ifndef _PAPI_INFINIBAND_H
00025 #define _PAPI_INFINIBAND_H
00026 
00027 #define __BUILD_VERSION_TAG__ 1.2
00028 
00029 #include <umad.h>
00030 #include <mad.h>
00031 
00032 /* describes a single counter with its properties */
00033 typedef struct counter_info_struct
00034 {
00035     int idx;
00036     char *name;
00037     char *description;
00038     char *unit;
00039     uint64_t value;
00040     struct counter_info_struct *next;
00041 } counter_info;
00042 
00043 typedef struct
00044 {
00045     int count;
00046     char **data;
00047 } string_list;
00048 
00049 /* infos collected of a single IB port */
00050 typedef struct ib_port_struct
00051 {
00052     char *name;
00053     counter_info *send_cntr;
00054     counter_info *recv_cntr;
00055     int port_rate;
00056     int port_number;
00057     int is_initialized;
00058     uint64_t sum_send_val;
00059     uint64_t sum_recv_val;
00060     uint32_t last_send_val;
00061     uint32_t last_recv_val;
00062     struct ib_port_struct *next;
00063 } ib_port;
00064 
00065 
00066 static void init_ib_counter(  );
00067 static int read_ib_counter(  );
00068 static int init_ib_port( ib_port * portdata );
00069 static void addIBPort( const char *ca_name, umad_port_t * port );
00070 
00071 
00072 /*************************  DEFINES SECTION  *******************************
00073  ***************************************************************************/
00074 /* this number assumes that there will never be more events than indicated */
00075 #define INFINIBAND_MAX_COUNTERS 100
00076 #define INFINIBAND_MAX_COUNTER_TERMS  INFINIBAND_MAX_COUNTERS
00077 
00078 typedef counter_info INFINIBAND_register_t;
00079 typedef counter_info INFINIBAND_native_event_entry_t;
00080 typedef counter_info INFINIBAND_reg_alloc_t;
00081 
00082 
00083 typedef struct INFINIBAND_control_state
00084 {
00085     long long counts[INFINIBAND_MAX_COUNTERS];
00086     int ncounter;
00087 } INFINIBAND_control_state_t;
00088 
00089 
00090 typedef struct INFINIBAND_context
00091 {
00092     INFINIBAND_control_state_t state;
00093 } INFINIBAND_context_t;
00094 
00095 #endif /* _PAPI_INFINIBAND_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines