|
Packit |
577717 |
#ifndef _PAPI_AIX_H /* _PAPI_AIX */
|
|
Packit |
577717 |
#define _PAPI_AIX_H
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/****************************/
|
|
Packit |
577717 |
/* THIS IS OPEN SOURCE CODE */
|
|
Packit |
577717 |
/****************************/
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
* File: pmapi-ppc64.h
|
|
Packit |
577717 |
* Author: Maynard Johnson
|
|
Packit |
577717 |
* maynardj@us.ibm.com
|
|
Packit |
577717 |
* Mods: <your name here>
|
|
Packit |
577717 |
* <your email address>
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
|
|
Packit |
577717 |
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include <stdlib.h>
|
|
Packit |
577717 |
#include <stdio.h>
|
|
Packit |
577717 |
#include <stdarg.h>
|
|
Packit |
577717 |
#include <unistd.h>
|
|
Packit |
577717 |
#include <assert.h>
|
|
Packit |
577717 |
#include <string.h>
|
|
Packit |
577717 |
#include <libgen.h>
|
|
Packit |
577717 |
#include <time.h>
|
|
Packit |
577717 |
#if defined( _AIXVERSION_510) || defined(_AIXVERSION_520)
|
|
Packit |
577717 |
#include <sys/procfs.h>
|
|
Packit |
577717 |
#include <sys/cred.h>
|
|
Packit |
577717 |
#endif
|
|
Packit |
577717 |
#include <procinfo.h>
|
|
Packit |
577717 |
#include <dlfcn.h>
|
|
Packit |
577717 |
#include <sys/time.h>
|
|
Packit |
577717 |
#include <sys/times.h>
|
|
Packit |
577717 |
#include <sys/systemcfg.h>
|
|
Packit |
577717 |
#include <sys/processor.h>
|
|
Packit |
577717 |
#include <sys/atomic_op.h>
|
|
Packit |
577717 |
#include <sys/utsname.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include "pmapi.h"
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#define ANY_THREAD_GETS_SIGNAL
|
|
Packit |
577717 |
#define POWER_MAX_COUNTERS MAX_COUNTERS
|
|
Packit |
577717 |
#define MAX_COUNTER_TERMS MAX_COUNTERS
|
|
Packit |
577717 |
#define MAX_MPX_COUNTERS 32
|
|
Packit |
577717 |
#define INVALID_EVENT -2
|
|
Packit |
577717 |
#define POWER_MAX_COUNTERS_MAPPING 8
|
|
Packit |
577717 |
|
|
Packit |
577717 |
extern _text;
|
|
Packit |
577717 |
extern _etext;
|
|
Packit |
577717 |
extern _edata;
|
|
Packit |
577717 |
extern _end;
|
|
Packit |
577717 |
extern _data;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/* globals */
|
|
Packit |
577717 |
#ifdef PM_INITIALIZE
|
|
Packit |
577717 |
#ifdef _AIXVERSION_510
|
|
Packit |
577717 |
#define PMINFO_T pm_info2_t
|
|
Packit |
577717 |
#define PMEVENTS_T pm_events2_t
|
|
Packit |
577717 |
#else
|
|
Packit |
577717 |
#define PMINFO_T pm_info_t
|
|
Packit |
577717 |
#define PMEVENTS_T pm_events_t
|
|
Packit |
577717 |
#endif
|
|
Packit |
577717 |
PMINFO_T pminfo;
|
|
Packit |
577717 |
#else
|
|
Packit |
577717 |
#define PMINFO_T pm_info_t
|
|
Packit |
577717 |
#define PMEVENTS_T pm_events_t
|
|
Packit |
577717 |
/*pm_info_t pminfo;*/
|
|
Packit |
577717 |
#endif
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include "aix-context.h"
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/* define the vector structure at the bottom of this file */
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#define PM_INIT_FLAGS PM_VERIFIED|PM_UNVERIFIED|PM_CAVEAT|PM_GET_GROUPS
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#ifdef PM_INITIALIZE
|
|
Packit |
577717 |
typedef pm_info2_t hwd_pminfo_t;
|
|
Packit |
577717 |
typedef pm_events2_t hwd_pmevents_t;
|
|
Packit |
577717 |
#else
|
|
Packit |
577717 |
typedef pm_info_t hwd_pminfo_t;
|
|
Packit |
577717 |
typedef pm_events_t hwd_pmevents_t;
|
|
Packit |
577717 |
#endif
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include "ppc64_events.h"
|
|
Packit |
577717 |
|
|
Packit |
577717 |
typedef struct ppc64_pmapi_control
|
|
Packit |
577717 |
{
|
|
Packit |
577717 |
/* Buffer to pass to the kernel to control the counters */
|
|
Packit |
577717 |
pm_prog_t counter_cmd;
|
|
Packit |
577717 |
int group_id;
|
|
Packit |
577717 |
/* Space to read the counters */
|
|
Packit |
577717 |
pm_data_t state;
|
|
Packit |
577717 |
} ppc64_pmapi_control_t;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
typedef struct ppc64_reg_alloc
|
|
Packit |
577717 |
{
|
|
Packit |
577717 |
int ra_position;
|
|
Packit |
577717 |
unsigned int ra_group[GROUP_INTS];
|
|
Packit |
577717 |
int ra_counter_cmd[MAX_COUNTERS];
|
|
Packit |
577717 |
} ppc64_reg_alloc_t;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
typedef struct ppc64_pmapi_context
|
|
Packit |
577717 |
{
|
|
Packit |
577717 |
/* this structure is a work in progress */
|
|
Packit |
577717 |
ppc64_pmapi_control_t cntrl;
|
|
Packit |
577717 |
} ppc64_pmapi_context_t;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/* Override void* definitions from PAPI framework layer */
|
|
Packit |
577717 |
/* typedefs to conform to hardware independent PAPI code. */
|
|
Packit |
577717 |
#undef hwd_control_state_t
|
|
Packit |
577717 |
#undef hwd_reg_alloc_t
|
|
Packit |
577717 |
#undef hwd_context_t
|
|
Packit |
577717 |
typedef ppc64_pmapi_control_t hwd_control_state_t;
|
|
Packit |
577717 |
typedef ppc64_reg_alloc_t hwd_reg_alloc_t;
|
|
Packit |
577717 |
typedef ppc64_pmapi_context_t hwd_context_t;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
typedef struct hwd_groups {
|
|
Packit |
577717 |
// group number from the pmapi pm_groups_t struct
|
|
Packit |
577717 |
//int group_id;
|
|
Packit |
577717 |
// Buffer containing counter cmds for this group
|
|
Packit |
577717 |
unsigned char counter_cmd[POWER_MAX_COUNTERS];
|
|
Packit |
577717 |
} hwd_groups_t;
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/* prototypes */
|
|
Packit |
577717 |
extern int _aix_set_granularity( hwd_control_state_t * this_state, int domain );
|
|
Packit |
577717 |
extern int _papi_hwd_init_preset_search_map( hwd_pminfo_t * info );
|
|
Packit |
577717 |
|
|
Packit |
577717 |
extern int _aix_get_memory_info( PAPI_hw_info_t * mem_info, int type );
|
|
Packit |
577717 |
extern int _aix_get_dmem_info( PAPI_dmem_info_t * d );
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/* Machine dependent info structure */
|
|
Packit |
577717 |
extern pm_groups_info_t pmgroups;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#endif /* _PAPI_AIX */
|
|
Packit |
577717 |
|