PAPI 7.1.0.0
Loading...
Searching...
No Matches
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
49extern _text;
50extern _etext;
51extern _edata;
52extern _end;
53extern _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
78typedef pm_info2_t hwd_pminfo_t;
79typedef pm_events2_t hwd_pmevents_t;
80#else
81typedef pm_info_t hwd_pminfo_t;
82typedef pm_events_t hwd_pmevents_t;
83#endif
84
85#include "ppc64_events.h"
86
87typedef struct ppc64_pmapi_control
88{
89 /* Buffer to pass to the kernel to control the counters */
90 pm_prog_t counter_cmd;
92 /* Space to read the counters */
93 pm_data_t state;
95
96typedef struct ppc64_reg_alloc
97{
99 unsigned int ra_group[GROUP_INTS];
100 int ra_counter_cmd[MAX_COUNTERS];
102
103typedef 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/*
119typedef 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 */
128extern int _aix_set_granularity( hwd_control_state_t * this_state, int domain );
130
131extern int _aix_get_memory_info( PAPI_hw_info_t * mem_info, int type );
132extern int _aix_get_dmem_info( PAPI_dmem_info_t * d );
133
134/* Machine dependent info structure */
135extern pm_groups_info_t pmgroups;
136
137#endif /* _PAPI_AIX */
138
hwd_pminfo_t pminfo
Definition: aix.c:43
pm_events_t hwd_pmevents_t
Definition: aix.h:82
pm_groups_info_t pmgroups
Definition: aix.c:44
pm_info_t hwd_pminfo_t
Definition: aix.h:81
#define PMINFO_T
Definition: aix.h:66
int _aix_get_memory_info(PAPI_hw_info_t *mem_info, int type)
Definition: aix-memory.c:16
_edata
int _aix_set_granularity(hwd_control_state_t *this_state, int domain)
Definition: aix.c:486
int _aix_get_dmem_info(PAPI_dmem_info_t *d)
Definition: aix-memory.c:64
int _papi_hwd_init_preset_search_map(hwd_pminfo_t *info)
ppc64_pmapi_control_t hwd_control_state_t
Definition: aix.h:114
_etext
_text
_end
ppc64_reg_alloc_t hwd_reg_alloc_t
Definition: aix.h:115
ppc64_pmapi_context_t hwd_context_t
Definition: aix.h:116
_data
uint16_t type
#define MAX_COUNTERS
Definition: perfctr-x86.h:8
A pointer to the following is passed to PAPI_get_dmem_info()
Definition: papi.h:865
Hardware info structure.
Definition: papi.h:774
ppc64_pmapi_control_t cntrl
Definition: aix.h:106
pm_data_t state
Definition: aix.h:93
pm_prog_t counter_cmd
Definition: aix.h:90
int ra_position
Definition: aix.h:98