pfmlib_intel_nhm.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __PFMLIB_NHM_H__
00025 #define __PFMLIB_NHM_H__
00026
00027 #include <perfmon/pfmlib.h>
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040
00041
00042
00043
00044
00045
00046
00047
00048 #define PMU_NHM_NUM_COUNTERS 16
00049
00050 typedef union {
00051 unsigned long long val;
00052 struct {
00053 unsigned long sel_event:8;
00054 unsigned long sel_umask:8;
00055 unsigned long sel_usr:1;
00056 unsigned long sel_os:1;
00057 unsigned long sel_edge:1;
00058 unsigned long sel_pc:1;
00059 unsigned long sel_int:1;
00060 unsigned long sel_anythr:1;
00061 unsigned long sel_en:1;
00062 unsigned long sel_inv:1;
00063 unsigned long sel_cnt_mask:8;
00064 unsigned long sel_res2:32;
00065 } perfevtsel;
00066 struct {
00067 unsigned long usel_event:8;
00068 unsigned long usel_umask:8;
00069 unsigned long usel_res1:1;
00070 unsigned long usel_occ:1;
00071 unsigned long usel_edge:1;
00072 unsigned long usel_res2:1;
00073 unsigned long usel_int:1;
00074 unsigned long usel_res3:1;
00075 unsigned long usel_en:1;
00076 unsigned long usel_inv:1;
00077 unsigned long usel_cnt_mask:8;
00078 unsigned long usel_res4:32;
00079 } unc_perfevtsel;
00080 struct {
00081 unsigned long cpl_eq0:1;
00082 unsigned long cpl_neq0:1;
00083 unsigned long jcc:1;
00084 unsigned long near_rel_call:1;
00085 unsigned long near_ind_call:1;
00086 unsigned long near_ret:1;
00087 unsigned long near_ind_jmp:1;
00088 unsigned long near_rel_jmp:1;
00089 unsigned long far_branch:1;
00090 unsigned long reserved1:23;
00091 unsigned long reserved2:32;
00092 } lbr_select;
00093 } pfm_nhm_sel_reg_t;
00094
00095 typedef struct {
00096 unsigned long cnt_mask;
00097 unsigned int flags;
00098 } pfmlib_nhm_counter_t;
00099
00100
00101
00102
00103 #define PFM_NHM_SEL_INV 0x1
00104 #define PFM_NHM_SEL_EDGE 0x2
00105 #define PFM_NHM_SEL_ANYTHR 0x4
00106 #define PFM_NHM_SEL_OCC_RST 0x8
00107
00108 typedef struct {
00109 unsigned int lbr_used;
00110 unsigned int lbr_plm;
00111 unsigned int lbr_filter;
00112 } pfmlib_nhm_lbr_t;
00113
00114
00115
00116
00117
00118 #define PFM_NHM_LBR_JCC 0x4
00119 #define PFM_NHM_LBR_NEAR_REL_CALL 0x8
00120 #define PFM_NHM_LBR_NEAR_IND_CALL 0x10
00121 #define PFM_NHM_LBR_NEAR_RET 0x20
00122 #define PFM_NHM_LBR_NEAR_IND_JMP 0x40
00123 #define PFM_NHM_LBR_NEAR_REL_JMP 0x80
00124 #define PFM_NHM_LBR_FAR_BRANCH 0x100
00125 #define PFM_NHM_LBR_ALL 0x1fc
00126
00127
00128
00129
00130 typedef struct {
00131 unsigned int pebs_used;
00132 unsigned int ld_lat_thres;
00133 } pfmlib_nhm_pebs_t;
00134
00135
00136
00137
00138
00139 typedef struct {
00140 pfmlib_nhm_counter_t pfp_nhm_counters[PMU_NHM_NUM_COUNTERS];
00141 pfmlib_nhm_pebs_t pfp_nhm_pebs;
00142 pfmlib_nhm_lbr_t pfp_nhm_lbr;
00143 uint64_t reserved[4];
00144 } pfmlib_nhm_input_param_t;
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154 extern int pfm_nhm_is_pebs(pfmlib_event_t *e);
00155 extern int pfm_nhm_is_uncore(pfmlib_event_t *e);
00156 extern int pfm_nhm_data_src_desc(unsigned int val, char **desc);
00157
00158 #ifdef __cplusplus
00159 }
00160 #endif
00161
00162 #endif