| # Gaudi Framework, version v22r2 |

Home |  | Generated: Tue May 10 2011

# pfmlib_core.h

Go to the documentation of this file.

    00001 /*
    00002  * Intel Core PMU
    00003  *
    00004  * Copyright (c) 2006 Hewlett-Packard Development Company, L.P.
    00005  * Contributed by Stephane Eranian <eranian@hpl.hp.com>
    00006  *
    00007  * Permission is hereby granted, free of charge, to any person obtaining a copy
    00008  * of this software and associated documentation files (the "Software"), to deal
    00009  * in the Software without restriction, including without limitation the rights
    00010  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
    00011  * of the Software, and to permit persons to whom the Software is furnished to do so,
    00012  * subject to the following conditions:
    00013  *
    00014  * The above copyright notice and this permission notice shall be included in all
    00015  * copies or substantial portions of the Software.
    00016  *
    00017  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
    00018  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
    00019  * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
    00020  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
    00021  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
    00022  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    00023  */
    00024 #ifndef __PFMLIB_CORE_H__
    00025 #define __PFMLIB_CORE_H__
    00026
    00027 #include <perfmon/pfmlib.h>
    00028 /*
    00029  * privilege level mask usage for Intel Core
    00030  *
    00031  * PFM_PLM0 = OS (kernel, hypervisor, ..)
    00032  * PFM_PLM1 = unused (ignored)
    00033  * PFM_PLM2 = unused (ignored)
    00034  * PFM_PLM3 = USR (user level)
    00035  */
    00036
    00037 #ifdef __cplusplus
    00038 extern "C" {
    00039 #endif
    00040
    00041 #define PMU_CORE_NUM_FIXED_COUNTERS 3   /* number of fixed counters */
    00042 #define PMU_CORE_NUM_GEN_COUNTERS 2     /* number of generic counters */
    00043 #define PMU_CORE_NUM_COUNTERS 5         /* number of counters */
    00044
    00045 typedef union {
    00046         unsigned long long val;                 /* complete register value */
    00047         struct {
    00048                 unsigned long sel_event_select:8;       /* event mask */
    00049                 unsigned long sel_unit_mask:8;          /* unit mask */
    00050                 unsigned long sel_usr:1;                /* user level */
    00051                 unsigned long sel_os:1;                 /* system level */
    00052                 unsigned long sel_edge:1;               /* edge detec */
    00053                 unsigned long sel_pc:1;                 /* pin control */
    00054                 unsigned long sel_int:1;                /* enable APIC intr */
    00055                 unsigned long sel_res1:1;               /* reserved */
    00056                 unsigned long sel_en:1;                 /* enable */
    00057                 unsigned long sel_inv:1;                /* invert counter mask */
    00058                 unsigned long sel_cnt_mask:8;           /* counter mask */
    00059                 unsigned long sel_res2:32;
    00060         } perfevtsel;
    00061 } pfm_core_sel_reg_t;
    00062
    00063 typedef struct {
    00064         unsigned long           cnt_mask;       /* threshold (cnt_mask)  */
    00065         unsigned int            flags;          /* counter specific flag */
    00066 } pfmlib_core_counter_t;
    00067
    00068 #define PFM_CORE_SEL_INV        0x1     /* inverse */
    00069 #define PFM_CORE_SEL_EDGE       0x2     /* edge detect */
    00070
    00071 /*
    00072  * model-specific parameters for the library
    00073  */
    00074 typedef struct {
    00075         unsigned int pebs_used; /* set to 1 if PEBS is used */
    00076 } pfmlib_core_pebs_t;
    00077
    00078 typedef struct {
    00079         pfmlib_core_counter_t   pfp_core_counters[PMU_CORE_NUM_COUNTERS];
    00080         pfmlib_core_pebs_t      pfp_core_pebs;
    00081         uint64_t                reserved[4];    /* for future use */
    00082 } pfmlib_core_input_param_t;
    00083
    00084 typedef struct {
    00085         uint64_t        reserved[8];            /* for future use */
    00086 } pfmlib_core_output_param_t;
    00087
    00088 #ifdef __cplusplus /* extern C */
    00089 }
    00090 #endif
    00091
    00092 /*
    00093  * PMU-specific interface
    00094  */
    00095 extern int pfm_core_is_pebs(pfmlib_event_t *e);
    00096
    00097 #endif /* __PFMLIB_CORE_H__ */

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines