<commit_before>/****************************/
/* THIS IS OPEN SOURCE CODE */
/****************************/

/* 
* File:    papi_internal.h
* CVS:     $Id$
* Author:  <NAME>
*          <EMAIL>
* Mods:    dan terpstra
*          terpstra.utk.edu
* Mods:    <NAME>
*	   <EMAIL>
* Mods:    <your name here>
*          <your email address>
*/  

#ifndef PAPI_INTERNAL_H
#define PAPI_INTERNAL_H


#ifdef DEBUG
/* add Win32 to the debug list */
#if (defined(sgi) && defined(mips)) || defined(_CRAYT3E) || (defined(__digital__) \
	|| defined(__osf__)) || (defined(sun) && defined(sparc)) || defined(_WIN32)
#define DBG(a) { extern int _papi_hwi_debug; if (_papi_hwi_debug) { fprintf(stderr,"DEBUG:%s:%d: ",__FILE__,__LINE__); fprintf a; } }
#else /* SV2,SV1 ? */
#define DBG(a) { extern int _papi_hwi_debug; if (_papi_hwi_debug) { fprintf(stderr,"DEBUG:%s:%s:%d: ",__FILE__,__FUNCTION__,__LINE__); fprintf a; } }
#endif
#else
#define DBG(a)
#endif

#define DEADBEEF 0xdedbeef

/* some members of structs and/or function parameters may or may not be
   necessary, but at this point, we have included anything that might 
   possibly be useful later, and will remove them as we progress */

/* Signal used for overflow delivery */

#define PAPI_ITIMER ITIMER_PROF
#define PAPI_SIGNAL SIGPROF
#define PAPI_ITIMER_MS 1

/* Commands used to compute derived events */

#define NOT_DERIVED      0x0  /* Do nothing */
#define DERIVED_ADD      0x1  /* Add counters */
#define DERIVED_PS       0x2  /* Divide by the cycle counter and convert to seconds */
#define DERIVED_ADD_PS   0x4  /* Add 2 counters then divide by the cycle counter and xl8 to secs. */
#define DERIVED_CMPD     0x8  /* Event lives in operand index but takes 2 or more codes */
#define DERIVED_SUB      0x10 /* Sub all counters from counter with operand_index */

typedef struct _EventSetMultistartInfo {
  int num_runners;
  int *SharedDepth; } EventSetMultistartInfo_t;

typedef struct _EventSetDomainInfo {
  int domain; } EventSetDomainInfo_t;

typedef struct _EventSetGranularityInfo {
  int granularity; } EventSetGranularityInfo_t;

typedef struct _EventSetOverflowInfo {
  long_long deadline;
  int count;
  int threshold;
  int EventIndex;
  int EventCode;
  int flags;
  int timer_ms;
  PAPI_overflow_handler_t handler;
} EventSetOverflowInfo_t;

#if 0
typedef struct _EventSetInheritInfo {
  int inherit; } EventSetInheritInfo_t;
#endif

typedef struct _EventSetProfileInfo {
  PAPI_sprofil_t *prof;
  int count; /* Number of buffers */
  int threshold;
  int EventIndex;
  int EventCode;
  int flags;
} EventSetProfileInfo_t;

/* PAPI supports derived events that are made up of at most 2 counters. */

typedef struct _EventInfo {
  _EventInfo *head;	    /* points back to EventInfoArray for this EventSet */
  unsigned int event_code;  /* Preset or native code for this event as passed to PAPI_add_event() */
  unsigned hardware_index;  /* Index of counter to read in buffer returned by the hardware/kernel */
  hwd_register_map_t bits;  /* Bits that keep track of used resources by this event */
  unsigned int hardware_selector; /* Counter select bits used in the lower level */
			    /* Replaced by bits?? */
  int derived;		    /* Counter derivation command used for derived events */
  int operand_index;	    /* Counter derivation data used for derived events */
} EventInfo_t;

/* Multiplex definitions */

/* This contains only the information about an event that
 * would cause two events to be counted separately.  Options
 * that don't affect an event aren't included here.
 */

typedef struct _papi_info {
	int event_type;
	int domain;
	int granularity;
} PapiInfo;

typedef struct _masterevent {
        int uses;
        int active;
	int is_a_rate;
	int papi_event;
	PapiInfo pi;
        long_long count;
        long_long cycles;
	long_long handler_count;
 	long_long prev_total_c;
 	long_long count_estimate;
 	double rate_estimate;
	struct _threadlist * mythr;
        struct _masterevent * next;
} MasterEvent;
<commit_msg>More changes in EventInfo structure: hardware_index and operand_index were mutually exclusive, so they were replaced with a single value: counter_index.<commit_after>/****************************/
/* THIS IS OPEN SOURCE CODE */
/****************************/

