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

Packit 577717
/****************************/
Packit 577717
/* THIS IS OPEN SOURCE CODE */
Packit 577717
/****************************/
Packit 577717
Packit 577717
/** 
Packit 577717
 * @file    linux-L2unit.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 / L2unit 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_L2UNIT_H
Packit 577717
#define _PAPI_L2UNIT_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 L2UNIT_MAX_COUNTERS UPC_L2_NUM_COUNTERS
Packit 577717
#define L2UNIT_MAX_EVENTS PEVT_L2UNIT_LAST_EVENT
Packit 577717
#define OFFSET ( PEVT_PUNIT_LAST_EVENT + 1 )
Packit 577717
Packit 577717
/* Stores private information for each event */
Packit 577717
typedef struct L2UNIT_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
} L2UNIT_register_t;
Packit 577717
Packit 577717
Packit 577717
/* Used when doing register allocation */
Packit 577717
typedef struct L2UNIT_reg_alloc
Packit 577717
{
Packit 577717
	L2UNIT_register_t ra_bits;
Packit 577717
} L2UNIT_reg_alloc_t;
Packit 577717
Packit 577717
typedef struct L2UNIT_overflow
Packit 577717
{
Packit 577717
  	int threshold;
Packit 577717
	int EventIndex;
Packit 577717
} L2UNIT_overflow_t;
Packit 577717
Packit 577717
/* Holds control flags */
Packit 577717
typedef struct L2UNIT_control_state
Packit 577717
{
Packit 577717
	int EventGroup;
Packit 577717
	int EventGroup_local[512];
Packit 577717
	int count;
Packit 577717
	long long counters[L2UNIT_MAX_COUNTERS];
Packit 577717
	int overflow;				// overflow enable
Packit 577717
    int overflow_count;
Packit 577717
    L2UNIT_overflow_t overflow_list[512];
Packit 577717
	int bgpm_eventset_applied;	// BGPM eventGroup applied yes or no flag
Packit 577717
} L2UNIT_control_state_t;
Packit 577717
Packit 577717
Packit 577717
/* Holds per-thread information */
Packit 577717
typedef struct L2UNIT_context
Packit 577717
{
Packit 577717
	L2UNIT_control_state_t state;
Packit 577717
} L2UNIT_context_t;
Packit 577717
Packit 577717
Packit 577717
#endif /* _PAPI_L2UNIT_H */