120{
122
128
130 ptr->control.cpu_control.evntsel_aux[
i] |= def_mode;
131 }
132 ptr->control.cpu_control.tsc_on = 1;
133 ptr->control.cpu_control.nractrs = 0;
134 ptr->control.cpu_control.nrictrs = 0;
135
136#ifdef VPERFCTR_CONTROL_CLOEXEC
137 ptr->control.flags = VPERFCTR_CONTROL_CLOEXEC;
138 SUBDBG(
"close on exec\t\t\t%u\n", ptr->control.flags );
139#endif
140 } else {
141
146
147 ptr->allocated_registers.selector = 0;
149 case PERFCTR_X86_GENERIC:
150 case PERFCTR_X86_WINCHIP_C6:
151 case PERFCTR_X86_WINCHIP_2:
152 case PERFCTR_X86_VIA_C3:
153 case PERFCTR_X86_INTEL_P5:
154 case PERFCTR_X86_INTEL_P5MMX:
155 case PERFCTR_X86_INTEL_PII:
156 case PERFCTR_X86_INTEL_P6:
157 case PERFCTR_X86_INTEL_PIII:
158#ifdef PERFCTR_X86_INTEL_CORE
159 case PERFCTR_X86_INTEL_CORE:
160#endif
161#ifdef PERFCTR_X86_INTEL_PENTM
162 case PERFCTR_X86_INTEL_PENTM:
163#endif
164 ptr->control.cpu_control.evntsel[0] |=
PERF_ENABLE;
166 ptr->control.cpu_control.evntsel[
i] |= def_mode;
167 ptr->control.cpu_control.pmc_map[
i] = (
unsigned int )
i;
168 }
169 break;
170#ifdef PERFCTR_X86_INTEL_CORE2
171 case PERFCTR_X86_INTEL_CORE2:
172#endif
173#ifdef PERFCTR_X86_INTEL_ATOM
174 case PERFCTR_X86_INTEL_ATOM:
175#endif
176#ifdef PERFCTR_X86_INTEL_NHLM
177 case PERFCTR_X86_INTEL_NHLM:
178#endif
179#ifdef PERFCTR_X86_INTEL_WSTMR
180 case PERFCTR_X86_INTEL_WSTMR:
181#endif
182#ifdef PERFCTR_X86_AMD_K8
183 case PERFCTR_X86_AMD_K8:
184#endif
185#ifdef PERFCTR_X86_AMD_K8C
186 case PERFCTR_X86_AMD_K8C:
187#endif
188#ifdef PERFCTR_X86_AMD_FAM10H
189 case PERFCTR_X86_AMD_FAM10H:
190#endif
191 case PERFCTR_X86_AMD_K7:
193 ptr->control.cpu_control.evntsel[
i] |=
PERF_ENABLE | def_mode;
194 ptr->control.cpu_control.pmc_map[
i] = (
unsigned int )
i;
195 }
196 break;
197 }
198#ifdef VPERFCTR_CONTROL_CLOEXEC
199 ptr->control.flags = VPERFCTR_CONTROL_CLOEXEC;
200 SUBDBG(
"close on exec\t\t\t%u\n", ptr->control.flags );
201#endif
202
203
204 ptr->control.cpu_control.tsc_on = 1;
205 }
207}
papi_vector_t _perfctr_vector