Blame src/linux-bgp-memory.c

Packit 577717
/*
Packit 577717
 * File:    linux-bgp-memory.c
Packit 577717
 * Author:  Dave Hermsmeier
Packit 577717
 *          dlherms@us.ibm.com
Packit 577717
 */
Packit 577717
Packit 577717
#include "papi.h"
Packit 577717
#include "papi_internal.h"
Packit 577717
#ifdef __LINUX__
Packit 577717
#include <limits.h>
Packit 577717
#endif
Packit 577717
#include <stdio.h>
Packit 577717
#include <string.h>
Packit 577717
Packit 577717
/*
Packit 577717
 * Prototypes...
Packit 577717
 */
Packit 577717
int init_bgp( PAPI_mh_info_t * pMem_Info );
Packit 577717
Packit 577717
/*
Packit 577717
 * Get Memory Information
Packit 577717
 *
Packit 577717
 * Fills in memory information - effectively set to all 0x00's
Packit 577717
 */
Packit 577717
extern int
Packit 577717
_bgp_get_memory_info( PAPI_hw_info_t * pHwInfo, int pCPU_Type )
Packit 577717
{
Packit 577717
	int retval = 0;
Packit 577717
Packit 577717
	switch ( pCPU_Type ) {
Packit 577717
	default:
Packit 577717
		//fprintf(stderr,"Default CPU type in %s (%d)\n",__FUNCTION__,__LINE__);
Packit 577717
		retval = init_bgp( &pHwInfo->mem_hierarchy );
Packit 577717
		break;
Packit 577717
	}
Packit 577717
Packit 577717
	return retval;
Packit 577717
}
Packit 577717
Packit 577717
/*
Packit 577717
 * Get DMem Information for BG/P
Packit 577717
 *
Packit 577717
 * NOTE:  Currently, all values set to -1
Packit 577717
 */
Packit 577717
extern int
Packit 577717
_bgp_get_dmem_info( PAPI_dmem_info_t * pDmemInfo )
Packit 577717
{
Packit 577717
Packit 577717
	pDmemInfo->size = PAPI_EINVAL;
Packit 577717
	pDmemInfo->resident = PAPI_EINVAL;
Packit 577717
	pDmemInfo->high_water_mark = PAPI_EINVAL;
Packit 577717
	pDmemInfo->shared = PAPI_EINVAL;
Packit 577717
	pDmemInfo->text = PAPI_EINVAL;
Packit 577717
	pDmemInfo->library = PAPI_EINVAL;
Packit 577717
	pDmemInfo->heap = PAPI_EINVAL;
Packit 577717
	pDmemInfo->locked = PAPI_EINVAL;
Packit 577717
	pDmemInfo->stack = PAPI_EINVAL;
Packit 577717
	pDmemInfo->pagesize = PAPI_EINVAL;
Packit 577717
Packit 577717
	return PAPI_OK;
Packit 577717
}
Packit 577717
Packit 577717
/*
Packit 577717
 * Cache configuration for BG/P
Packit 577717
 */
Packit 577717
int
Packit 577717
init_bgp( PAPI_mh_info_t * pMem_Info )
Packit 577717
{
Packit 577717
	memset( pMem_Info, 0x0, sizeof ( *pMem_Info ) );
Packit 577717
Packit 577717
	return PAPI_OK;
Packit 577717
}