2 * pfmlib_intel_knc.c : Intel Knights Corner (Xeon Phi)
4 * Copyright (c) 2012, Google, Inc
5 * Contributed by Stephane Eranian <eranian@gmail.com>
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:
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
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.
25 #include "pfmlib_priv.h" /* library private */
26 #include "pfmlib_intel_x86_priv.h" /* architecture private */
27 #include "events/intel_knc_events.h"
29 static const int knc_models[] = {
30 1, /* Knights Corner */
34 pfmlib_pmu_t intel_knc_support={
35 .desc = "Intel Knights Corner",
37 .pmu = PFM_PMU_INTEL_KNC,
38 .pme_count = LIBPFM_ARRAY_SIZE(intel_knc_pe),
39 .type = PFM_PMU_TYPE_CORE,
43 .atdesc = intel_x86_mods,
44 .supported_plm = INTEL_X86_PLM,
47 .cpu_models = knc_models,
48 .pmu_detect = pfm_intel_x86_model_detect,
50 .get_event_encoding[PFM_OS_NONE] = pfm_intel_x86_get_encoding,
51 PFMLIB_ENCODE_PERF(pfm_intel_x86_get_perf_encoding),
53 .get_event_first = pfm_intel_x86_get_event_first,
54 .get_event_next = pfm_intel_x86_get_event_next,
55 .event_is_valid = pfm_intel_x86_event_is_valid,
56 .validate_table = pfm_intel_x86_validate_table,
57 .get_event_info = pfm_intel_x86_get_event_info,
58 .get_event_attr_info = pfm_intel_x86_get_event_attr_info,
59 PFMLIB_VALID_PERF_PATTRS(pfm_intel_x86_perf_validate_pattrs),
60 .get_event_nattrs = pfm_intel_x86_get_event_nattrs,