PAPI  5.0.1.0
ppc64_events.h
Go to the documentation of this file.
00001 #ifndef PPC64_EVENTS_H_
00002 #define PPC64_EVENTS_H_
00003 /* 
00004 * File:    ppc64_events.h
00005 * CVS:     
00006 * Author:  Maynard Johnson
00007 *          maynardj@us.ibm.com
00008 * Mods:    <your name here>
00009 *          <your email address>
00010 *          
00011 */
00012 
00013 #ifdef ARCH_EVTS
00014 #include ARCH_EVTS
00015 #else
00016 #define GROUP_INTS 8
00017 #if defined(_POWER5)
00018 #define PAPI_MAX_NATIVE_EVENTS 512
00019 #elif defined(_POWER6)
00020 #define PAPI_MAX_NATIVE_EVENTS 1024
00021 #else
00022 #define PAPI_MAX_NATIVE_EVENTS 1024
00023 #endif
00024 #define MAX_GROUPS (GROUP_INTS * 32)
00025 #endif
00026 
00027 typedef struct PPC64_register
00028 {
00029     /* indicate which counters this event can live on */
00030     unsigned int selector;
00031     /* Buffers containing counter cmds for each possible metric */
00032     int counter_cmd[MAX_COUNTERS];
00033     /* which group this event belongs */
00034     unsigned int group[GROUP_INTS];
00035 } PPC64_register_t;
00036 
00037 /* Override void* definitions from PAPI framework layer */
00038 /* with typedefs to conform to PAPI component layer code. */
00039 #undef hwd_register_t
00040 typedef PPC64_register_t hwd_register_t;
00041 
00042 typedef struct PPC64_groups
00043 {
00044 #ifdef __perfctr__
00045     unsigned int mmcr0;
00046     unsigned int mmcr1L;
00047     unsigned int mmcr1U;
00048     unsigned int mmcra;
00049     unsigned int counter_cmd[MAX_COUNTERS];
00050 #else
00051 /* Buffer containing counter cmds for this group */
00052     unsigned int counter_cmd[MAX_COUNTERS];
00053 #endif
00054 } PPC64_groups_t;
00055 
00056 typedef PPC64_groups_t hwd_groups_t;
00057 
00058 typedef struct native_event_entry
00059 {
00060     /* description of the resources required by this native event */
00061     hwd_register_t resources;
00062     /* If it exists, then this is the name of this event */
00063     char *name;
00064     /* If it exists, then this is the description of this event */
00065     char *description;
00066 } native_event_entry_t;
00067 
00068 typedef struct PPC64_native_map
00069 {
00070     /* native event name */
00071     char *name;
00072     /* real index in the native table */
00073     int index;
00074 } PPC64_native_map_t;
00075 
00076 extern native_event_entry_t native_table[PAPI_MAX_NATIVE_EVENTS];
00077 #ifndef __perfctr__
00078 extern hwd_pminfo_t pminfo;
00079 extern pm_groups_info_t pmgroups;
00080 #endif
00081 extern PPC64_native_map_t native_name_map[PAPI_MAX_NATIVE_EVENTS];
00082 extern hwd_groups_t group_map[MAX_GROUPS];
00083 
00084 int check_native_name(  );
00085 
00086 #endif /*PPC64_EVENTS_H_ */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines