File: aix.h

package info (click to toggle)
papi 5.7.0+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 9,856 kB
  • sloc: ansic: 93,265; fortran: 3,338; xml: 2,460; makefile: 815; sh: 290
file content (138 lines) | stat: -rw-r--r-- 3,165 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#ifndef _PAPI_AIX_H			 /* _PAPI_AIX */
#define _PAPI_AIX_H

/****************************/
/* THIS IS OPEN SOURCE CODE */
/****************************/

/* 
* File:    pmapi-ppc64.h
* Author:  Maynard Johnson
*          maynardj@us.ibm.com
* Mods:    <your name here>
*          <your email address>
*/



#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <unistd.h>
#include <assert.h>
#include <string.h>
#include <libgen.h>
#include <time.h>
#if defined( _AIXVERSION_510) || defined(_AIXVERSION_520)
#include <sys/procfs.h>
#include <sys/cred.h>
#endif
#include <procinfo.h>
#include <dlfcn.h>
#include <sys/time.h>
#include <sys/times.h>
#include <sys/systemcfg.h>
#include <sys/processor.h>
#include <sys/atomic_op.h>
#include <sys/utsname.h>


#include "pmapi.h"

#define ANY_THREAD_GETS_SIGNAL
#define POWER_MAX_COUNTERS MAX_COUNTERS
#define MAX_COUNTER_TERMS MAX_COUNTERS
#define MAX_MPX_COUNTERS 32
#define INVALID_EVENT -2
#define POWER_MAX_COUNTERS_MAPPING 8

extern _text;
extern _etext;
extern _edata;
extern _end;
extern _data;

/* globals */
#ifdef PM_INITIALIZE
#ifdef _AIXVERSION_510
#define PMINFO_T pm_info2_t
#define PMEVENTS_T pm_events2_t
#else
#define PMINFO_T pm_info_t
#define PMEVENTS_T pm_events_t
#endif
PMINFO_T pminfo;
#else
#define PMINFO_T pm_info_t
#define PMEVENTS_T pm_events_t
/*pm_info_t pminfo;*/
#endif

#include "aix-context.h"

/* define the vector structure at the bottom of this file */

#define PM_INIT_FLAGS PM_VERIFIED|PM_UNVERIFIED|PM_CAVEAT|PM_GET_GROUPS

#ifdef PM_INITIALIZE
typedef pm_info2_t hwd_pminfo_t;
typedef pm_events2_t hwd_pmevents_t;
#else
typedef pm_info_t hwd_pminfo_t;
typedef pm_events_t hwd_pmevents_t;
#endif

#include "ppc64_events.h"

typedef struct ppc64_pmapi_control
{
	/* Buffer to pass to the kernel to control the counters */
	pm_prog_t counter_cmd;
	int group_id;
	/* Space to read the counters */
	pm_data_t state;
} ppc64_pmapi_control_t;

typedef struct ppc64_reg_alloc
{
	int ra_position;
	unsigned int ra_group[GROUP_INTS];
	int ra_counter_cmd[MAX_COUNTERS];
} ppc64_reg_alloc_t;

typedef struct ppc64_pmapi_context
{
	/* this structure is a work in progress */
	ppc64_pmapi_control_t cntrl;
} ppc64_pmapi_context_t;

/* Override void* definitions from PAPI framework layer */
/* typedefs to conform to hardware independent PAPI code. */
#undef hwd_control_state_t
#undef hwd_reg_alloc_t
#undef hwd_context_t
typedef ppc64_pmapi_control_t hwd_control_state_t;
typedef ppc64_reg_alloc_t hwd_reg_alloc_t;
typedef ppc64_pmapi_context_t hwd_context_t;

/*
typedef struct hwd_groups {
  // group number from the pmapi pm_groups_t struct 
  //int group_id;
  // Buffer containing counter cmds for this group 
  unsigned char counter_cmd[POWER_MAX_COUNTERS];
} hwd_groups_t;
*/

/* prototypes */
extern int _aix_set_granularity( hwd_control_state_t * this_state, int domain );
extern int _papi_hwd_init_preset_search_map( hwd_pminfo_t * info );

extern int _aix_get_memory_info( PAPI_hw_info_t * mem_info, int type );
extern int _aix_get_dmem_info( PAPI_dmem_info_t * d );

/* Machine dependent info structure */
extern pm_groups_info_t pmgroups;

#endif /* _PAPI_AIX */