Blame src/libpfm4/lib/pfmlib_ppc970.c

Packit Service a1973e
/*
Packit Service a1973e
 * pfmlib_ppc970.c : IBM Power 970/970mp support
Packit Service a1973e
 *
Packit Service a1973e
 * Copyright (C) IBM Corporation, 2009.  All rights reserved.
Packit Service a1973e
 * Contributed by Corey Ashford (cjashfor@us.ibm.com)
Packit Service a1973e
 *
Packit Service a1973e
 * Permission is hereby granted, free of charge, to any person obtaining a copy
Packit Service a1973e
 * of this software and associated documentation files (the "Software"), to deal
Packit Service a1973e
 * in the Software without restriction, including without limitation the rights
Packit Service a1973e
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
Packit Service a1973e
 * of the Software, and to permit persons to whom the Software is furnished to do so,
Packit Service a1973e
 * subject to the following conditions:
Packit Service a1973e
 *
Packit Service a1973e
 * The above copyright notice and this permission notice shall be included in all
Packit Service a1973e
 * copies or substantial portions of the Software.
Packit Service a1973e
 *
Packit Service a1973e
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
Packit Service a1973e
 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
Packit Service a1973e
 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
Packit Service a1973e
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
Packit Service a1973e
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
Packit Service a1973e
 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Packit Service a1973e
 */
Packit Service a1973e
/* private headers */
Packit Service a1973e
#include "pfmlib_priv.h"
Packit Service a1973e
#include "pfmlib_power_priv.h"
Packit Service a1973e
#include "events/ppc970_events.h"
Packit Service a1973e
#include "events/ppc970mp_events.h"
Packit Service a1973e
Packit Service a1973e
static int
Packit Service a1973e
pfm_ppc970_detect(void* this)
Packit Service a1973e
{
Packit Service a1973e
	if (__is_processor(PV_970) || __is_processor(PV_970FX) || __is_processor(PV_970GX))
Packit Service a1973e
		return PFM_SUCCESS;
Packit Service a1973e
Packit Service a1973e
	return PFM_ERR_NOTSUPP;
Packit Service a1973e
}
Packit Service a1973e
Packit Service a1973e
static int
Packit Service a1973e
pfm_ppc970mp_detect(void* this)
Packit Service a1973e
{
Packit Service a1973e
	if (__is_processor(PV_970MP))
Packit Service a1973e
		return PFM_SUCCESS;
Packit Service a1973e
Packit Service a1973e
	return PFM_ERR_NOTSUPP;
Packit Service a1973e
}
Packit Service a1973e
Packit Service a1973e
pfmlib_pmu_t ppc970_support={
Packit Service a1973e
	.desc			= "PPC970",
Packit Service a1973e
	.name			= "ppc970",
Packit Service a1973e
	.pmu			= PFM_PMU_PPC970,
Packit Service a1973e
	.pme_count		= LIBPFM_ARRAY_SIZE(ppc970_pe),
Packit Service a1973e
	.max_encoding		= 1,
Packit Service a1973e
	.pe			= ppc970_pe,
Packit Service a1973e
	.pmu_detect		= pfm_ppc970_detect,
Packit Service a1973e
	.get_event_encoding[PFM_OS_NONE] = pfm_gen_powerpc_get_encoding,
Packit Service a1973e
	 PFMLIB_ENCODE_PERF(pfm_gen_powerpc_get_perf_encoding),
Packit Service a1973e
	 PFMLIB_VALID_PERF_PATTRS(pfm_gen_powerpc_perf_validate_pattrs),
Packit Service a1973e
	.get_event_first	= pfm_gen_powerpc_get_event_first,
Packit Service a1973e
	.get_event_next		= pfm_gen_powerpc_get_event_next,
Packit Service a1973e
	.event_is_valid		= pfm_gen_powerpc_event_is_valid,
Packit Service a1973e
	.validate_table		= pfm_gen_powerpc_validate_table,
Packit Service a1973e
	.get_event_info		= pfm_gen_powerpc_get_event_info,
Packit Service a1973e
	.get_event_attr_info	= pfm_gen_powerpc_get_event_attr_info,
Packit Service a1973e
};
Packit Service a1973e
Packit Service a1973e
pfmlib_pmu_t ppc970mp_support={
Packit Service a1973e
	.desc			= "PPC970MP",
Packit Service a1973e
	.name			= "ppc970mp",
Packit Service a1973e
	.pmu			= PFM_PMU_PPC970MP,
Packit Service a1973e
	.pme_count		= LIBPFM_ARRAY_SIZE(ppc970mp_pe),
Packit Service a1973e
	.max_encoding		= 1,
Packit Service a1973e
	.pe			= ppc970mp_pe,
Packit Service a1973e
	.pmu_detect		= pfm_ppc970mp_detect,
Packit Service a1973e
	.get_event_encoding[PFM_OS_NONE] = pfm_gen_powerpc_get_encoding,
Packit Service a1973e
	 PFMLIB_ENCODE_PERF(pfm_gen_powerpc_get_perf_encoding),
Packit Service a1973e
	 PFMLIB_VALID_PERF_PATTRS(pfm_gen_powerpc_perf_validate_pattrs),
Packit Service a1973e
	.get_event_first	= pfm_gen_powerpc_get_event_first,
Packit Service a1973e
	.get_event_next		= pfm_gen_powerpc_get_event_next,
Packit Service a1973e
	.event_is_valid		= pfm_gen_powerpc_event_is_valid,
Packit Service a1973e
	.validate_table		= pfm_gen_powerpc_validate_table,
Packit Service a1973e
	.get_event_info		= pfm_gen_powerpc_get_event_info,
Packit Service a1973e
	.get_event_attr_info	= pfm_gen_powerpc_get_event_attr_info,
Packit Service a1973e
};