The Gaudi Framework
v26r1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
perfmon_v2.h
Go to the documentation of this file.
1
/*
2
* This file contains the user level interface description for
3
* the perfmon-2.x interface on Linux.
4
*
5
* Copyright (c) 2001-2006 Hewlett-Packard Development Company, L.P.
6
* Contributed by Stephane Eranian <eranian@hpl.hp.com>
7
*/
8
#ifndef __PERFMON_V2_H__
9
#define __PERFMON_V2_H__
10
11
#ifndef __PERFMON_H__
12
#error "this file should never be included directly, use perfmon.h instead"
13
#endif
14
15
/*
16
* argument to v2.3 and onward pfm_create_context()
17
*/
18
typedef
struct
{
19
uint32_t
ctx_flags
;
/* noblock/block/syswide */
20
uint32_t
ctx_reserved1
;
/* for future use */
21
uint64_t
ctx_reserved3[7];
/* for future use */
22
}
pfarg_ctx_t
;
23
24
/*
25
* argument for pfm_write_pmcs()
26
*/
27
typedef
struct
{
28
uint16_t
reg_num
;
/* which register */
29
uint16_t
reg_set
;
/* event set for this register */
30
uint32_t
reg_flags
;
/* REGFL flags */
31
uint64_t
reg_value
;
/* pmc value */
32
uint64_t
reg_reserved2[4];
/* for future use */
33
}
pfarg_pmc_t
;
34
35
/*
36
* argument pfm_write_pmds() and pfm_read_pmds()
37
*/
38
typedef
struct
{
39
uint16_t
reg_num
;
/* which register */
40
uint16_t
reg_set
;
/* event set for this register */
41
uint32_t
reg_flags
;
/* REGFL flags */
42
uint64_t
reg_value
;
/* initial pmc/pmd value */
43
uint64_t
reg_long_reset
;
/* reset after buffer overflow notification */
44
uint64_t
reg_short_reset
;
/* reset after counter overflow */
45
uint64_t
reg_last_reset_val
;
/* return: PMD last reset value */
46
uint64_t
reg_ovfl_switch_cnt
;
/* how many overflow before switch for next set */
47
uint64_t
reg_reset_pmds[
PFM_PMD_BV
];
/* which other PMDS to reset on overflow */
48
uint64_t
reg_smpl_pmds[
PFM_PMD_BV
];
/* which other PMDS to record when the associated PMD overflows */
49
uint64_t
reg_smpl_eventid
;
/* opaque sampling event identifier */
50
uint64_t
reg_random_mask
;
/* bitmask used to limit random value */
51
uint32_t
reg_random_seed
;
/* seed for randomization (DEPRECATED) */
52
uint32_t
reg_reserved2[7];
/* for future use */
53
}
pfarg_pmd_t
;
54
55
/*
56
* optional argument to pfm_start(), pass NULL if no arg needed
57
*/
58
typedef
struct
{
59
uint16_t
start_set
;
/* event set to start with */
60
uint16_t
start_reserved1
;
/* for future use */
61
uint32_t
start_reserved2
;
/* for future use */
62
uint64_t
reserved3[3];
/* for future use */
63
}
pfarg_start_t
;
64
65
/*
66
* argument to pfm_load_context()
67
*/
68
typedef
struct
{
69
uint32_t
load_pid
;
/* thread or CPU to attach to */
70
uint16_t
load_set
;
/* set to load first */
71
uint16_t
load_reserved1
;
/* for future use */
72
uint64_t
load_reserved2[3];
/* for future use */
73
}
pfarg_load_t
;
74
75
#ifndef PFMLIB_OLD_PFMV2
76
typedef
struct
{
77
uint16_t
set_id
;
/* which set */
78
uint16_t
set_reserved1
;
/* for future use */
79
uint32_t
set_flags
;
/* SETFL flags */
80
uint64_t
set_timeout
;
/* requested/effective switch timeout in nsecs */
81
uint64_t
reserved[6];
/* for future use */
82
}
pfarg_setdesc_t
;
83
84
typedef
struct
{
85
uint16_t
set_id
;
/* which set */
86
uint16_t
set_reserved1
;
/* for future use */
87
uint32_t
set_flags
;
/* for future use */
88
uint64_t
set_ovfl_pmds[
PFM_PMD_BV
];
/* out: last ovfl PMDs */
89
uint64_t
set_runs
;
/* out: #times set was active */
90
uint64_t
set_timeout
;
/* out: leftover switch timeout (nsecs) */
91
uint64_t
set_act_duration
;
/* out: time set was active (nsecs) */
92
uint64_t
set_avail_pmcs[
PFM_PMC_BV
];
/* out: available PMCs */
93
uint64_t
set_avail_pmds[
PFM_PMD_BV
];
/* out: available PMDs */
94
uint64_t
set_reserved3[6];
/* for future use */
95
}
pfarg_setinfo_t
;
96
#endif
97
98
99
#ifdef PFMLIB_OLD_PFMV2
100
101
/*
102
* argument to pfm_create_evtsets()/pfm_delete_evtsets()
103
*/
104
typedef
struct
{
105
uint16_t
set_id;
/* which set */
106
uint16_t
set_id_next;
/* next set to go to (must use PFM_SETFL_EXPL_NEXT) */
107
uint32_t
set_flags;
/* SETFL flags */
108
uint64_t
set_timeout;
/* requested switch timeout in nsecs */
109
uint64_t
set_mmap_offset;
/* cookie to pass as mmap offset to access 64-bit virtual PMD */
110
uint64_t
reserved[5];
/* for future use */
111
}
pfarg_setdesc_t
;
112
113
/*
114
* argument to pfm_getinfo_evtsets()
115
*/
116
typedef
struct
{
117
uint16_t
set_id;
/* which set */
118
uint16_t
set_id_next;
/* output: next set to go to (must use PFM_SETFL_EXPL_NEXT) */
119
uint32_t
set_flags;
/* output: SETFL flags */
120
uint64_t
set_ovfl_pmds[
PFM_PMD_BV
];
/* output: last ovfl PMDs which triggered a switch from set */
121
uint64_t
set_runs;
/* output: number of times the set was active */
122
uint64_t
set_timeout;
/* output:effective/leftover switch timeout in nsecs */
123
uint64_t
set_act_duration;
/* number of cycles set was active (syswide only) */
124
uint64_t
set_mmap_offset;
/* cookie to pass as mmap offset to access 64-bit virtual PMD */
125
uint64_t
set_avail_pmcs[
PFM_PMC_BV
];
126
uint64_t
set_avail_pmds[
PFM_PMD_BV
];
127
uint64_t
reserved[4];
/* for future use */
128
}
pfarg_setinfo_t
;
129
130
#ifdef __crayx2
131
#define PFM_MAX_HW_PMDS 512
132
#else
133
#define PFM_MAX_HW_PMDS 256
134
#endif
135
#define PFM_HW_PMD_BV PFM_BVSIZE(PFM_MAX_HW_PMDS)
136
137
typedef
struct
{
138
uint32_t
msg_type;
/* PFM_MSG_OVFL */
139
uint32_t
msg_ovfl_pid;
/* process id */
140
uint64_t
msg_ovfl_pmds[PFM_HW_PMD_BV];
/* which PMDs overflowed */
141
uint16_t
msg_active_set;
/* active set at the time of overflow */
142
uint16_t
msg_ovfl_cpu;
/* cpu on which the overflow occurred */
143
uint32_t
msg_ovfl_tid;
/* thread id */
144
uint64_t
msg_ovfl_ip;
/* instruction pointer where overflow interrupt happened */
145
}
pfarg_ovfl_msg_t
;
146
147
#endif
/* PFMLIB_OLD_PFMV2 */
148
149
extern
os_err_t
pfm_create_context
(
pfarg_ctx_t
*ctx,
char
*smpl_name,
150
void
*smpl_arg,
size_t
smpl_size);
151
extern
os_err_t
pfm_write_pmcs
(
int
fd,
pfarg_pmc_t
*pmcs,
int
count);
152
extern
os_err_t
pfm_write_pmds
(
int
fd,
pfarg_pmd_t
*pmds,
int
count);
153
extern
os_err_t
pfm_read_pmds
(
int
fd,
pfarg_pmd_t
*pmds,
int
count);
154
extern
os_err_t
pfm_load_context
(
int
fd,
pfarg_load_t
*load);
155
extern
os_err_t
pfm_start
(
int
fd,
pfarg_start_t
*
start
);
156
extern
os_err_t
pfm_stop
(
int
fd);
157
extern
os_err_t
pfm_restart
(
int
fd);
158
extern
os_err_t
pfm_create_evtsets
(
int
fd,
pfarg_setdesc_t
*setd,
int
count);
159
extern
os_err_t
pfm_getinfo_evtsets
(
int
fd,
pfarg_setinfo_t
*info,
int
count);
160
extern
os_err_t
pfm_delete_evtsets
(
int
fd,
pfarg_setdesc_t
*setd,
int
count);
161
extern
os_err_t
pfm_unload_context
(
int
fd);
162
163
#endif
/* _PERFMON_V2_H */
GaudiProfiling
src
component
perfmon
perfmon_v2.h
Generated on Mon Feb 16 2015 11:56:57 for The Gaudi Framework by
1.8.2