Blame src/components/bgpm/IOunit/linux-IOunit.h

Packit 577717
/****************************/
Packit 577717
/* THIS IS OPEN SOURCE CODE */
Packit 577717
/****************************/
Packit 577717
Packit 577717
/** 
Packit 577717
 * @file    linux-IOunit.h
Packit 577717
 * @author  Heike Jagode
Packit 577717
 *          jagode@eecs.utk.edu
Packit 577717
 * Mods:	< your name here >
Packit 577717
 *			< your email address >
Packit 577717
 * BGPM / IOunit component 
Packit 577717
 * 
Packit 577717
 * Tested version of bgpm (early access)
Packit 577717
 *
Packit 577717
 * @brief
Packit 577717
 *  This file has the source code for a component that enables PAPI-C to 
Packit 577717
 *  access hardware monitoring counters for BG/Q through the bgpm library.
Packit 577717
 */
Packit 577717
Packit 577717
#ifndef _PAPI_IOUNIT_H
Packit 577717
#define _PAPI_IOUNIT_H
Packit 577717
Packit 577717
#include "papi.h"
Packit 577717
#include "papi_internal.h"
Packit 577717
#include "papi_vector.h"
Packit 577717
#include "papi_memory.h"
Packit 577717
#include "extras.h"
Packit 577717
#include "../../../linux-bgq-common.h"
Packit 577717
Packit 577717
Packit 577717
/*************************  DEFINES SECTION  ***********************************
Packit 577717
 *******************************************************************************/
Packit 577717
Packit 577717
/* this number assumes that there will never be more events than indicated */
Packit 577717
#define IOUNIT_MAX_COUNTERS UPC_C_IOSRAM_NUM_COUNTERS
Packit 577717
#define IOUNIT_MAX_EVENTS PEVT_IOUNIT_LAST_EVENT
Packit 577717
#define OFFSET ( PEVT_L2UNIT_LAST_EVENT + 1 )
Packit 577717
Packit 577717
Packit 577717
/** Structure that stores private information of each event */
Packit 577717
typedef struct IOUNIT_register
Packit 577717
{
Packit 577717
	unsigned int selector;
Packit 577717
	/* Signifies which counter slot is being used */
Packit 577717
	/* Indexed from 1 as 0 has a special meaning  */
Packit 577717
} IOUNIT_register_t;
Packit 577717
Packit 577717
Packit 577717
typedef struct IOUNIT_reg_alloc
Packit 577717
{
Packit 577717
	IOUNIT_register_t ra_bits;
Packit 577717
} IOUNIT_reg_alloc_t;
Packit 577717
Packit 577717
typedef struct IOUNIT_overflow
Packit 577717
{
Packit 577717
  	int threshold;
Packit 577717
	int EventIndex;
Packit 577717
} IOUNIT_overflow_t;
Packit 577717
Packit 577717
typedef struct IOUNIT_control_state
Packit 577717
{
Packit 577717
	int EventGroup;
Packit 577717
	int overflow;				// overflow enable
Packit 577717
    int overflow_count;
Packit 577717
    IOUNIT_overflow_t overflow_list[512];
Packit 577717
	long long counts[IOUNIT_MAX_COUNTERS];
Packit 577717
} IOUNIT_control_state_t;
Packit 577717
Packit 577717
Packit 577717
typedef struct IOUNIT_context
Packit 577717
{
Packit 577717
	IOUNIT_control_state_t state;
Packit 577717
} IOUNIT_context_t;
Packit 577717
Packit 577717
Packit 577717
#endif /* _PAPI_IOUNIT_H */