PAPI 7.1.0.0
Loading...
Searching...
No Matches
pfmlib_coreduo.h
Go to the documentation of this file.
1/*
2 * Intel Core Duo/Solo
3 *
4 * Copyright (c) 2009 Google, Inc
5 * Contributed by Stephane Eranian <eranian@hpl.hp.com>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
11 * of the Software, and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
21 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
22 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24#ifndef __PFMLIB_COREDUO_H__
25#define __PFMLIB_COREDUO_H__
26
27#include <perfmon/pfmlib.h>
28/*
29 * privilege level mask usage for architected PMU:
30 *
31 * PFM_PLM0 = OS (kernel, hypervisor, ..)
32 * PFM_PLM1 = unused (ignored)
33 * PFM_PLM2 = unused (ignored)
34 * PFM_PLM3 = USR (user level)
35 */
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41#define PMU_COREDUO_NUM_COUNTERS 2
42
43typedef union {
44 unsigned long long val; /* complete register value */
45 struct {
46 unsigned long sel_event_select:8; /* event mask */
47 unsigned long sel_unit_mask:8; /* unit mask */
48 unsigned long sel_usr:1; /* user level */
49 unsigned long sel_os:1; /* system level */
50 unsigned long sel_edge:1; /* edge detec */
51 unsigned long sel_pc:1; /* pin control */
52 unsigned long sel_int:1; /* enable APIC intr */
53 unsigned long sel_res1:1; /* reserved */
54 unsigned long sel_en:1; /* enable */
55 unsigned long sel_inv:1; /* invert counter mask */
56 unsigned long sel_cnt_mask:8; /* counter mask */
57 unsigned long sel_res2:32;
58 } perfevtsel;
60
61typedef struct {
62 unsigned long cnt_mask; /* threshold (cnt_mask) */
63 unsigned int flags; /* counter specific flag */
65
66#define PFM_COREDUO_SEL_INV 0x1 /* inverse */
67#define PFM_COREDUO_SEL_EDGE 0x2 /* edge detect */
68/*
69 * model-specific parameters for the library
70 */
71typedef struct {
73 uint64_t reserved[4]; /* for future use */
75
76#ifdef __cplusplus /* extern C */
77}
78#endif
79
80#endif /* __PFMLIB_COREUO_H__ */
uint16_t reserved
#define PMU_COREDUO_NUM_COUNTERS
unsigned long cnt_mask
unsigned long sel_pc
unsigned long sel_res2
unsigned long sel_usr
unsigned long sel_res1
unsigned long sel_cnt_mask
unsigned long sel_en
unsigned long long val
unsigned long sel_int
unsigned long sel_os
unsigned long sel_event_select
unsigned long sel_edge
unsigned long sel_inv
unsigned long sel_unit_mask