akaros/user/perfmon/pfmlib_amd64_fam15h.c
<<
>>
Prefs
   1/*
   2 * pfmlib_amd64_fam15h.c : AMD64 Family 15h
   3 *
   4 * Copyright (c) 2011 Google, Inc
   5 * Contributed by Stephane Eranian <eranian@gmail.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 */
  25
  26/* private headers */
  27#include "pfmlib_priv.h"
  28#include "pfmlib_amd64_priv.h"
  29#include "events/amd64_events_fam15h.h"
  30#include "events/amd64_events_fam15h_nb.h"
  31
  32pfmlib_pmu_t amd64_fam15h_interlagos_support={
  33        .desc                   = "AMD64 Fam15h Interlagos",
  34        .name                   = "amd64_fam15h_interlagos",
  35        .pmu                    = PFM_PMU_AMD64_FAM15H_INTERLAGOS,
  36        .pmu_rev                = 0,
  37        .pme_count              = LIBPFM_ARRAY_SIZE(amd64_fam15h_pe),
  38        .type                   = PFM_PMU_TYPE_CORE,
  39        .supported_plm          = AMD64_FAM10H_PLM,
  40        .num_cntrs              = 6,
  41        .max_encoding           = 1,
  42        .pe                     = amd64_fam15h_pe,
  43        .atdesc                 = amd64_mods,
  44        .flags                  = PFMLIB_PMU_FL_RAW_UMASK,
  45        .cpu_family             = PFM_PMU_AMD64_FAM15H_INTERLAGOS,
  46        .pmu_detect             = pfm_amd64_family_detect,
  47        .get_event_encoding[PFM_OS_NONE] = pfm_amd64_get_encoding,
  48         PFMLIB_ENCODE_PERF(pfm_amd64_get_perf_encoding),
  49        .get_event_first        = pfm_amd64_get_event_first,
  50        .get_event_next         = pfm_amd64_get_event_next,
  51        .event_is_valid         = pfm_amd64_event_is_valid,
  52        .validate_table         = pfm_amd64_validate_table,
  53        .get_event_info         = pfm_amd64_get_event_info,
  54        .get_event_attr_info    = pfm_amd64_get_event_attr_info,
  55         PFMLIB_VALID_PERF_PATTRS(pfm_amd64_perf_validate_pattrs),
  56        .get_event_nattrs       = pfm_amd64_get_event_nattrs,
  57};
  58
  59pfmlib_pmu_t amd64_fam15h_nb_support={
  60        .desc                   = "AMD64 Fam15h NorthBridge",
  61        .name                   = "amd64_fam15h_nb",
  62        .pmu                    = PFM_PMU_AMD64_FAM15H_NB,
  63        .perf_name              = "amd_nb",
  64        .pmu_rev                = 0,
  65        .pme_count              = LIBPFM_ARRAY_SIZE(amd64_fam15h_nb_pe),
  66        .type                   = PFM_PMU_TYPE_UNCORE,
  67        .supported_plm          = 0, /* no plm support */
  68        .num_cntrs              = 4,
  69        .max_encoding           = 1,
  70        .pe                     = amd64_fam15h_nb_pe,
  71        .atdesc                 = amd64_mods,
  72        .flags                  = PFMLIB_PMU_FL_RAW_UMASK,
  73        .cpu_family             = PFM_PMU_AMD64_FAM15H_INTERLAGOS,
  74        .pmu_detect             = pfm_amd64_family_detect,
  75        .get_event_encoding[PFM_OS_NONE] = pfm_amd64_get_encoding,
  76         PFMLIB_ENCODE_PERF(pfm_amd64_get_perf_encoding),
  77        .get_event_first        = pfm_amd64_get_event_first,
  78        .get_event_next         = pfm_amd64_get_event_next,
  79        .event_is_valid         = pfm_amd64_event_is_valid,
  80        .validate_table         = pfm_amd64_validate_table,
  81        .get_event_info         = pfm_amd64_get_event_info,
  82        .get_event_attr_info    = pfm_amd64_get_event_attr_info,
  83         PFMLIB_VALID_PERF_PATTRS(pfm_amd64_nb_perf_validate_pattrs),
  84        .get_event_nattrs       = pfm_amd64_get_event_nattrs,
  85};
  86