PAPI 7.1.0.0
Loading...
Searching...
No Matches
perfmon-ia64.h
Go to the documentation of this file.
1#ifndef _PAPI_PERFMON_IA64_H
2#define _PAPI_PERFMON_IA64_H
3/*
4* File: perfmon-ia64.h
5* CVS: $Id$
6* Author: Philip Mucci
7* mucci@cs.utk.edu
8*
9* Kevin London
10* london@cs.utk.edu
11*
12* Mods: Per Ekman
13* pek@pdc.kth.se
14*/
15
16#include <stdio.h>
17#include <stdlib.h>
18#include <stdarg.h>
19#include <unistd.h>
20#include <assert.h>
21#include <errno.h>
22#include <string.h>
23#include <math.h>
24#include <limits.h>
25#include <time.h>
26#include <fcntl.h>
27#include <ctype.h>
28#include <inttypes.h>
29#include <libgen.h>
30#include <sys/syscall.h>
31#include <sys/types.h>
32#include <sys/time.h>
33#include <sys/times.h>
34#include <sys/ucontext.h>
35#include <sys/types.h>
36#include <sys/ipc.h>
37
38#if defined(HAVE_MMTIMER)
39#include <sys/ioctl.h>
40#include <sys/mman.h>
41#include <linux/mmtimer.h>
42#ifndef MMTIMER_FULLNAME
43#define MMTIMER_FULLNAME "/dev/mmtimer"
44#endif
45#endif
46
47#ifdef __INTEL_COMPILER
48#include <ia64intrin.h>
49#include <ia64regs.h>
50#endif
51
52#include "papi_defines.h"
53#include "config.h"
54#include "perfmon/pfmlib.h"
55#include "perfmon/perfmon.h"
60
61typedef int ia64_register_t;
63typedef int ia64_reg_alloc_t;
64
65
66#define NUM_PMCS PFMLIB_MAX_PMCS
67#define NUM_PMDS PFMLIB_MAX_PMDS
68
69typedef struct param_t
70{
75 void *mod_inp; /* model specific input parameters to libpfm */
76 void *mod_outp; /* model specific output parameters from libpfm */
78// #ifdef ITANIUM3
79typedef struct mont_param_t
80{
84// typedef pfmw_mont_param_t pfmw_ita_param_t;
85// #elif defined(ITANIUM2)
86typedef struct ita2_param_t
87{
91// typedef pfmw_ita2_param_t pfmw_ita_param_t;
92// #else
94// #endif
95
96#define PMU_FIRST_COUNTER 4
97
98typedef union
99{
104
105
106#define MAX_COUNTERS 12
107#define MAX_COUNTER_TERMS MAX_COUNTERS
108
109typedef struct ia64_control_state
110{
111 /* Which counters to use? Bits encode counters to use, may be duplicates */
113
115
116 /* Buffer to pass to kernel to control the counters */
118
119 long long counters[MAX_COUNTERS];
121
122/* sampling buffer address */
124 /* Buffer to pass to library to control the counters */
126
127
128typedef struct itanium_preset_search
129{
130 /* Preset code */
132 /* Derived code */
134 /* Strings to look for */
135 char *( findme[MAX_COUNTERS] );
136 char operation[MAX_COUNTERS * 5];
138
139typedef struct
140{
141 int fd; /* file descriptor */
142 pid_t tid; /* thread id */
143#if defined(USE_PROC_PTTIMER)
144 int stat_fd;
145#endif
147
148#undef hwd_context_t
150
151#include "linux-context.h"
152
153//#undef hwd_ucontext_t
154//typedef struct sigcontext hwd_ucontext_t;
155
156/* Override void* definitions from PAPI framework layer */
157/* with typedefs to conform to PAPI component layer code. */
158#undef hwd_reg_alloc_t
160#undef hwd_register_t
162#undef hwd_control_state_t
164
165#define SMPL_BUF_NENTRIES 64
166#define M_PMD(x) (1UL<<(x))
167
168#define MONT_DEAR_REGS_MASK (M_PMD(32)|M_PMD(33)|M_PMD(36))
169#define MONT_ETB_REGS_MASK (M_PMD(38)| M_PMD(39)| \
170 M_PMD(48)|M_PMD(49)|M_PMD(50)|M_PMD(51)|M_PMD(52)|M_PMD(53)|M_PMD(54)|M_PMD(55)|\
171 M_PMD(56)|M_PMD(57)|M_PMD(58)|M_PMD(59)|M_PMD(60)|M_PMD(61)|M_PMD(62)|M_PMD(63))
172
173#define DEAR_REGS_MASK (M_PMD(2)|M_PMD(3)|M_PMD(17))
174#define BTB_REGS_MASK (M_PMD(8)|M_PMD(9)|M_PMD(10)|M_PMD(11)|M_PMD(12)|M_PMD(13)|M_PMD(14)|M_PMD(15)|M_PMD(16))
175
176#endif /* _PAPI_PERFMON_IA64_H */
#define MAX_COUNTERS
Definition: perfctr-x86.h:8
int ia64_register_map_t
Definition: perfmon-ia64.h:62
int ia64_reg_alloc_t
Definition: perfmon-ia64.h:63
ia64_context_t hwd_context_t
Definition: perfmon-ia64.h:149
int ia64_register_t
Definition: perfmon-ia64.h:61
#define NUM_PMCS
Definition: perfmon-ia64.h:66
#define NUM_PMDS
Definition: perfmon-ia64.h:67
ia64_reg_alloc_t hwd_reg_alloc_t
Definition: perfmon-ia64.h:159
ia64_register_t hwd_register_t
Definition: perfmon-ia64.h:161
int pfmw_ita1_param_t
Definition: perfmon-ia64.h:93
ia64_control_state_t hwd_control_state_t
Definition: perfmon-ia64.h:163
pfmw_ita_param_t ita_lib_param
Definition: perfmon-ia64.h:114
ia64_register_map_t bits
Definition: perfmon-ia64.h:112
pfmlib_ita2_output_param_t ita2_output_param
Definition: perfmon-ia64.h:89
pfmlib_ita2_input_param_t ita2_input_param
Definition: perfmon-ia64.h:88
pfmlib_mont_input_param_t mont_input_param
Definition: perfmon-ia64.h:81
pfmlib_mont_output_param_t mont_output_param
Definition: perfmon-ia64.h:82
pfmlib_input_param_t inp
Definition: perfmon-ia64.h:73
pfmlib_output_param_t outp
Definition: perfmon-ia64.h:74
void * mod_inp
Definition: perfmon-ia64.h:75
void * mod_outp
Definition: perfmon-ia64.h:76
pfmw_mont_param_t mont_param
Definition: perfmon-ia64.h:102
pfmw_ita1_param_t ita_param
Definition: perfmon-ia64.h:100
pfmw_ita2_param_t ita2_param
Definition: perfmon-ia64.h:101