/* 
* File:    papi_internal.h
* CVS:     $Id$
* Author:  <NAME>
*          <EMAIL>
* Mods:    dan terpstra
*          terpstra.utk.edu
* Mods:    <NAME>
*	   <EMAIL>
* Mods:    <your name here>
*          <your email address>
*/  

#ifndef PAPI_INTERNAL_H
#define PAPI_INTERNAL_H


#ifdef DEBUG
/* add Win32 to the debug list */
#if (defined(sgi) && defined(mips)) || defined(_CRAYT3E) || (defined(__digital__) \
	|| defined(__osf__)) || (defined(sun) && defined(sparc)) || defined(_WIN32)
#define DBG(a) { extern int _papi_hwi_debug; if (_papi_hwi_debug) { fprintf(stderr,"DEBUG:%s:%d: ",__FILE__,__LINE__); fprintf a; } }
#else /* SV2,SV1 ? */
#define DBG(a) { extern int _papi_hwi_debug; if (_papi_hwi_debug) { fprintf(stderr,"DEBUG:%s:%s:%d: ",__FILE__,__FUNCTION__,__LINE__); fprintf a; } }
#endif
#else
#define DBG(a)
#endif

#define DEADBEEF 0xdedbeef

/* some members of structs and/or function parameters may or may not be
   necessary, but at this point, we have included anything that might 
   possibly be useful later, and will remove them as we progress */

/* Signal used for overflow delivery */

#define PAPI_ITIMER ITIMER_PROF
#define PAPI_SIGNAL SIGPROF
#define PAPI_ITIMER_MS 1

/* Commands used to compute derived events */

#define NOT_DERIVED      0x0  /* Do nothing */
#define DERIVED_ADD      0x1  /* Add counters */
#define DERIVED_PS       0x2  /* Divide by the cycle counter and convert to seconds */
#define DERIVED_ADD_PS   0x4  /* Add 2 counters then divide by the cycle counter and xl8 to secs. */
#define DERIVED_CMPD     0x8  /* Event lives in operand index but takes 2 or more codes */
#define DERIVED_SUB      0x10 /* Sub all counters from counter with operand_index */

typedef struct _EventSetMultistartInfo {
  int num_runners;
  int *SharedDepth; } EventSetMultistartInfo_t;

typedef struct _EventSetDomainInfo {
  int domain; } EventSetDomainInfo_t;

typedef struct _EventSetGranularityInfo {
  int granularity; } EventSetGranularityInfo_t;

typedef struct _EventSetOverflowInfo {
  long_long deadline;
  int count;
  int threshold;
  int EventIndex;
  int EventCode;
  int flags;
  int timer_ms;
  PAPI_overflow_handler_t handler;
} EventSetOverflowInfo_t;

#if 0
typedef struct _EventSetInheritInfo {
  int inherit; } EventSetInheritInfo_t;
#endif

typedef struct _EventSetProfileInfo {
  PAPI_sprofil_t *prof;
  int count; /* Number of buffers */
  int threshold;
  int EventIndex;
  int EventCode;
  int flags;
} EventSetProfileInfo_t;

/* PAPI supports derived events that are made up of at most 2 counters. */

typedef struct _EventInfo {
  _EventInfo *head;	    /* Always points back to EventInfoArray[0] for this EventSet.
			       Used to optimize register allocation across an event set */
  unsigned int event_code;  /* Preset or native code for this event as passed to PAPI_add_event() */
  unsigned counter_index;   /* Index of counter to read in buffer returned by the hardware/kernel
			       This is also used for order dependent derived events to indicate
			       the first operand (replaces PAPI 2 operand_index) */
  hwd_register_map_t bits;  /* Substrate defined collection of bits that keep track of resources 
			       used by this event */
  unsigned hwd_selector;    /* Counter select bits used by the substrate (Replaced by bits??) */
  int derived;		    /* Counter derivation command used for derived events */
} EventInfo_t;

/* Multiplex definitions */

/* This contains only the information about an event that
 * would cause two events to be counted separately.  Options
 * that don't affect an event aren't included here.
 */

typedef struct _papi_info {
	int event_type;
	int domain;
	int granularity;
} PapiInfo;

typedef struct _masterevent {
        int uses;
        int active;
	int is_a_rate;
	int papi_event;
	PapiInfo pi;
        long_long count;
        long_long cycles;
	long_long handler_count;
 	long_long prev_total_c;
 	long_long count_estimate;
 	double rate_estimate;
	struct _threadlist * mythr;
        struct _masterevent * next;
} MasterEvent;

{'fraction_non_alphanumeric': 0.09649861629166165, 'fraction_numerical': 0.006738057995427747, 'mean_word_length': 3.7578706353749283, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2087765', 'n_tokens_mistral': 2750, 'n_tokens_neox': 2647, 'n_words': 902}