PAPI 7.1.0.0
Loading...
Searching...
No Matches
pfmlib_itanium_priv.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2001-2006 Hewlett-Packard Development Company, L.P.
3 * Contributed by Stephane Eranian <eranian@hpl.hp.com>
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
17 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
19 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
20 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * This file is part of libpfm, a performance monitoring support library for
23 * applications on Linux/ia64.
24 */
25#ifndef __PFMLIB_ITANIUM_PRIV_H__
26#define __PFMLIB_ITANIUM_PRIV_H__
27
28/*
29 * Itanium encoding structure
30 * (code must be first 8 bits)
31 */
32typedef struct {
33 unsigned long pme_code:8; /* major event code */
34 unsigned long pme_ear:1; /* is EAR event */
35 unsigned long pme_dear:1; /* 1=Data 0=Instr */
36 unsigned long pme_tlb:1; /* 1=TLB 0=Cache */
37 unsigned long pme_btb:1; /* 1=BTB */
38 unsigned long pme_ig1:4; /* ignored */
39 unsigned long pme_umask:16; /* unit mask*/
40 unsigned long pme_ig:32; /* ignored */
42
43#define PME_UMASK_NONE 0x0
44
45typedef union {
46 unsigned long pme_vcode;
47 pme_ita_entry_code_t pme_ita_code; /* must not be larger than vcode */
49
50typedef union {
51 unsigned long qual; /* generic qualifier */
52 struct {
53 unsigned long pme_iar:1; /* instruction address range supported */
54 unsigned long pme_opm:1; /* opcode match supported */
55 unsigned long pme_dar:1; /* data address range supported */
56 unsigned long pme_reserved:61; /* not used */
57 } pme_qual;
59
60typedef struct {
61 char *pme_name;
63 unsigned long pme_counters; /* supported counters */
64 unsigned int pme_maxincr;
66 char *pme_desc;
68
69/*
70 * We embed the umask value into the event code. Because it really is
71 * like a subevent.
72 * pme_code:
73 * - lower 16 bits: major event code
74 * - upper 16 bits: unit mask
75 */
76#define pme_code pme_entry_code.pme_ita_code.pme_code
77#define pme_ear pme_entry_code.pme_ita_code.pme_ear
78#define pme_dear pme_entry_code.pme_ita_code.pme_dear
79#define pme_tlb pme_entry_code.pme_ita_code.pme_tlb
80#define pme_btb pme_entry_code.pme_ita_code.pme_btb
81#define pme_umask pme_entry_code.pme_ita_code.pme_umask
82#define pme_used pme_qualifiers.pme_qual_struct.pme_used
83
84#define event_is_ear(e) ((e)->pme_ear == 1)
85#define event_is_iear(e) ((e)->pme_ear == 1 && (e)->pme_dear==0)
86#define event_is_dear(e) ((e)->pme_ear == 1 && (e)->pme_dear==1)
87#define event_is_tlb_ear(e) ((e)->pme_ear == 1 && (e)->pme_tlb==1)
88#define event_is_btb(e) ((e)->pme_btb)
89
90#define event_opcm_ok(e) ((e)->pme_qualifiers.pme_qual.pme_opm==1)
91#define event_iarr_ok(e) ((e)->pme_qualifiers.pme_qual.pme_iar==1)
92#define event_darr_ok(e) ((e)->pme_qualifiers.pme_qual.pme_dar==1)
93
94#endif /* __PFMLIB_ITANIUM_PRIV_H__ */
unsigned long pme_code
unsigned long pme_umask
unsigned long pme_tlb
unsigned long pme_btb
unsigned long pme_dear
unsigned long pme_ig
unsigned long pme_ig1
unsigned long pme_ear
pme_ita_code_t pme_entry_code
pme_ita_qualifiers_t pme_qualifiers
char * pme_desc
unsigned int pme_maxincr
unsigned long pme_counters
char * pme_name
pme_ita_entry_code_t pme_ita_code
unsigned long pme_vcode