PAPI  5.4.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
aix.h
Go to the documentation of this file.
1 #ifndef _PAPI_AIX_H /* _PAPI_AIX */
2 #define _PAPI_AIX_H
3 
4 /****************************/
5 /* THIS IS OPEN SOURCE CODE */
6 /****************************/
7 
8 /*
9 * File: pmapi-ppc64.h
10 * Author: Maynard Johnson
11 * maynardj@us.ibm.com
12 * Mods: <your name here>
13 * <your email address>
14 */
15 
16 
17 
18 #include <stdlib.h>
19 #include <stdio.h>
20 #include <stdarg.h>
21 #include <unistd.h>
22 #include <assert.h>
23 #include <string.h>
24 #include <libgen.h>
25 #include <time.h>
26 #if defined( _AIXVERSION_510) || defined(_AIXVERSION_520)
27 #include <sys/procfs.h>
28 #include <sys/cred.h>
29 #endif
30 #include <procinfo.h>
31 #include <dlfcn.h>
32 #include <sys/time.h>
33 #include <sys/times.h>
34 #include <sys/systemcfg.h>
35 #include <sys/processor.h>
36 #include <sys/atomic_op.h>
37 #include <sys/utsname.h>
38 
39 
40 #include "pmapi.h"
41 
42 #define ANY_THREAD_GETS_SIGNAL
43 #define POWER_MAX_COUNTERS MAX_COUNTERS
44 #define MAX_COUNTER_TERMS MAX_COUNTERS
45 #define MAX_MPX_COUNTERS 32
46 #define INVALID_EVENT -2
47 #define POWER_MAX_COUNTERS_MAPPING 8
48 
49 extern _text;
50 extern _etext;
51 extern _edata;
52 extern _end;
53 extern _data;
54 
55 /* globals */
56 #ifdef PM_INITIALIZE
57 #ifdef _AIXVERSION_510
58 #define PMINFO_T pm_info2_t
59 #define PMEVENTS_T pm_events2_t
60 #else
61 #define PMINFO_T pm_info_t
62 #define PMEVENTS_T pm_events_t
63 #endif
65 #else
66 #define PMINFO_T pm_info_t
67 #define PMEVENTS_T pm_events_t
68 /*pm_info_t pminfo;*/
69 #endif
70 
71 #include "aix-context.h"
72 
73 /* define the vector structure at the bottom of this file */
74 
75 #define PM_INIT_FLAGS PM_VERIFIED|PM_UNVERIFIED|PM_CAVEAT|PM_GET_GROUPS
76 
77 #ifdef PM_INITIALIZE
78 typedef pm_info2_t hwd_pminfo_t;
79 typedef pm_events2_t hwd_pmevents_t;
80 #else
81 typedef pm_info_t hwd_pminfo_t;
82 typedef pm_events_t hwd_pmevents_t;
83 #endif
84 
85 #include "ppc64_events.h"
86 
87 typedef struct ppc64_pmapi_control
88 {
89  /* Buffer to pass to the kernel to control the counters */
90  pm_prog_t counter_cmd;
91  int group_id;
92  /* Space to read the counters */
93  pm_data_t state;
95 
96 typedef struct ppc64_reg_alloc
97 {
99  unsigned int ra_group[GROUP_INTS];
100  int ra_counter_cmd[MAX_COUNTERS];
102 
103 typedef struct ppc64_pmapi_context
104 {
105  /* this structure is a work in progress */
108 
109 /* Override void* definitions from PAPI framework layer */
110 /* typedefs to conform to hardware independent PAPI code. */
111 #undef hwd_control_state_t
112 #undef hwd_reg_alloc_t
113 #undef hwd_context_t
117 
118 /*
119 typedef struct hwd_groups {
120  // group number from the pmapi pm_groups_t struct
121  //int group_id;
122  // Buffer containing counter cmds for this group
123  unsigned char counter_cmd[POWER_MAX_COUNTERS];
124 } hwd_groups_t;
125 */
126 
127 /* prototypes */
128 extern int _aix_set_granularity( hwd_control_state_t * this_state, int domain );
130 
131 extern int _aix_get_memory_info( PAPI_hw_info_t * mem_info, int type );
132 extern int _aix_get_dmem_info( PAPI_dmem_info_t * d );
133 
134 /* Machine dependent info structure */
135 extern pm_groups_info_t pmgroups;
136 
137 #endif /* _PAPI_AIX */
138 
#define hwd_control_state_t
Hardware info structure.
Definition: papi.h:777
_etext
#define hwd_reg_alloc_t
int _papi_hwd_init_preset_search_map(hwd_pminfo_t *info)
#define MAX_COUNTERS
Definition: perfctr-x86.h:8
_text
hwd_pminfo_t pminfo
Definition: aix.c:43
_end
ppc64_pmapi_control_t cntrl
Definition: aix.h:106
int _aix_get_memory_info(PAPI_hw_info_t *mem_info, int type)
Definition: aix-memory.c:16
int ra_position
Definition: aix.h:98
_edata
A pointer to the following is passed to PAPI_get_dmem_info()
Definition: papi.h:868
pm_groups_info_t pmgroups
Definition: aix.c:44
#define hwd_context_t
#define GROUP_INTS
pm_events_t hwd_pmevents_t
Definition: aix.h:82
_data
pm_info_t hwd_pminfo_t
Definition: aix.h:81
int _aix_set_granularity(hwd_control_state_t *this_state, int domain)
Definition: aix.c:486
#define PMINFO_T
Definition: aix.h:66
int _aix_get_dmem_info(PAPI_dmem_info_t *d)
Definition: aix-memory.c:64
pm_prog_t counter_cmd
Definition: aix.h:90
pm_data_t state
Definition: aix.h:93